SAP AMDP ABAP TYPES ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_AMDP - Access to ABAP Types
The example demonstrates how to access ABAP types using the AMDP macro $ABAP.type.

ABAP_SOURCE_CODE
DEMO CL_DEMO_AMDP_ABAP_TYPES_ACCESS

ABAP_DESCRIPTION
This example calls the following AMDP method of the class CL_DEMO_AMDP_ABAP_TYPES :
METH CL_DEMO_AMDP_ABAP_TYPES=>DEMO_ABAP_TYPES
In the method, a local table variable mytab is declared using DECLARE in SQLScript. All columns of the table variable are declared using the AMDP macro $ABAP.type with reference to ABAP types. The first four ABAP types, MANDT, SYST_UNAME, SYST_LANGU, and SYST_DATUM, are defined in the ABAP Dictionary. Type line_text comes from a TYPES statement of its own class. f stands for the built-in numeric ABAP type.
The table variable is filled using assignments to columns with one row, where the specification of the AMDP macro $ABAP.type is also shown in a CAST expression. Finally, the content of the table variable is imported into the tabular output parameter itab, whose row type is made up of components of the same ABAP types, which are used to define the table variable.