We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!
CREATE DATA dref $[area_handle$]
$[LENGTH len$] $[DECIMALS dec$].
Creation of a data object with an explicitly specified data type. For the data type, all built-in data types, apart from b and s, can be used that are more specific than the static type of dref or are identical to it. The name of the type can be specified as follows:
For the ABAP types c, n, p, and x, the length of the data type dtype can be determined by specifying a numeric data object len after the addition LENGTH, which, when the statement is executed, contains a value within the length range specified for the respective type. If the addition LENGTH is not specified, the standard length from the table is used. For all other ABAP types, the length is determined by the value in the table and the addition LENGTH cannot be specified.
For the ABAP type p, the number of
decimal places can be determined by specifying a numeric data object dec after the addition
DECIMALS. If DECIMALS is specified, the same applies as to the statement TYPES.
If the addition DECIMALS is not specified, no decimal places are created. For the decimal separator to be respected in operations with packed numbers, the
fixed point arithmetic must be set. Otherwise, the addition DECIMALS only affects the formatting
of dynpros and the statement WRITE $[TO$].
For all other ABAP types and if name is specified dynamically, the addition DECIMALS is not allowed.
If a data type abap_type is used, the
instance operator NEW acts like the statement CREATE DATA dref TYPE abap_type and can be used in
general expression positions. The dynamic specification of name is not possible here.
Creation of an anonymous data object of the type of a packed number with length specification and decimal
places. Since the static data type of the data reference variable is generic, dereferencing is only possible by assignment to a field symbol.