Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Numerical Calculations →  System Classes for Mathematical Operations 

Random Numbers

The class CL_ABAP_RANDOM calls the pseudo random number generator "Mersenne Twister" for different numeric types.

For the one-dimensional case, the following special classes generate random numbers for the different numeric types:

  • CL_ABAP_RANDOM_INT for type i
  • CL_ABAP_RANDOM_FLOAT for type f
  • CL_ABAP_RANDOM_PACKED for type p
  • CL_ABAP_RANDOM_PACKED_DEC1 to CL_ABAP_RANDOM_PACKED_DEC14 for type p with 1 to 14 decimal places.
  • CL_ABAP_RANDOM_DECFLOAT16 for type decfloat16
  • CL_ABAP_RANDOM_DECFLOAT34 for type decfloat34

Other versions: 7.31 | 7.40 | 7.54