What does it do? The type of the created data object is defined by a type or data object specification.
For type>, any data type can be specified from the ABAP Dictionary, particularly the DDIC structure of a DDIC database table BEGIN_SECTION VERSION 5 OUT , a DDIC view>, END_SECTION VERSION 5 OUT a CDS> entity, a CDS type> or a public data type of a global class, or any data type of the same program already defined using TYPES> and that is either more specific than or identical to the static type of dref>. Alternatively, a character-like data object name>, which is not case-sensitive, can be specified in parentheses that contains the name of the existing data type when the statement is executed. The name in name > can also be an absolute type name >. If a standard table type with a generic primary table key is specified after TYPE >, a new bound> table type with standard key is created and used.
A data object that is visible> at this point can be specified> for dobj>. The generated data object inherits the current data type. If dobj> is specified as a formal parameter or field symbol, it can be completely or partially generic. When the statement CREATE DATA> is executed, a data object must be bound to a generically typed field symbol or parameter and its type is used. In the case of a completely typed field symbol or parameter, the declared type is used and no data object must be bound. The optional addition LINE OF> can be used if type> or the name in name> is a table type, or if dobj> is an internal table. As a result, the generated data object inherits the properties of the line type of the internal table.
Latest notes:
The data objects which can be referred to using LIKE> include the public attributes of global classes.
If an anonymous data object is created with an enumerated type>, the same rules apply to this object as to every other data object of this type.
If a data type type> is used, the instance operator> NEW>> acts like the statement CREATE DATA dref TYPE type> and can be used in general expression positions>. The dynamic specification of name> is not possible here. NON_V5_HINTS
If a type of another program is specified using an absolute type name> in name>, this program is loaded into a new additional program group> or into the current program group>, depending on the program type, if it was not already loaded. ABAP_HINT_END
ABAP_EXAMPLE_VX5 Creation of an anonymous data object of type SCARR>. ABEXA 00157 ABAP_EXAMPLE_END
ABAP_EXAMPLE_ABEXA Creating Structured Data Objects > ABAP_EXAMPLE_END