Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Declarative statemnts →  Data Types and Data Objects →  Types and Objects - Overview →  Details of Special Data Types or Data Objects →  Numeric Data Types 

Numeric Data Types - Hints on Use

The following hierarchy shows you which numeric data type to use in which situation:

  • If you need whole numbers, use data type i.
    If the value range of i is too small, use packed numbers without fractional portions. If the value range of the packed numbers is too small, use decimal floating point numbers.
  • If you need fractions with a number of decimal places known at the time the program was created, use data type p. Note, however, that calculations require intermediate results to be saved with the greatest possible precision. This means that numbers with a fixed number of decimal places are generally more suited to inputs and outputs than as interface parameters.
    If the value range of p is too small, and for calculations, use decimal floating point numbers.
  • If you need fractions with a variable number of decimal places or a larger value range, use the data types decfloat16 or decfloat34. The data type decfloat16 uses less memory than decfloat34, but its runtime is not shorter. Only use decfloat16 if you need to save memory.
  • Use the data type f only if performance-critical algorithms (such as matrix operations) are involved and precision is not important.
  • Other versions: 7.31 | 7.40 | 7.54