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

Other versions: 7.31 | 7.40 | 7.54


Note

Instead of a conversion, string templates or the statement WRITE ... TO can often be used with their formatting options to assign numeric values to text fields and text strings.


Example

Conversion of the integer 100 to different target types. The type-friendly formatted output is 1E+02, 0000000100, 64, 000140.

DATA num TYPE i VALUE 100. 

TYPES n10 TYPE n LENGTH 10. 
cl_demo_output=>display( 
  |decfloat34:  { CONV decfloat34( num ) STYLE = SCIENTIFIC }\n| && 
  |n LENGTH 10: { CONV n10( num ) }\n| && 
  |xstring:     { CONV xstring( num ) }\n| && 
  |t:           { CONV t( num ) }\n| ).

Continue

Source Field Type i, int8, (b, s)

Source Field Type p

Source Field Type decfloat16, decfloat34

Source Field Type f