Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Creating Objects and Values →  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-like data object name can be specified in parentheses, which contains the name of a predefined data type when the statement is executed. This is not case-sensitive.

In 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 defined for the type in question. 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.

In the ABAP type p, the number of decimal places is determined by specifying a numeric data object dec after the addition DECIMALS. If DECIMALS is specified, the same applies as in the statement TYPES. If the addition DECIMALS is not specified, no fractional portion is created. Before the decimal separator can be respected for operations with packed numbers, the program attribute fixed point arithmetic has to be set. If not, the addition DECIMALS only affects output formatting on dynpros and in the statement WRITE [TO]. For all other ABAP types and when specifying name dynamically, the addition DECIMALS is not permitted.


Continue

Creating Elementary Data Objects - Example