Google Search - Blog...........

Showing posts with label abap sample code on try catch block. Show all posts
Showing posts with label abap sample code on try catch block. Show all posts

ABAP - Example On Try-Catch Block.

REPORT YSUBCLASS_EXCEPTION_3.

START-OF-SELECTION.

DATA : num type i value 5 .

TRY.
TRY.
num = 'subhendu'.
cleanup.
write:/5 'In cleanup'.
ENDTRY.
CATCH cx_sy_conversion_no_number.
WRITE:/5 'Cannot be converted to number'.
ENDTRY.


Output
In cleanup
Cannot be converted to number