

This is useful, for example, when handling resource bottlenecks if releasing resources inĬLEANUP blocks would change the context and thus make the calculation of the free resources in Is to be evaluated before any cleanup activities in CLEANUPīlocks.

However, it is allowed in principle during exception handling if the context of the exception Is only required when the statement RESUME Use of the addition BEFORE UNWIND for CATCH.In this case, the context of the exception is deleted before the handling process and the statement RESUME cannot be specified. Resumable exceptions can also be handled in CATCH blocks without theĪddition BEFORE UNWIND.This is the only case where the context of the exception is not deleted when the CATCH block is exited. The statement RESUME can be used only when handling aĪnd only in a CATCH block for which the addition BEFORE.If addition BEFORE UNWIND is not specified, the context is deleted before the CATCH block is executed.Of abap_true and is otherwise set to the value of ABAP_FALSE. The first resumable raised exception, IS_RESUMABLE is set to the value Sets the attribute IS_RESUMABLE of the exception object and the precedingĮxception objects of a chaining with the attribute PREVIOUS. When combined with INTO, the addition BEFORE UNWIND Statement has been executed, which can be the case with message types I and S, for example, the exception CX_SY_ILLEGAL_HANDLER is raised. However, if the system returns to the CATCH block after the MESSAGE The context is deleted during the execution of the CLEANUP blocks. Statement for sending messages, the ABAP runtime framework behaves as if exception handling is to beĮxited. If a statement is executed here that is allowed directly in the CATCH block.įor example, LEAVE TO TRANSACTION can be executedĭirectly in the CATCH block, but not in a procedure that is called there, because otherwise the context would be deleted without executing the CLEANUP blocks. Runtime error EXCP_HANDLER_FAILED_TO_UNWIND occurs. However, if the context is deleted during such a procedure call, a Is properly terminated while executing the CLEANUP blocks before the statement is executed. Which are statically known to leave the internal session, are allowed. Statements such as LEAVE TO TRANSACTION,.In aĬATCH block with BEFORE UNWIND, no statements can be executed in which the context is deleted without executing any CLEANUP blocks.ĬHECK SELECT-OPTIONS, and the obsolete variant of LEAVE are forbidden by the syntax, as they might leave the Is used, after exception handling, and in all other cases before the exception handling. If a RESUME statement is executed in the CATCH block, processing resumes after the place that raised the exception.Įxecuted directly before their context is deleted.In the CATCH block, the context is deleted when the CATCH block is exited. Instead, theĬontext, including all called procedures and their local data, is preserved during the execution of the CATCH block. Was raised is not deleted until the CATCH block is executed. If the addition BEFORE UNWIND is specified, the context in which the exception If the number 0 is entered, the exceptionĬX_SY_CONVERSION_ERROR is caught by its superclass CX_SY_ARITHMETIC_ERROR.Ĭl_demo_input=>request( CHANGING field = input ).Ĭl_demo_output=>display( || ).ĬATCH cx_sy_arithmetic_error cx_sy_conversion_error INTO FINAL(exc).Ĭl_demo_output=>display( exc->get_text( ) ). If the input cannot be interpretedĪs number, the exception CX_SY_CONVERSION_NO_NUMBER is caught by its superclassĬX_SY_CONVERSION_ERROR.

The rule that special exception classes must be specified before general exception classes inĬATCH ensures that an exception is not handled by a general exception handler for a superclass if a special handler for a subclass is provided.Ĭatch of two possible exceptions with CATCH. To get the context during execution of the CATCH block, the BEFORE UNWIND addition can be used. Must be followed both within a CATCH statement and across multiple CATCH statements of a TRY control structure.īefore the CATCH block is executed, the system by default deletes the context (subclasses) having to be specified before more general exception classes (superclasses). can be specified, with more specific exception classes Statement of a TRY control structure, a list of any number of exception classesĬx_class1 cx_class2. that are specified after the statement CATCH, as wellĪs the exceptions of the subclasses of these exception classes. Introduces a CATCH block of a TRY control structure in which exceptions can be handled.Ī CATCH block is an exception handler, meaning the program logic that isĮxecuted whenever the associated exception is raised in the TRY block of the same TRY control structure.Ī CATCH block handles the exceptions of the exception classes cx_class1Ĭx_class2.
