SAP CALL EXCEPTIONS ABAP Statements

Get Example source ABAP code based on a different SAP table
  


ABAP Code Snippet

You can use EXCEPTIONS to assign return values to non-class-based exceptions exc1 exc2 ... declared in the parameter interface. Each exception exc1 exc2 ... that the caller wants to handle must be assigned to a directly specified number n1 n2 .... You can specify all numbers between 0 and 65535. The behavior outside of this range is undefined.
INTHINT All other intervals 2^n bis 2^(n+1)-1
INTHINT within the range of INT4 are mapped to
INTHINT 0 to 65535. Smaller numbers than the range of INT4 always
INTHINT give 0 and larger numbers always give 65535.

By specifying OTHERS as the last item after EXCEPTIONS , you can assign all exceptions not listed explicitly in exc1 exc2... a common return code, by assigning a number n_others. You can assign the same return code to different exceptions (including OTHERS). The behavior when an exception is raised is as follows: If the statement RAISE or MESSAGE RAISING is used to raise an exception exc1 exc2 ... (to which a return code is assigned) the procedure is ended immediately, any output parameters or return values passed by value are canceled, and the number n1 n2 ... assigned to the exception is available to be evaluated in sy-subrc . If the call of an exception raised by RAISE does not assign a return value, the program terminates with a runtime error. If the call of an exception raised by MESSAGE RAISING does not assign a return value, the message is sent and the system continues in accordance with the message type.

If no exception is raised, a call sets sy-subrc to 0. If class-based exceptions are declared in the parameter interface, the addition EXCEPTIONS cannot be specified in the call.

Return to menu