sapdev logo background
sapdev logo sapdev logo
Comments

SAP NEWS-640-RTTI documentation, setup help and example usage



Return to SAP documentation index



Runtime Type Services in 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 (as of Release 6.40) the RTTI and also runtime type creation ( RTTC ).

1 Methods for creating data types
2 New methods for types from ABAP Dictionary
3 Enhancement of method GET_COMPONENT_TYPE
4 Enhancement of method GET_PROPERTY
5 New method HAS_PROPERTY
6 New method GET_CLASS_NAME
7 New method GET_DATA_TYPE_KIND


ABAP_MODIFICATION_1 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 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 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 attributes 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_2 New methods for types from ABAP Dictionary

If the type of a type description object comes from ABAP Dictionary, the dictionary attributes 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
CL_ABAP_TYPEDESCR= GET_DDIC_OBJECT
returns the runtime object of a type from ABAP Dictionary

for elementary data types

CL_ABAP_ELEMDESCR= GET_DDIC_FIELD
returns the attributes 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_3 Enhancement of 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 .

ABAP_MODIFICATION_4 Enhancement of 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_5 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_6 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_7 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 prefix
TYPE_KIND_ of class CL_ABAP_DATADESCR .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




NEWS-640-OTHERS
NEWS-640-SELECTION_SCREENS




comments powered by Disqus