官术网_书友最值得收藏!

Introduction

This chapter explores recipes related to dynamic programming. Dynamic programming is a very vast topic. It may be simply defined as a technique whose behavior/effect is only evident at execution time. There are many facets of dynamic programming with ABAP. These include generic programming such as dynamic source code generation. Also specifying parts of the Open SQL statements (clauses) dynamically using string variables, and the creation of data objects based on a type known only at runtime are within the dynamic programming landscape. When using dynamic programming, we may also sometimes need to determine the data type of data objects at runtime. This is called Runtime Type Identification (RTTI).

The ABAP language provides a number of features/options for making programs dynamic or to avoid hardcoding of values. We will start with application of field symbols and references. As an example, we will create a program that will take as input the name of a table and print its contents.

Also we will look at some of the ways in which dynamic SQL may be applied to fulfill simple requirements. We will also cover the option of generating ABAP programs at runtime using the INSERT REPORT statement.

The examples are kept simple in order to emphasize on the dynamic programming concept. We assume that the reader is familiar with basics of SELECT statement, the CREATE DATA statement and the concept of field symbols, and the ASSIGN statement. Also, the knowledge of the cl_abap_datadescr classes is assumed. Moreover, the knowledge of downcasting (widening cast) is also important.

主站蜘蛛池模板: 敦煌市| 香港 | 碌曲县| 嘉兴市| 叙永县| 木兰县| 福鼎市| 武宣县| 黔西县| 沙河市| 庐江县| 扬州市| 无棣县| 永兴县| 潍坊市| 荔波县| 桃园县| 拜泉县| 湖口县| 吉林市| 兴海县| 咸宁市| 扬中市| 西畴县| 平遥县| 东乡县| 四会市| 南郑县| 兴隆县| 雷山县| 黔江区| 新龙县| 洪江市| 凤山县| 和政县| 甘肃省| 和田县| 泽库县| 桑植县| 邵东县| 桑植县|