Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Assignments →  Assignment and Conversion 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 handleable exception CX_SY_CONVERSION_OVERFLOW is raised.
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 handleable exception CX_SY_CONVERSION_OVERFLOW is raised.
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 passed 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 ispadded with "*" characters. If the target field is longer than the complete notation, it is padded with blanks 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 passed as a right-aligned character string to the target field. If the target field is longer thanthe character string, the field is padded 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 first converted to the data type i(see above), and then to the type d (see the conversion table for source field type i,(b, s)).
t The content of the source field is first converted to the data type i(see above), and then to the type t (see the conversion table for source field type i,(b, s)).

Byte-Like Target Fields

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