CREATE DATA dref [area_handle]
TYPE REF TO {type|(name)}.
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
before Release 6.20 has to contain the name of a class or an interface when the statement is executed,
and after Release 6.20 can also contain the name of a data type. The name of the reference type in name can also be made in the form of an
absolute type name.
The dynamic specification of object types in name can also be made in lowercase letters.
Dynamic creation of an interface reference variable that is accessed using a field symbol. The absolute type name is used in a literal for the name of the interface that is local in the program.
INTERFACE i1.
...
ENDINTERFACE.
CLASS c1 DEFINITION.
PUBLIC SECTION.
INTERFACES i1.
ENDCLASS.
DATA dref TYPE REF TO data.
FIELD-SYMBOLS <ref> TYPE ANY.
...
CREATE DATA dref TYPE REF TO
('\program=kellerh_test\interface=i1').
ASSIGN dref->* TO <ref>.
CREATE OBJECT <ref> TYPE c1.