SAP CATCH EXCEPTION ABEXA



Get Example source ABAP code based on a different SAP table
  



Exceptions, CATCH
This example demonstrates how class-based exceptions are caught.

ABAP_SOURCE_CODE
DEMO CL_DEMO_CATCH_EXCEPTION

ABAP_DESCRIPTION
The method meth1 raises a non-resumable exception and the method meth2 raises a resumable exception that is handled in the TRY control structures of the method main using CATCH.
If handled without BEFORE UNWIND, the CLEANUP block is executed in both cases before handling and the context of the called method does not exist during handling.
If handled with BEFORE UNWIND, the context of the called method exists in both cases during handling and the CLEANUP block is executed after handling.
If a resumable exception is raised, the statement RESUME can be executed during handling, which ensures that processing in the called method is continued without its CLEANUP block being executed.