ABAPCATCH_TRY - CATCH TRY
BAL_S_LOG - Application Log: Log header data BAL Application Log DocumentationThis documentation is copyright by SAP AG.
CATCH
Syntax
CATCH [BEFORE UNWIND] cx_class1 cx_class2 ... [INTO oref].
Additions
1. ... BEFORE UNWIND
2. ... INTO oref
Effect
Introduction of a CATCH block of a TRY control structure in which exceptions can be handled.
A CATCH block is an exception handler - that is, the program logic that is executed whenever the corresponding exception occurs in the TRY block of the same TRY control structure.
A CATCH block handles the exceptions of the exception classes cx_class1 cx_class2 ...that are specified after the statement CATCH as well as the exceptions of the subclasses of theseexception classes. In each CATCH statement of a TRY control structure, you can list anynumber of exception classes cx_class1 cx_class2 ..., whereby more special exception classes (subclasses)must be listed before more general exception classes (superclasses). This sequence must be kept both within a CATCH statement and across several CATCH statements of a TRY control structure.
Note
The rule whereby CATCH special exception classes must be listed before general classes ensuresthat an exception is not handled by a general exception handler (superclass) if a special handler (subclass) is provided.
Addition 1
... BEFORE UNWIND
Effect
If the addition BEFORE UNWIND is specified, the context in which the exception was triggered,including all called procedures and their local data, is deleted only after exiting the CATCH block. If the addition is not specified, the context is deleted before execution of the CATCH block.
Notes
- If the addition BEFORE UNWIND is specified, the statement RESUME can be used in the CATCH block for handling arestartableexception - in order to start processing after the statement that triggered the exception. This is the only case in which the context of the exception is not deleted when the CATCH block is exited.
- Restartable exceptions can also be handled in CATCH blocks without the addition BEFORE UNWIND.In this case, the context of the exception is deleted before the handling process and the statement RESUME cannot be specified.
- Possible CLEANUPblocks are always executed directly before their context is deleted - that is, if BEFORE UNWIND is used after exception handling, and otherwise before it.
- Use of the addition BEFORE UNWIND for CATCH is only required when you use the statementRESUME. However,it is principally allowed during exception handling if the context of the exception is to be evaluatedbefore any cleanup activities in CLEANUPblocks. This makes sense for example when handling resource bottlenecks if releasing resources in CLEANUPblocks would change the context and thus for example make the calculation of the free resources in theexception handler meaningless. Other than for logging purposes, you are not recommended to evaluate the part of the context that is only of interest locally for implementing the incorrect procedure.
Addition 2
... INTO oref
Effect
If the addition INTO is specified, a reference to the exception object is stored in oref,whereby oref must be an object reference variable whose static type is more general than or thesame as the most general of the specified exception classes. Using oref, it is possible to access the attributes and methods of the exception object.
Vendor Master (General Section) TXBHW - Original Tax Base Amount in Local Currency
This documentation is copyright by SAP AG.
Length: 4904 Date: 20120518 Time: 203323 triton ( 250 ms )






