RFC tracing for external-to-ABAP communication

[] [] [] [] [] []

Related:

  1. SAPconnect RFC interface: Tracing document contentsSymptom You send documents using the SAPconnect RFC interface. Errors...
  2. RFC tracing for ABAP-to-ABAP communicationSymptom You think that an error has occurred in the...
  3. RCMGT: Release strategy for the ABAP Add-OnSymptom Planning the installation and upgrade of ABAP Add-On RCMGT...
  4. Known problems with Support Packages in SAP NW 7.1 AS ABAPSymptom This note provides information about problems that can occur...
  5. Release strategy for ABAP Add-On FSAPPLSymptom This note concerns the planning of the installation and...
  6. Web Dynpro ABAP ALV print version: Additional informationSymptom You want to create a print version of a...
  7. Corrections for Web Dynpro ABAP ALV 701 Support Package 06Symptom This note contains information about Support Package 06 for...

Symptom
You presume that there is an error in the RFC communication between an external program (client) and an ABAP system (server), and RFC traces are required for the analysis.
Other terms
Error, analysis, RFC, SDK
Reason and Prerequisites
An external program uses RFC to call a function module of an ABAP system. The external program is the RFC client, and the ABAP system is the RFC server.
Check whether the current RFC library is installed in the external program (see Note 413708). In addition to the corrections for all known errors, the current RFC library also contains all of the improvements for RFC tracing.
Solution
Required steps for trace generation:
1. Delete old trace files from the external program and the ABAP program.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.
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.
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
If you use load balancing for RFC, you must carry out this step in all ABAP systems that are configured in the group.
2. Activate the RFC trace.
There are different options for activating the RFC trace in the external program:a) Using the environment variable RFC_TRACE:
If the external program is already running, cancel it. Set the environment variable in accordance with the documentation for the used operating system or shell program to the value “1″. Then restart the external program. Make sure that the environment variable is known in the context from which the external program is started. More information about this is contained in the documentation of your operating system or shell program.b) Using the file “saprfc.ini”:
The file “saprfc.ini” contains a configuration section for the used destination. In this file, change the entry RFC_TRACE=0 to RFC_TRACE=1 or add this entry if necessary. For more information, see the documentation at the end of the file “saprfc.ini”. The configuration of the destination is imported every time you open a new RFC connection to the ABAP system. Therefore, the external program does not need to be restarted. For connections that are already open (RFC handle), the trace flag is not set.c) By starting the external program with the trace flag:
Most of the example programs of the RFC SDK support the activation of the trace using a switch when starting the program. Start the external program with the relevant switch. Example: “startrfc … -t”d) Using the RFC API:
This is only possible if the programmer of the external application has implemented the option to activate the RFC trace in the program. For more information, read the documentation of the external program or contact the supplier of the external program. You are not required to restart the external program.
You may have to set further environment variables in addition. The CPIC trace is activated in accordance with Note 47682 by using the environment variable CPIC_TRACE=1, for example. If necessary, follow the instructions given by the support staff.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.
If you have set an environment variable for the trace, delete the environment variable and restart the application. If the trace was activated by a trace flag, restart the program without the trace flag. If the trace was activated using the file “saprfc.ini”, reset the entry for the destination to RFC_TRACE=0. If the trace was activated using the RFC API, proceed in accordance with the documentation of the application.5. Save the trace files in the external program and in the ABAP system.
If you use load balancing, you may have to carry out the following steps in all ABAP systems involved. 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). If the archive is larger than this size, ask the support to provide you with a sapmats container.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Comment