Saturday, September 6, 2014

ABAP TIP how to check the max/min value each abap type

ABAP TIP how to check the max/min value each abap type

Let's see how to check the max/min value depending data type. First, you can check the these values with F1 help reference.





It's also possible to check by using class 'CL_ABAP_EXCEPTIONAL_VALUES'. you can protect the dump error in advance.
 



Let's make a program to check the max/min value with the method of 'get_max_value' and ' get_min_value'.
REPORT  ztest.

DATA gv_int TYPE i.
DATA dref TYPE REF TO data.

FIELD-SYMBOLS  <fs_out>  TYPE ANY.

CALL METHOD cl_abap_exceptional_values=>get_max_value
  
EXPORTING
    
in  gv_int
  RECEIVING
    out 
dref.

ASSIGN dref->TO <fs_out>.
WRITE <fs_out>.

 


No comments:

Post a Comment