Non-Class-Based Exceptions

Definition

Non-class-based exceptions can be defined in the interfaces of function modules and methods. These exceptions are defined as follows:

Note

Before release 6.10, all exceptions defined in the interface of methods of global classes or function modules were non-class-based.

Exception handling

Handling of non-class-based EXCEPTIONS is made possible by the addition of the statements CALL METHOD and CALL FUNCTION. Numeric values are assigned to the exceptions, which are used to fill the system field sy-subrc when the exception occurs. The actual error handling takes place after the call, when the system evaluates sy-subrc.

Note

The exceptions defined in the interface of methods and function modules do not represent real exceptions, since they do not cause a change in the control flow. Instead, processing of the procedure is terminated prematurely, and the return value sy-subrc is set.