Using Pre-Defined Exceptions for RFC

The RFC interface defines two additional exception types:

·        SYSTEM_FAILURE

This exception reports all failures and system problems on the remote machine.

·        COMMUNICATION_FAILURE

This exception is raised when a connection or communications failure occurs. It does not report system problems (for example, abnormal termination) that occur on the remote machine.

Requesting Error Messages

In the function modules that you call, you should use exceptions for any error reporting, and not the MESSAGE keyword.

CALL FUNCTION Remotefunction

   DESTINATION Dest

   EXPORTING...

   IMPORTING...

   TABLES...

   EXCEPTIONS

     SYSTEM_FAILURE = 1 MESSAGE msg

     COMMUNICATION_FAILURE = 2 MESSAGE msg

The system sets the message variable (msg) to the system message. You can then display the message or log it in a file. You should not try to interpret message text in your program.

You can use MESSAGE only with the two system exceptions described here.

Using Transactional RFCs