Catch divide by zero exception in abap

REPORT  zmstest_divide_zero_exc.
 
START-OF-SELECTION.
 
  DATA : num TYPE i VALUE 5 .
 
  TRY.
      num = num / 0 .
    CATCH cx_sy_zerodivide .
      WRITE:/5 'Division by 0 caught' .
 
  ENDTRY.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert