SAP Note 1371131 - Correct error handling of RFC calls

Component : RFC -

Solution : https://service.sap.com/sap/support/notes/1371131 (SAP Service marketplace login required)

Summary :
This SAP Note addresses issues related to the handling of RFC exceptions in ABAP programs. When an RFC-enabled function module is called and an error occurs, two primary issues may arise: first, the application may fail to catch RFC exceptions, leading to an ABAP runtime error (CALL_FUNCTION_REMOTE_ERROR); second, the exception is caught but the RFC error message forwarded to the caller is not specific, hindering effective error analysis. The note specifies necessary error-handling measures and provides coding examples for various RFC scenarios, including synchronous, asynchronous, and queued RFCs, to correctly manage SYSTEM_FAILURE, COMMUNICATION_FAILURE, and RESOURCE_FAILURE, thus ensuring robust error handling and enhancing system stability.

Key words :
message id msgid type msgty              number msgno, exceptions              system_failure        = 1  message lv_rfcmsg              communication_failure = 2  message lv_rfcmsg               resource_failure      = 3, exceptions              system_failure        = 1  message lv_rfcmsg              communication_failure = 2  message lv_rfcmsg, task task            [destination {dest}]            [performing subr, call function func            destination dest            exporting, background task            [destination dest]            exporting, abap runtime error call_function_remote_error occurs, task task            [destination dest], group group            [performing subr, call function func starting

Related Notes :

1568399SOB: Error handling when navigating to CMS by RFC (1)
1467496Dump "CALL_FUNCTION_REMOTE_ERROR" during object selection
597583Performance improvement using RFC parallel processing
97522RFC short dump CALL_FUNCTION_REMOTE_ERROR