Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Assignments →  Assignment Rules →  Conversion Rules for Elementary Data Objects →  Numeric Source Fields 

Source Field Type f

Other versions: 7.31 | 7.40 | 7.54

Numeric Target Fields

Target Conversion
i, (b, s) The value of the floating point number is rounded up to the nearest integer. If this number is within thevalue range for the data type i,(b, s), it is converted to the internal representationof the corresponding integer number. If the number is not within this range, the treatable exception CX_SY_CONVERSION_OVERFLOW occurs.
p The value of the binary floating point number is rounded to the number ofdecimal places inthe target field. If this number is within the value range for the data type of the target field, itis converted to the internal representation of a packed number. If the number is not within this range, the treatable exception CX_SY_CONVERSION_OVERFLOW occurs.
decfloat16, decfloat34 The value of the binary floating point number is rounded to 17 decimal places (depending on theplatform) and converted to the value of a decimal floating point number. The format in the decimal floating point number is such that the mantissa has no trailing zeroes.
f The content of the source field is transferred unconverted.

Character-Like Target Fields

Target Conversion
c The value of the binary floating point number is formatted in the same way as when converting tothe data type string. If the target field is shorter than the complete notation,the mantissa is rounded up. If the target field is not long enough to include at least one digit ofthe mantissa apart from the exponent and the minus sign (for a negative value), the target field isfilled with "*" characters. If the target field is longer than the complete notation, it is filled with blank characters from the left.
string The value of the binary floating point number is formatted inscientific notationand is copied into the target field. The exponent is always displayed with a plus/minus sign and atleast two digits, and the mantissa with one place before the decimal point and 16 places in the fractionalportion. To do this, the internal representation of the floating point number is rounded to 17 decimalplaces (depending on the platform) Depending on the plus/minus sign and the length of the exponent, the resulting length of the target field is between 22 and 24.
n The value of the floating point number is rounded up to the nearest integer. The absolute valueis transferred as a character string right-aligned to the target field. If the target field is longerthan the character string, the field is filled with zeros from the left. If it is too short, the values to the left are cut off.
d The content of the source field is converted first to data type i (seeabove) and then to type d (see conversion table for source field type i,(b, s)).
t The content of the source field is converted first to data type i (seeabove) and then to type t (see conversion table for source field type i,(b, s)).

Byte-Like Target Fields

Target Conversion
x The content of the source field is converted first to data type i (seeabove) and then to type x (see conversion table for source field type i,(b, s)).
xstring The content of the source field is converted first to data type i (seeabove) and then to type xstring (see conversion table for source field type i,(b, s)).