Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Creating Objects →  CREATE DATA 

CREATE DATA - TYPE abap_type

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


CREATE DATA dref [area_handle] 
                 TYPE {abap_type|(name)}
                      [LENGTH len] [DECIMALS dec].

Effect

For abap_type, all predefined data types (apart from b and s) can be used that are more dedicated than the static type of dref or are identical to it. As an alternative, a character-type name data object can be specified in brackets, which when the statement is executed contains the name of a predefined data type, upper/lower case is not taken into account here.

For ABAP types c, n, p and x, the length of the dtype data type can be determined by the specification of a numeric len data object after the LENGTH addition, which when the statement is executed contains a value for the length within the interval limits from the table of built-in ABAP types/ If the LENGTH addition 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 LENGTH addition must not be specified.

For the ABAP type p, the number of fractional portions can be determined by the specification of a numeric data object dec after the DECIMALS addition, which when the statement is executed contains a value within the interval limits from the table of built-in ABAP types for the fractional portion. If the DECIMALS addition is not specified, no fractional portions are created. So that the decimal separator is taken into consideration for operations with packed numbers, the program attribute fixed point arithmetic has to be set, otherwise the DECIMALS only affects output formatting on screen and in the statement WRITE [TO]. For all other ABAP types and for the dynamic specification of name, the DECIMALS addition is not permitted.


Continue

creating elementary data objects