ABAP - Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Attributes of Data Objects → 

RTTS - Runtime Type Services

The RTTS are implemented through a hierarchy of type description classes that contain the methods for RTTC (Runtime Type Creation) and RTTI (Runtime Type Identification). With the help of these system classes it is possible


The properties of the types are represented by the attributes of type description objects. For each type there is exactly one type description object. The attributes of the type description object contain information on the properties of the type. For each kind of type (elementary type, table, class, and so on), there is a type description class with special attributes for special type properties. The class hierarchy of the type description classes corresponds to the hierarchy of the type kinds in the ABAP type system.

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 CL_ABAP_TYPEDESCR can be used or call methods of the special type description classes.


In the statement CREATE DATA, type description objects can be specified after the addition HANDLE to create data objects with dynamically created data types.

Hierarchy of Type Description Classes

  |   |
  |       |

Example for RTTI

REPORT typedescr_test.

TYPES my_type TYPE i.

DATA: my_data   TYPE my_type,
      descr_ref TYPE ref to cl_abap_typedescr.

  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.

Ascertaining Data Types
Ascertaining Object Types