Addition

... RAISING cx1 ... cxn

Effect

The addition you can use for the definition of METHODS, FORM and FUNCTION informs the calling program which class-based exceptions can occur.

After RAISING, you therefore list the exception classes whose exceptions may occur and which cannot be caught locally within the procedure. You may only specify classes of the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK. It is possible to specify superclasses to declare groups of exceptions in a simple manner. Since the order of the exceptions is important to the CATCH clause, you must specify the exception classes according to their inheritance hierarchy even if you declare them in ascending order.

If the interface is violated at runtime for exceptions of the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK - that is, an exception of this type leaves a procedure and the exception was not defined in the RAISING clause - the system triggers an exception of the class CX_SY_NO_HANDLER and stores a reference to the original exception in the attribute PREVIOUS. (Any handler for such an exception then does not catch the original exception but instead a programming error in the procedure called.)

The addition may only be used for the definition of METHODS and FUNCTIONS if the addition EXCEPTIONS (for exceptions that are not class-based) is not used simultaneously. Also, using the RAISING addition within the procedure defined that way means the following restrictions:

Additional help

Class-Based Exceptions