SAP NetWeaver AS ABAP Release 751, ©Copyright 2017 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Program Flow Logic → Exception Handling → Class-Based Exceptions → TRY →
RESUME
Syntax
RESUME.
Effect
This statement exits the CATCH handling of a resumable exception and resumes processing after the statement that raised the exception. This statement can only be executed in a CATCH block of a TRY control structure for which the addition BEFORE UNWIND is declared. When exception handling is exited using RESUME, the context of the exception is not deleted and any CLEANUP blocks are not executed.
The following are prerequisites for resuming processing:
If these points do not apply, an exception of the class CX_SY_ILLEGAL_HANDLER is raised. To check whether
the prerequisites are met, the instance attribute IS_RESUMABLE with type abap_bool
of the current exception object can be checked. The value of the attribute is set using the addition
INTO when the statements CATCH and CLEANUP
are executed and when an exception object is reused using the statement RAISE.
Notes
Example
Using the statement RESUME during handling of a resumable exception cx_demo.
CLASS cx_demo DEFINITION INHERITING FROM cx_static_check.
ENDCLASS.
CLASS cls DEFINITION.
PUBLIC SECTION.
CLASS-METHODS meth RAISING RESUMABLE(cx_demo).
ENDCLASS.
CLASS cls IMPLEMENTATION.
METHOD meth.
...
RAISE RESUMABLE EXCEPTION TYPE cx_demo.
cl_demo_output=>display( 'Resumed ...' ).
...
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
TRY.
cls=>meth( ).
CATCH BEFORE UNWIND cx_demo.
RESUME.
ENDTRY.
Handleable Exceptions
CX_SY_ILLEGAL_HANDLER