I learned so far that there are two types of handling exceptions in ABAP. It is through a non-class based and a class based exception classes:
SUMMARY: Untick the class exception in the exception parameter of a method to create a non-class based.
Creating a class based should start your class name in CX_*. Watch out for my next blog.
NOTE: this is the proper syntax for the attribute '&' as shown in the pic below:
Just an addition, you may want also to catch any generic SAP error by using the syntax below:
data OREF type ref to CX_ROOT.
data TEXT type STRING.
try.
[statement]
catch CX_ROOT into OREF.
TEXT = OREF->GET_TEXT( ).
TEXT = OREF->GET_TEXT( ).
endtry.
To create a non class-based exception in a funtion
Please check this link from SAP SDN!
No comments:
Post a Comment