CREATE DATA - HANDLE
CREATE DATA dref [area_handle]
TYPE HANDLE handle.
CREATE DATA uses the addition
HANDLE to create a data object whose data type is described by an
type description object.
handle, a reference variable of the static type of class CL_ABAP_DATADESCR
or its subclasses has to be specified, which points to a type description object. The type description
object may have been created using the RTTS methods on existing data objects, or using the dynamic definition of a new data type.
The type description object must describe a non-generic type. Only type description objects for the
generic ABAP types
x create and use a new
bound data type with the
standard values. Similarly, a type description
object for a standard table with a generic table type creates and uses a new bound table type with a standard key.
Important methods for the dynamic definition of data types are:
- GET_C, GET_D, GET_F ... of the class CL_ABAP_ELEMDESCR for type description objects of elementary data types. Either a new type description object is created in accordance with the input parameters or an existing type object is reused.
- GET of the classes CL_ABAP_STRUCTDESCR, CL_ABAP_TABLEDESCR, and CL_ABAP_REFDESCR plus GET_BY_NAME of the class CL_ABAP_REFDESCR for type description objects of structures, internal tables, and reference variables. These methods return the type description object that was specified using the input parameters. A new type description object is created or an existing one is used again.
CREATE of the classes CL_ABAP_STRUCTDESCR, CL_ABAP_TABLEDESCR,
and CL_ABAP_REFDESCR for creating type description objects for structures,
internal tables, and reference variables. These methods return the type description object that was specified using the input parameters. A new type description object is always created.
It is advisable to use the GET methods instead of CREATE to avoid creating multiple type description objects for a single type.