Ansicht
Dokumentation

ABENSHEET_DYN_PROG_ABEXA - SHEET DYN PROG ABEXA

ABENSHEET_DYN_PROG_ABEXA - SHEET DYN PROG ABEXA

Fill RESBD Structure from EBP Component Structure   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

Dynamic Programming

This example demonstrates various syntactical options and concepts related to dynamic programming as outlined in the ABAP cheat sheet Dynamic Programming.

Source Code

Execute

Description

The output shows the outcome of various ways about how to work with dynamic programming concepts. Find comments in the output explaining the context and details. Basically, all variants described in the ABAP cheat sheet Dynamic Programming are covered and more:

  • Field symbols: Declaring field symbols, assigning field symbols to data objects, unassigning field symbols, accessing and working with field symbols
  • Data references: Declaring data reference variables, assigning data references (creating data references to existing data objects, creating new data objects at runtime, copying existing data references including upcasting and downcasting), accessing and working with data references (overwriting existing and keeping data references, processing internal tables)
  • Dynamic ABAP syntax components
  • Dynamic specification of data objects and fields

  • Dynamic specification of types

  • Dynamic specification of clauses in ABAP SQL statements

  • Dynamic specification of procedures

  • Runtime type services (RTTS)
  • Runtime type identification (RTTI)

  • Runtime type creation (RTTC)

To cater for a real dynamic determination at runtime, the example includes the local class LCL_DET_AT_RUNTIME whose methods return character-like content to be used in the tokens of ABAP statements. The content is predefined in this class offering a variety of possibilities, e. g. multiple names of existing data objects are added to an internal table. The methods are implemented in a way to produce a random integer representing the table index. In doing so, the name of a data object is determined at runtime and finally returned to be used in dynamic ABAP statements.






General Data in Customer Master   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 2771 Date: 20240329 Time: 031314     sap01-206 ( 47 ms )