Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Catch...Endcatch

Former Member
0 Likes
457

how do i use catch end catch for a function module to catch the system exceptions when a program dumps?

3 REPLIES 3
Read only

Former Member
0 Likes
414

hi ,

DATA: result TYPE i,

number TYPE i.

CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4

OTHERS = 8.

...

result = 1 / number.

...

ENDCATCH.

IF sy-subrc <> 0.

...

ENDIF.

regards,

venkat.

Read only

0 Likes
414

Hi but it says unable to interpret SYSTEM-EXCEPTIONS, i have gone through this bit of code in the F1 Documentation Thank you

Read only

0 Likes
414

The sample code is working fine in our system here. So, two possibilities exist. (1)Your system is on older version of SAP. (2) You have syntax error in your code.

If CATCH is passing the syntax check, but not SYSTEM-EXCEPTIONS, then I suspect the problem is in your code.