Actually it’s simple: Multiply the length by 2 and you will have total digit count including decimal places and the sign. If you have a packed decimal of length 13, you are allowed 25 digits for integer part and fractional part cumulated plus one place for the sign. In case you are in doubt, ABAP has a pretty nifty class to get minimum and maximum values of a numeric variable. Here is how to use it:

DATA: pack   TYPE p LENGTH 2 DECIMALS 2,
      result TYPE REF TO data.
 
FIELD-SYMBOLS <result> TYPE ANY.
 
result = cl_abap_exceptional_values=>get_min_value( pack ).
 
IF result IS NOT INITIAL.
  ASSIGN result->* TO <result>.
  cl_demo_output=>write_data( <result> ).
ENDIF.
 
result = cl_abap_exceptional_values=>get_max_value( pack ).
 
IF result IS NOT INITIAL.
  ASSIGN result->* TO <result>.
  cl_demo_output=>write_data( <result> ).
ENDIF.
 
cl_demo_output=>display( ).
 
 

Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP S/4 HANA Logistics Consultant
Contact : serkurumsal@yandex.com