In the ABAP language, there are types that are predefined in every ABAP program. The table below shows the predefined ABAP types.
Type | Length | Standard length | Description |
---|---|---|---|
b |
One byte |
|
One byte integer (internal) |
c |
1 to 65,535 characters |
One character |
Text field |
cursor |
As i |
As i |
Database cursor |
d |
Eight characters |
|
Date field (format YYYYMMDD) |
decfloat16 |
Eight bytes |
|
Decimal floating point number with 16 decimal places |
decfloat34 |
sixteen bytes |
|
Decimal floating point number with 34 decimal places |
f |
Eight bytes |
|
Binary floating point number with 16 decimal places |
i |
Four bytes |
|
Four byte integer |
n |
1 to 65,535 characters |
One character |
Numeric text |
p |
1 to 16 bytes |
Eight bytes |
Packed number (implementation depends on hardware platform) |
string |
Variable |
|
Text string |
s |
Two bytes |
|
Two byte integer (internal) |
t |
Six characters |
|
Time field (format HHMMSS) |
x |
1 to 65,535 bytes |
One byte |
Byte field |
xstring |
Variable |
|
Byte string |
The predefined ABAP types decfloat34 and decfloat16.
The information below describes the attributes of these data types.
The value range is 1-1E+370 to -1E-398, 0, +1E-398 to +1E+370-1 for decfloat16 and 1-1E+6112 to -1E-6176, 0, +1E-6176 to 1E+6112-1 for decfloat34. The maximum precision is 16 decimal places or 34 decimal places, respectively.
Decimal floating point numbers with fractional portions or exponents cannot be declared directly in the program; instead, you have to use text literals whose content can be interpreted as a number. That is, a number in a mathematical, scientific, or commercial notation.
We recommend decimal floating point numbers if precision and a large range of values are of importance. They do not have the disadvantages of binary floating point numbers. These binary floating point numbers cannot represent each decimal number in their value range exactly. Decimal floating point numbers have a much larger value range and a higher level of precision than packed numbers. When you have to save space (main memory and database), use the decfloat16 type instead of decfloat34.
By using the EXACT addition of the COMPUTE statement, it is possible to force an exact calculation for decimal floating point numbers under certain circumstances. No rounding is permitted in exact calculations and it leads to an exception.
Internally, decimal floating point numbers are represented by a 16-digit or 34 digit decimal mantissa and a decimal exponent. The exponent is between -383 and +384 or -6143 and + 6144, respectively.