SAP Tutorials Blog


 


DATA : NUM1 TYPE I,


            NUM2 TYPE I,


            RES TYPE P DECIMALS 2.


 

NUM1 = 10. NUM2 = 3.


perform CHECK_DISPALY USING NUM1 NUM2 CHANGING RES.


 

NUM1 = 10. NUM2 = 0.


perform CHECK_DISPALY USING NUM1 NUM2 CHANGING RES.


 

 

NUM1 = 20. NUM2 = 8.


perform CHECK_DISPALY USING NUM1 NUM2 CHANGING RES.


*&———————————————————————*


*&      Form  CHECK_DISPALY


*&———————————————————————*


 

 

FORM CHECK_DISPALY  USING    P_NUM1


                                                             P_NUM2


                                            CHANGING P_RES.


CHECK P_NUM2 NE 0.


 

P_RES = P_NUM1 / P_NUM2.


WRITE :/ ‘DIVISION = ‘, P_RES.


ENDFORM.                    ” CHECK_DISPALY


 

*************OUTPUT****************


DIVISION =              3,33


DIVISION =              2,50


Serkan AKKAVAK

Computer Engineer BSc

Head of SAP & Software Department

Contact : serkurumsal@yandex.com