Summary:
The SAP adapter can be run in debug mode from the command line. This can offer a quick and easy way to debug SAP adapter problems without the inconvenience of running the adapter through a scheduler.
This documents how to turn on verbose logging of the adapter tools and tracing of all the calls between the adapter and SAP. I have used the sapjob utility as an example, but this technique will work with all the tools that connect to SAP.
Instructions:
Linux/Unix version:
A) Make a directory to store the output. (I made /tmp/SAP_OUT.)
/root>cd /tmp
/tmp>mkdir SAP_STUFF
B) Change directory to the SAP adapter directory..
cd $SAPDIR/bin ( a ls here should show the 'sapjob binary.)
C) Turn on tracing and verbose output.
export RFC_TRACE=1 (turns on rfc trace)
export RFC_TRACE_DIR=/tmp/SAP_OUT (Assigns rfc trace to a directory.)
export CAISAP0099=ON (turns on verbose logging for the sapjob binary.)
D) Run the job.
sapjob JOBNAME=ATEST START=C 2>&1 | tee /tmp/SAP_OUT/ATEST.out
Windows version:
A) Make a directory to store the output. (I made C:\temp\SAP_OUT.)
>cd C:\temp
C:\temp>mkdir SAP_OUT
B) Change directory to the SAP adapter directory..
cd C:\Program Files (x86)\CA\Unicenter JMA for SAP\bin ( a dir here should show the 'sapjob' binary.)
C) Turn on tracing and verbose output.
set RFC_TRACE=1 (turns on rfc trace)
set RFC_TRACE_DIR=/tmp/SAP_OUT (Assigns rfc trace to a directory.)
set CAISAP0099=ON (turns on verbose logging for the sapjob binary.)
D) Run the job.
sapjob JOBNAME=ATEST START=C > C:\temp\SAP_OUT\ATEST.out
Note:
Following the run the SAP_OUT directory,folder will have two files. ATEST.out will be the verrbose output file and a file named something like rfc0XXXX_XXXXX.trc will be the trace file between the adapter and SAP.