SAP RTTI
Get Example source ABAP code based on a different SAP table
ARTICLE
• CL_ABAP_TYPEDESCR ABAP_CLASS
• CL_ABAP_DATADESCR ABAP_CLASS
• CL_ABAP_ELEMDESCR ABAP_CLASS
• CL_ABAP_REFDESCR ABAP_CLASS
• CL_ABAP_COMPLEXDESCR ABAP_CLASS
• CL_ABAP_STRUCTDESCR ABAP_CLASS
• CL_ABAP_TABLEDESCR ABAP_CLASS
• CL_ABAP_OBJECTDESCR ABAP_CLASS
• CL_ABAP_CLASSDESCR ABAP_CLASS
• CL_ABAP_INTFDESCR ABAP_CLASS
The
Concept
The properties of the types are represented by the attributes of
In addition, type description classes for complex types, references, classes, and interfaces have special methods for specifying references to partial types. These methods can be used can navigate to all partial types using a composite type.
Type description objects can only be created using the methods of type description classes. To get a reference to a type description object of a type, the static methods of the class
Note
In the statement
Hierarchy of Type Description Classes
|
|--
| |
| |--
| |--
| |--
| |
| |--
| |--
|
|--
|
|--
|--
Example for
TYPES my_type TYPE i.
DATA: my_data TYPE my_type,
descr_ref TYPE ref to cl_abap_typedescr.
START-OF-SELECTION.
descr_ref = cl_abap_typedescr=>describe_by_data( my_data ).
WRITE: / 'type name:', descr_ref->absolute_name.
WRITE: / 'kind :', descr_ref->type_kind.
WRITE: / 'length :', descr_ref->length.
WRITE: / 'Decimals:', descr_ref->decimals.