ABAP Addition 1 ... BEFORE UNWIND> 2 ... INTO oref>
What does it do? Introduces a CATCH> block of a TRY>> control structure in which exceptions can be handled. A CATCH> block is an exception handler, meaning the program logic that is executed whenever the associated exception is raised 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 these exception classes. In each CATCH> statement of a TRY> control structure, a list of any number of exception classes cx_class1 cx_class2 ...> can be specified, with more specific exception classes (subclasses) having to be specified before more general exception classes (superclasses). This order must be followed both within a CATCH> statement and across multiple CATCH> statements of a TRY> control structure. Before the CATCH> block is executed, the system by default deletes the context in which the exception was raised. To get the context during execution of the CATCH> block, the BEFORE UNWIND> addition can be used.
Latest notes: The rule that special exception classes must be specified before general exception classes in CATCH> ensures that an exception is not handled by a general exception handler for a superclass if a special handler for a subclass is provided. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX5 Catch of two possible exceptions with CATCH>. If the input cannot be interpreted as number, the exception CX_SY_CONVERSION_NO_NUMBER > is caught by its superclass CX_SY_CONVERSION_ERROR>. If the number 0 is entered, the exception CX_SY_CONVERSION_ERROR> is caught by its superclass CX_SY_ARITHMETIC_ERROR>. ABEXA 00091 ABAP_EXAMPLE_END
ABAP_EXAMPLE_ABEXA Exceptions, CATCH>> ABAP_EXAMPLE_END • BEFORE UNWIND CATCH
ABAP Addition
What does it do? If the addition BEFORE UNWIND> is specified, the context in which the exception was raised is not deleted until the CATCH> block is executed. Instead, the context, including all called procedures and their local data, is preserved during the execution of the CATCH > block.
If no RESUME>> statement is executed in the CATCH> block, the context is deleted when the CATCH> block is exited.
If a RESUME>> statement is executed in the CATCH> block, processing resumes after the place that raised the exception. Any CLEANUP>> blocks are always executed directly before their context is deleted. This means that when BEFORE UNWIND> is used, after exception handling, and in all other cases before the exception handling. In a CATCH> block with BEFORE UNWIND>, no statements can be executed in which the context is deleted without executing any CLEANUP> blocks.
The statements CALL TRANSACTION>>, CALL DIALOG>>, SUBMIT>>, STOP>>, REJECT>>, CHECK SELECT-OPTIONS >>, and the obsolete variant of LEAVE>> are forbidden by the syntax, as they might leave the ABAP_ISESS >.