CREATE DATA - HANDLE
CREATE DATA dref [area_handle]
TYPE HANDLE handle.
HANDLE addition, the
CREATE DATA statement creates a data object whose data type is described by an
type object. For
handle, a reference variable of the static type of class CL_ABAP_DATADESCR
or its subclasses has to be specified; this reference variable must point to a type object. The type
object may have been created by using the RTTS methods on existing data objects, or by dynamically defining a new data type.
The type object must describe a non-generic type. Only with type objects for the generic ABAP types
x, is a new
bound data type with the
default values created and used. Similarly
with a type object for a standard table with a generic table type, a new bound table type with a standard key is created and used.
Important methods for dynamically defining data types are:
- GET_C, GET_D, GET_F ... of class CL_ABAP_ELEMDESCR for type objects of elementary data types. Either a new type object is created in accordance with the input parameters or an existing one is reused.
- GET of classes CL_ABAP_STRUCTDESCR, CL_ABAP_TABLEDESCR, and CL_ABAP_REFDESCR as well as GET_BY_NAME of class CL_ABAP_REFDESCR for type objects of structures, internal tables and reference variables. These methods return the type object that is specified by means of the input parameters. Either a new type object is created or an existing one is reused.
CREATE of classes CL_ABAP_STRUCTDESCR, CL_ABAP_TABLEDESCR,
and CL_ABAP_REFDESCR for creating type objects for structures, internal
tables, and reference variables. These methods return the type object that is specified by means of the input parameters. A new type object is always created.
We recommend using the GET instead of CREATE methods in order to avoid creating multiple type objects for a particular type.
Refer to Creating a Structure Using RTTC.