Ansicht
Dokumentation

ABAPCREATE_DATA_REFERENCE - CREATE DATA REFERENCE

ABAPCREATE_DATA_REFERENCE - CREATE DATA REFERENCE

CL_GUI_FRONTEND_SERVICES - Frontend Services   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

CREATE DATA, REF TO

Short Reference



CREATE DATA dref $[area_handle$]
                 TYPE REF TO ${type$|(name)$}.

Effect

The addition TYPE REF TO is used by the statement CREATE DATA to create a reference variable. The static type of the reference variable can be specified either directly as type or dynamically in name.

When type is specified, the same rules apply as to the definition of reference types using the statement TYPES. For data reference variables, either the generic type data or a completely specified data type can be specified. For object reference variables, either a class or an interface can be specified.

For name, a character-like field can be specified that must contain the name of a class, an interface, or a data type when the statement is executed. The name of the reference type in name can also be specified as an absolute type name.

Note

Object types in name can also be specified dynamically in lowercase letters.

Example

Creation of an anonymous data object as reference variable of the static type of a class. The dereferenced reference variable can be used to create an object of the class and to access its components.

Creating Reference Variables








CPI1466 during Backup   General Material Data  
This documentation is copyright by SAP AG.

Length: 2060 Date: 20240616 Time: 104135     sap01-206 ( 38 ms )