Register Login

RFC tracing for ABAP-to-external communication

Updated May 18, 2018

You presume that there is an error in the RFC communication between an ABAP system (client) and an external program (server), and RFC traces are required for the analysis.

An ABAP program uses RFC to call a function module of an external program. The external program is the RFC server, and the ABAP system is the RFC client.

If the external RFC program is the SAP transport control program (tp), activate the trace for tp in accordance with  777565.

Related: Create and Maintain RFC Destinations

Required steps for trace generation:

    1. Delete old trace files from the external program and the ABAP system.

    2. Activate the RFC trace.

    3. Reproduce the error scenario.

    4. Deactivate the RFC trace.

    5. Save the trace files in the external program and in the ABAP system.

Carry out the individual steps.

    1. Delete old trace files from the external program and the ABAP program.

              To delete the trace files from the ABAP system, log on to the relevant ABAP system and call transaction SM59. In the menu, choose: RFC --> Delete Trace

              Go to the working directory of the external RFC program and delete all of the old trace files. The working directory is the directory from which the program was started; it may differ from the installation directory. If the environment variable RFC_TRACE_DIR is set, go to this directory and delete the old trace files there.

    2. Activate the RFC trace.

              Call transaction SM59 in the ABAP system. Select the used RFC destination. Activate the trace flag on the "Special Options" tab page. You may also have to maintain RFC bit options or activate further trace flags of other components. In this case, follow the instructions given by the support staff and the relevant notes.

              An external server program can send RFCs (call back) to the ABAP system within a method that represents a function module. In this case, the external program takes on the client role instead of the server role. To analyze this communication in the trace, the RFC trace must be activated in the external program in accordance with Note 877979, step 2.

    3. Reproduce the error scenario.

              Reproduce the error situation. To help analyze the traces, document the reproduction steps and write down the time when the error occurred and any error messages that were issued, for example.

    4. Deactivate the RFC trace.

              Call transaction SM59 in the ABAP system. Select the used RFC destination. Deactivate the trace flag on the "Special Options" tab page. Reset the RFC bit options if necessary.

              If the trace was activated in the external program in accordance with Note 877979, deactivate the trace in the external program in accordance with step 4 of this note.

    5. Save the trace files in the external program and in the ABAP system.

              Call transaction SM59 in the ABAP system. In the menu, choose:

              RFC --> Display Trace

              Then in the menu, choose:

              System --> List --> Save --> Local File

              In the new dialog box, select "unconverted". A suitable file name would be "SM59_<SID>.trc", where <SID> is the system ID (this may be extended to include the host name). The file is now stored on your front-end PC.

              Then go to the working directory of the external RFC program or to the trace directory if you are using the environment variable RFC_TRACE_DIR. This directory contains a file named dev_rfc.trc and other files named rfcxxxxx_yyyyy.trc (xxxxx stands for the process ID, and yyyyy stands for the thread ID of the operating system).

              Pack the files into an archive file. You can attach the archive to the message (this is the best option for archives up to 4 MB, see also Note 541726). If the archive is larger than this size, ask the support to provide you with a sapmats container.


×