SAP TYPE NAMES
Get Example source ABAP code based on a different SAP table
ARTICLE
Absolute Type Names
The type name that can be used statically in ABAP statements is relative to its context, and is also known as the relative type name. As described in
Absolute type names, however, name a type uniquely. An absolute type name as a path specifications is composed of the following components:
The last component of a path must always be
Absolute type names can be used in all statements in which dynamic specification of a data type, a class, or an interface is possible. This makes it possible to stop a local type from obscuring a global type by specifying an absolute type name, and the absolute type names can be used to access the types, classes, and interfaces of other programs dynamically. It is possible to load a different program into the current internal session if this is necessary for access.
A data type is uniquely identified by its absolute type name. Various options exist, however, for forming an unique path for a type. For example, the function group can be omitted for a type in a function module, because every function module is unique. If types are located in a
A data type that only exists as a property of a data object does not have a relative type name. However, internally it has an absolute type name (technical type name) that uniquely defines the data type.
Notes
Example
When the methods
PUBLIC SECTION.
METHODS: m1,
m2,
m3 IMPORTING p TYPE any.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD m1.
DATA struc TYPE spfli.
m3( struc ).
ENDMETHOD.
METHOD m2.
TYPES spfli TYPE spfli.
DATA struc TYPE spfli.
m3( struc ).
ENDMETHOD.
METHOD m3.
DATA type_descr TYPE REF TO cl_abap_typedescr.
type_descr = cl_abap_typedescr=>describe_by_data( p ).
WRITE / type_descr->absolute_name.
ENDMETHOD.
ENDCLASS.