Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  Remote Function Call →  RFC Overview 

RFC Exceptions

In the interface of a remote enabled function module you can currently only specify classical exception, in other words non-class-based exceptions. Class-based exceptions are supported in other release tracks.

In an external function call, the non-class-based exceptions defined in the interface of the function module called using the EXCEPTIONS addition of the statements CALL FUNCTION or RECEIVE can be assigned return values.

If EXCEPTIONS is specified, classical exception handling applies. If a remotely called function module raises a class-based exception, this exception is not transported and raises the predefined classical exception SYSTEM_FAILURE instead

In addition to the exceptions which are specified explicitly in the interface of a remote-enabled function module, the following predefined exceptions can occur in the RFC:

  • SYSTEM_FAILURE.
    This exception can be caused by error situations that arise when a remotely called function is executed on the RFC server. These error situations can be caused by runtime errors or sending a message of type "A", "E", or "X".
  • COMMUNICATION_FAILURE, RESOURCE_FAILURE (only with pRFC or SYSTEM_FAILURE)
    These exceptions are raised by all errors that occur when connections are being established, when resources are being assigned, or in the communication layer.

We strongly recommend that all predefined exceptions are handled.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • If a remotely called function module raises a class-based exception, this always raises the predefined exception SYSTEM_FAILURE of the RFC interface. Since no class-based exceptions can be specified in the interface of a remote-enabled function module, this only affects exceptions of the categories CX_NO_CHECK, especially CX_SY_NO_HANDLER.

  • The recommendation to handle all predefined exceptions is particularly important in avoiding incompatibilities after the upcoming conversion to class-based exceptions in a future release.

More Information

For more information about exceptions during RFC calls, refer to the SAP Library under:

  • RFC Exceptions


Example

More information: Exception Handling in RFC.