Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Creating Objects →  CREATE DATA 

CREATE DATA - REF TO

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


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

Effect

With the TYPE REF TO addition, the CREATE DATA statement creates a reference variable. The reference variables can be specified either directly as type or dynamically in name.

The same type rules apply to the type specification as to the definition of reference types with the TYPES statement. For data reference variables, either the generic data type 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-type field can be specified, which has to 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 made in the form of an absolute type name.


Note

The dynamic specification of object types in name can also be made in lowercase letters.


Example

Refer to creating reference variables.

Continue

Creating Reference Variables