Show TOC

Extending a TRY CATCH StatementLocate this document in the navigation structure

You can add a new CATCH block to an existing TRY CATCH statement. This enables you to handle another exception in an existing TRY CATCH statement.

Prerequisites

This functionality is provided since SAP NetWeaver 7.5 SP00.

Context

Example

Before Execution After Execution

To copy the source code example, click here Code Example Before Execution

In the implementation of the drive method, the check_engine method is called. This method can raise exceptions of the type cx_failure.

The exception now needs be handeld in a new CATCH block.

In the drive method, the new CATCH block is added where the cx_failure exception can now be handled.

Procedure

  1. In the implementation part, select the method that can raise an exception that needs to be handeld in a new CATCH block.
  2. Get the quick assist proposals by choosing Quick Fix from the context menu (shortcut Ctrl 1) or by using the Quick Assist view.
  3. Apply Extend Try Catch.