Ansicht
Dokumentation

ABAPCREATE_DATA_EXISTING - CREATE DATA EXISTING

ABAPCREATE_DATA_EXISTING - CREATE DATA EXISTING

ABAP Short Reference   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

CREATE DATA, TYPE, LIKE

Short Reference



CREATE DATA dref $[area_handle$]
                 ${ ${TYPE $[LINE OF$] ${type$|(name)$}$}
                 $| ${LIKE $[LINE OF$] dobj$} $}.


Effect

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, a DDIC view, or a CDS entity, 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.

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.

Example

Creation of an anonymous data object of type SCARR.

Creating Structured Data Objects






General Data in Customer Master   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 4731 Date: 20240616 Time: 115354     sap01-206 ( 93 ms )