Error Handling in RFC Server Programs
Causes
There are different causes for ABAP errors, depending on the program. Causes include:
Solution
Check the following:
Make sure that the entered computer can be addressed by the computer of gateway process. Enter the following command on this computer:
/etc/ping <host name>
or ping <host name>To start a program with ‘remote shell’ on another computer, it is necessary that the user-ID of the gateway process exists on the target system and that the
HOME directory of this user contains a file. rhosts in the target system. The name of the calling computer must be stored in this file. To test this, log in on the computer of the gateway process under the user-ID of this process and call the command:remsh <host name> <program name>
In this case, you have to enter the same as in transaction SM59 for
<host name> and <program name> .(If an RFC server program is called without parameters, the call
RfcAccept returns an error code ( RFC_HANDLE_NULL ) in any case and the program should terminate immediately.)In this case, the program is started from the SAP application server.
Make sure that the program can be addressed from the SAP application server.
Make sure that the SAP application server has the authorization for starting the program.
To do this, log on under the user-ID of the SAP application server (generally
c11adm ). Go into the ‘work’ directory of the application server ( /usr/sap/.../D.../work ), if possible, and start the RFC server program manually from there.(If an RFC server program is called without parameters, the call
RfcAccept returns an error code ( RFC_HANDLE_NULL ) in any case and the program should terminate immediately.)In Release 3.0, you can also select ‘User’. In this case, the program is started by ‘Sapgui’, that is, under the user-ID and the environment of the user.
Make sure that the program can be addressed by
sapgui/saptemu .Make sure that
sapgui has the authorization to start the program.To do this, call the RFC server program.
To pick up
RFC server program is /xxx/xxxx.
However, the C script is called (do not forget the specification of the shell in the first line):
#!/bin/csh
date >> /tmp/rfclog
/xxx/xxxx $* >>& /tmp/rfclog
echo $status >>& /tmp/rfclog
Display the log file
/tmp/rfclog for further error analysis.You can activate the trace flag in the destination (remember to save). A file
dev_rfc is then written by the RFC server program in its current directory containing all data received, operations and errors that occurred.Debugging an RFC server program
Using
Registering Server Programs with the SAP Gateway, you can start your RFC server program with a C debugger, such as dbx, xdb or code view, etc.If your RFC server program will be started by an SAP component (i.e. SAPGUI, SAP Gateway, Application Server), you can do as follows:
Example (C-Shell)
#!/bin/csh
echo $* > /tmp/rfc