SAP TYPE P VALUE RANGE ABEXA



Get Example source ABAP code based on a different SAP table
  



Value Ranges of Packed Numbers
This example demonstrates the value ranges of packed numbers with different lengths and decimal places.

ABAP_SOURCE_CODE
DEMO CL_DEMO_TYPE_P_VALUE_RANGE

ABAP_DESCRIPTION
The value range of a packed number with the length length and decimals decimal places is one of the following according to the formula in this table):
( -10^(2xlength-1) +1 ) / ( 10^decimals )
to
( +10^(2xlength-1) -1 ) / ( 10^decimals )
The method creates a packed number with a length and decimal places that can be entered from outside. The minimum and maximum values of the number are determined using methods of the system class CL_ABAP_EXCEPTIONAL_VALUES and compared with self-calculated values.