Show TOC Start of Content Area

Procedure documentation Configuring Exception Handling  Locate the document in its SAP Library structure

Use

Exceptions are designed to handle unexpected situations that arise during runtime and disrupt the normal flow of the process. Exceptions deal with the unexpected situation by executing an additional action, block or process, called an exception handler.

Some callable objects can define exceptions that are propagated to the block level and need to be processed. For that purpose, you can define an exception handler as well as an exception handling strategy at block level.

 Note

Callable object design requires specialist knowledge of the services and applications that are exposed. Typically, it is a task for users with a technical background. It is therefore covered in the section Exposing Applications as Callable Objects.

Procedure

...

       1.      In the gallery, select the block and choose Open…

The block’s design time opens.

       2.         To switch to edit mode, choose This graphic is explained in the accompanying text (Edit).

       3.      Open the Exceptions tab page.

All exceptions defined by the callable objects are displayed.

Note

Not all callable objects can define exceptions. In most cases the Exception tab page is empty.

       4.         Select an exception in the table and choose Add.

Browse to select an exception handler.

The exception handler is an additional action, block or process, which is executed if an exception occurs. In this way the process flow does not stop irrevocably with an error message, but gives the user the opportunity to deal with the problem, for example, by re-entering the correct data.

To confirm your selection, use Choose.

       5.         To define what happens after the exception handler is called, select Strategy.

You can choose one of the following entries from the dropdown list box:

¡        Continue

The next step after finalizing the exception handler action will be the step after the action that reported the exception.

¡        Repeat

The next step after finalizing the exception handler action will be the action that reported the exception.

       6.         You can map the parameters of the current block to those of the exception handler, or set default values for them.

¡        To map the output parameters from the block to the correct input parameters for the exception handler, choose Map Input Parameters.

¡        To map the output parameters from the exception handler to the correct input parameters for the block, choose Map Output Parameters.

Select a parameter in the left-hand table and the parameter that you want to map in the right-hand table. Repeat this step for all parameters that you want to map and choose Done.

       7.      Whenever a newer version of the exception handler is available, its status on the Exceptions tab page changes to This graphic is explained in the accompanying text (Deprecated). To update the object, select it from the list and choose Update. The status changes to This graphic is explained in the accompanying text (Active).

Caution

Parameter mapping is preserved unless the parameters of the new object are different. In this case, you need to define mappings again.

       8.         To complete the procedure, choose This graphic is explained in the accompanying text (Save).

Result

You have configured the exception handling mechanism in the block design.

Now you can create and initiate the corresponding process.

At runtime, if the system returns an error message, the exception handling mechanisms will activate the exception handler, which will continue the process flow according to the defined strategy.

End of Content Area