Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Error transfer

&pagelevel(4)&pagelevel

“Error transfer” refers to the fact that information on errors that occur is transferred from a subordinate procedure to the superordinate, calling, procedure.

In foreground procedures, error information can be transferred from the subordinate, called procedure to the superordinate, calling procedure by means of various mechanisms.

  • the EXIT-PROCEDURE command

  • the transfer of error information using variables.

Transfer using EXIT-PROCEDURE:

  1. In the command call, error information is specified for the error classes Subcode1, Subcode2 and Maincode (e.g. by variable replacement: the variables contain the command return code or user-defined error information for case differentiation).

  2. In the calling procedure, these components are then evaluated by the built-in functions SUBCODE1( ), SUBCODE2( ) and MAINCODE( ).

The ERROR operand in the EXIT-PROCEDURE command can serve to return information to the caller on errors that occurred during the procedure run and were intercepted by the internal error handling. If the procedure is canceled as errored, the error information is automatically transferred, since the error situation is not terminated.

Transfer using variables:

  1. The variable must be visible: In CALL procedures, the variable must be imported as task-global; in INCLUDE procedures, variables of the calling procedure can be accessed directly.

  2. If an error occurs, an appropriate value is assigned to the variable.

  3. An IF block decides whether procedure execution should be resumed or terminated immediately.

  4. After the subordinate procedure has been terminated, the variable in the superordinate, calling procedure is evaluated.