May 2019
Beginner to intermediate
548 pages
12h 39m
English
Raising class-based exceptions is only a little bit more complicated than classic exceptions. In this case, the RAISE EXCEPTION statement should be used, with appropriate additions and options when needed.
The appropriate syntax for raising this kind of exception depends on whether the exception object variable was declared prior to raising. In the first scenario, the following syntax is valid:
CLASS lcx_exception DEFINITION INHERITING FROM cx_static_check.ENDCLASS....DATA lx_exception TYPE REF TO lcx_exception....CREATE OBJECT lx_exception.RAISE EXCEPTION lx_exception.
If the object was not declared, the RAISE statement should have the TYPE keyword and should refer to the type instead of the variable, as in the following code snippet: ...
Read now
Unlock full access