Show TOC

Removing a TRY CATCH StatementLocate this document in the navigation structure

You can remove an entire TRY CATCH statement if you no longer want to handle the exceptions.

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 cx_no_fuel and cx_failure exceptions are handled.

The TRY CATCH statement should now be removed because the exceptions are no longer to be handled.

In the drive method, the TRY CATCH statement – including the CATCH blocks – is removed. Only the content of the former TRY block remains.

Procedure

  1. In the implementation part, select the TRY statement of the TRY CATCH statement you want to remove.
  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 Remove Try Catch.