F Simple Try Catch program in SAP ABAP | CodeTheta

Simple Try Catch program in SAP ABAP

July 17, 2024

Code:

DATA: res TYPE char10.
PARAMETERS: p1 TYPE char10,
            p2 TYPE char10.

TRY.
    res = p1 / p2.
    WRITE:/ res.
  CATCH cx_sy_zerodivide.
    WRITE: 'cannot divide by zero'.
ENDTRY.

IDE Used To Test This Code : SAP ABAP Editor.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Post a Comment