ABAP Type Names

Every explicit type, that is, all types defined in the ABAP Dictionary or or in the ABAP source code using TYPES command, has a relative type name and an absolute type name. Implicit types are created when, at the DATA command in the TYPE specification, a new type is derived from an existing one, for example, using REF TO or LINE OF. These implicit types do not have a relative type name but the system generates a technical absolute type name. Technical absolute type names are assigned as long as the program, in which the type is located, is not changed.

Example

TYPES:
  my_ref_type TYPE REF TO c01.

DATA:
  ref1 TYPE my_ref_type,
  ref2 TYPE REF TO c01.

The variable REF1 was created with an explicit type, that is, the type of the variable REF1 has the type name MY_REF_TYPE. The variable REF2 was created with a type which was first implicitly constructed in the DATA statement. This means that the type of variable REF2 does not have a type name.

Relative Type Names

Relative type names are not unique. The point in the program, at which type is used, defines which type is meant. Each type name assigned in the Dictionary or in the TYPES statement is a relative type name.

Absolute Type Names

Absolute type names are unique within a system. It is not important in which area the type name is used. The name always points to the same type. This prevents types from being hidden by other types. Absolute type names can only be specified dynamically. This means you can use them only for those statements supporting the dynamic variant of the TYPE addition.

Unlike relative type names, absolute type names contain additional information about the context in which the type was defined. For this purpose, absolute type names are subdivided into sections (tags), similarly to the path of file names. The individual tags are separated by a backslash (\). An absolute type name always begins with a backslash. The following tags are allowed:

Absolute type names always end with one of the following three tags:

If an absolute type name consists of only one of these three tags, it is a global type (Dictionary), a global class, or a global interface.

Example

PROGRAM my_program.
...
TYPES my_type TYPE i.
...
CLASS my_class DEFINITION.
  PUBLIC SECTION.
    METHODS my_method.
ENDCLASS.
...
CLASS my_class IMPLEMENTATION.
  METHOD my_method.
    TYPES my_type TYPE f.
    ...
  ENDMETHOD.
ENDCLASS.

Two types were defined in this program. Both types have the relative type name MY_TYPE. The point in the program where the type is used defines which type is referred

However, both types have a different absolute type name:

Both types can be uniquely identified in all areas of the program by the absolute type name.