SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Creating Objects and Values → CREATE DATA →
CREATE DATA - TYPE abap_type
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.
Example
See creating elementary data objects.