SAP ABAP LANGUAGE DYNAMIC

Get Example source ABAP code based on a different SAP table
  


ARTICLE

Dynamic Program Editing
In addition to the static program development in ABAP Workbench, the following components:
Source code
Text elements
Dynpro
of ABAP programs can be created and edited using language elements. This method for creating programs is known as dynamic program development.
ABAP Code Snippet

Security Note

ABAP Code Snippet If used wrongly, dynamic programming techniques can present a serious security risk. Any dynamic content that is passed to a program from the outside must be checked thoroughly or escaped before being used in dynamic statements. This can be done using the system class CL_ABAP_DYN_PRG or the predefined function escape.
ABAP Code Snippet
ABAP Code Snippet

Notes
On the one hand, the statements for dynamic program development provide a powerful and flexible method of dynamic programming, but on the other hand this type of programming is very elaborate and the programs are difficult to maintain. Therefore, it is recommended that other dynamic programming options for application programs are used first, before using dynamic program development. In ABAP, dynamic programming is facilitated by:
Generic data types for typing
Data objects, whose size is not statically defined ( internal tables, strings)
Field symbols and reference variables
Dynamic creation of data types using runtime time creation
Dynamic creation of data types using CREATE DATA
Dynamic token specification, meaning the dynamic specification of operands or entire clauses as data objects in parentheses
The statements for dynamic program development do not carry out authorization checks or other checks. These must be programmed separ ately. The following special function modules can be used for the required checks in addition to the statement AUTHORITY-CHECK:
The function module RS_ACCESS_PERMISSION carries out all authorization checks that are also carried out when the ABAP Editor is called.
The function module TR_SYS_PARAMS and other function modules of the function group STR9 determine whether repository objects can be changed.
See ABAP Command Injections.