TYPES { {dtype[(len)] TYPE abap_type [DECIMALS dec]}
| {dtype TYPE abap_type [LENGTH len] [DECIMALS dec]} }.
If a predefined data type abap_type is specified, a non-generic elementary data type is defined. For abap_type, all predefined data types from the table of predefined ABAP types can be used, except for b and s.
For the ABAP types c, n, p and x, the length of the data type dtype must be specified by entering a numeric literal or a numeric constant len within the related interval limits. For all other ABAP types, the length is determined by the value in the table of predefined ABAP types and no length can be specified in len.
The length len is either specified in parentheses directly after the type name dtype, or since release 6.10, after the addition LENGTH.
If the addition DECIMALS is used, for the ABAP type p, the number of
decimal places must be determined
by specifying a numeric literal or a numerical constant dec
from the table of predefined ABAP types, within the interval limits. For the decimal separator to be taken into account in operations involving packed numbers, the
program attribute 'fixed point
arithmetic' must be set. Otherwise, the addition DECIMALS only affects the output format of lists.
The specification of TYPE abap_type can be omitted. The type is then implicitly set to the standard type c. Outside of classes or interfaces, for the ABAP types c, n, p and x, the specification of len or dec can also be omitted. The new type dtype is then set to the standard length from the table of predefined ABAP types, and for p, is set to zero decimal places.
These statements create three elementary data types that are local to the program. Values for the unspecified technical properties of the predefined types c and p are specified.
TYPES: text10 TYPE c LENGTH 10,
text20 TYPE c LENGTH 20,
result TYPE p LENGTH 8 DECIMALS 2.