Get Example source ABAP code based on a different SAP table
Runtime Type Services in ABAP Release 6.40 The runtime type services (RTTS) > are a further development of the former runtime type identification (RTTI)>. With the enhancement of the type description classes> to include methods for creating dynamic types (see modification 1), the RTTS include (from ABAP_RELEASE 6.40) the RTTI and also runtime type creation (RTTC). ITOC
ABAP_MODIFICATION_NN Methods for Creating Data Types>
The type description classes of RTTI were enhanced using RTTC> methods. These methods create type description objects independently of existing types. This means what was previously RTTI becomes the RTTS>. Together with the addition HANDLE> of the statements CREATE DATA>> and ASSIGN>>, the RTTC-specific methods of the RTTS allow the construction of data objects of any types for the program runtime and the casting> of dynamic types. The most important new methods for dynamically defining data types are:
GET_C>, GET_D>, GET_F>, and so on of class CL_ABAP_ELEMDESCR>> for creating type description objects for elementary data types.
CREATE> of class CL_ABAP_STRUCTDESCR>> for creating type description objects for structured data types based on a component table.
CREATE> of class CL_ABAP_TABLEDESCR>> for creating type description objects for table types, where the properties of the table are passed to the input parameters.
CREATE> of class CL_ABAP_REFDESCR>> for creating type description objects for reference types, where the static type is passed to an input parameter.
ABAP_MODIFICATION_NN New Methods for Types from ABAP Dictionary >
If the type of a type description object comes from ABAP Dictionary, the dictionary properties of the type can be identified using the following methods: For any data types>
CL_ABAP_TYPEDESCR=>IS_DDIC_TYPE> returns abap_true> when the object describes a type from ABAP Dictionary
CL_ABAP_TYPEDESCR=>ABSOLUTE_NAME> returns the absolute name of a type (also for program-defined types)
CL_ABAP_TYPEDESCR=>GET_DDIC_HEADER> returns the <(>nametab<)> header> of a type from ABAP Dictionary
CL_ABAP_TYPEDESCR=>GET_DDIC_OBJECT> returns the <(>nametab<)> field descriptions> of a type from ABAP Dictionary For elementary data types>
CL_ABAP_ELEMDESCR=>GET_DDIC_FIELD> returns the properties of the data element and its texts (replaces function module DDIF_FIELDINFO_GET>)
CL_ABAP_ELEMDESCR=>GET_DDIC_FIXED_VALUES> returns the fixed values> of the data element For structures and database tables>
CL_ABAP_STRUCTDESCR=>GET_DDIC_FIELD_LIST> returns the features of the structure and its texts (replaces function module DDIF_FIELDINFO_GET>)
ABAP_MODIFICATION_NN Enhancement of the MethodGET_COMPONENT_TYPE>>
Previously, the method GET_COMPONENT_TYPE> of class CL_ABAP_STRUCTDESCR> for parameter P_NAME> only accepted actual parameters of types string> and c>. Although the formal parameter is type any>, during the call, a type check was executed that caused a serious error for non-text-like actual parameters. Actual parameters of type csequence> and numeric > are now accepted. A text-like parameter is interpreted as a component name, a numeric parameter as the position of the component in the structure. An actual parameter that does not apply to csequence > or numeric> raises the non-class-based exception UNSUPPORTED_INPUT_TYPE>.
ABAP_MODIFICATION_NN Enhancement of the Method GET_PROPERTY >>
A new public constant CL_ABAP_TYPEDESCR=>TYPEPROPKIND_HASCLIENT> has been introduced. If this constant of method GET_PROPERTY> is passed to class CL_ABAP_TYPEDESCR>, the system checks whether the type of the type description object has a client field. A reference to a data object of type abap_bool> is always returned. If the type has a client field, the referenced data object has the value of the constant abap_true>. If the type does not have a client field or if it does not affect a structure, the referenced data object has the value of the constant abap_false>.
ABAP_MODIFICATION_NN New Method HAS_PROPERTY>>
A new public method HAS_PROPERTY> has been introduced in class CL_ABAP_TYPEDESCR>. Unlike GET_PROPERTY>, this method only identifies whether a type has a property and only returns the values from abap_true> or abap_false>.
ABAP_MODIFICATION_NN New Method GET_CLASS_NAME>>
A new public method GET_CLASS_NAME> has been introduced in class CL_ABAP_CLASSDESCR>. This method returns the name of the class of an object.
ABAP_MODIFICATION_NN New Method GET_DATA_TYPE_KIND>>
A new public method GET_DATA_TYPE_KIND> has been introduced in class CL_ABAP_DATADESCR>. This method returns the same values as the statement DESCRIBE FIELD> > with the addition TYPE>. These values are also defined as constants with the prefix TYPE_KIND_> of class CL_ABAP_DATADESCR>.