The Run Time Type Services (RTTS) are a further development of the previously-named Run Time Type Identification
(RTTI). With the enhancement of the
type classes to methods for dynamic type creation (see modification 1), the RTTS include as of Release 6.40 both the RTTI and also a Run Time Type Creation
(RTTC).
1. Methods for creating data types
2. New methods for types from the ABAP Dictionary
3. Enhancement to method GET_COMPONENT_TYPE
4. Enhancement to method GET_PROPERTY
5. New method HAS_PROPERTY
6. New method GET_CLASS_NAME
7. New method GET_DATA_TYPE_KIND
- Methods for creating data types
The type classes of RTTI were enhanced with RTTC methods that create type objects independently of existing types. The previous RTTI becomes the RTTS.
Together with the HANDLE addition to statements CREATE DATA ad 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 the dynamic definition of data types are:
- New methods for types from the ABAP Dictionary
If the type from the type object comes from the ABAP Dictionary, you can determine the dictionary attributes of the type using the following methods:
for any data types
for elementary data types
for structures and database tables
- Enhancement to method GET_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 triggers the non-class-based exception UNSUPPORTED_INPUT_TYPE.
- Enhancement to method GET_PROPERTY
A new public constant CL_ABAP_TYPEDESCR=>TYPEPROPKIND_HASCLIENT has been introduced. If this constant
of method GET_PROPERTY is transferred to class CL_ABAP_TYPEDESCR, the system checks whether the type
of type 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 .
- New method HAS_PROPERTY
A new public method HAS_PROPERTY has been introduced in class CL_ABAP_TYPEDESCR. Unlike GET_PROPERTY,
this method only determines whether a type has a property and only returns the values from ABAP_TRUE or ABAP_FALSE.
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.
- 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 statement DESCRIBE FIELD with addition TYPE. These values are also defined as constants with the prefixe TYPE_KIND_ of class CL_ABAP_DATADESCR.