Get Example source ABAP code based on a different SAP table
INTERNAL
ABAP Server Program Does Not Run An RFC server program is a program that uses the SAP RFC interface and is started from an AS ABAP> using CALL FUNCTION ...>.
Cause and Conditions There are various possible causes, depending on the program:
Wrong or incomplete entries in SM59> (parameters of the RFC destination>)
Network problems
Missing authorizations
Error in the RFC server program
Solution The following checklist helps to identify problems with RFC server programs:
Settings in SM59>:
The destination must be entered in transaction SM59> with type T.
If possible, specify a full path for the program you want to start.
Did you save the destination?
Configuration at operating system level: The following points depend on the host name in the destination:
You have entered a name for the host name (radio button 'explicit' in ABAP_RELEASE 3.0), or you have stored a non-standard gateway in the gateway options: In this case, the program is started by the standard gateway or the explicitly specified gateway (gwrd) using 'Remote shell'. Ensure that the specified host can be reached from the host of the gateway process. Enter the following on the gateway host: /etc/ping < host name> or ping < host name> For a program to be started on another host using 'Remote shell' the user ID of the gateway process must be known in the target system, and the HOME directory> of the user in the target system must have a file <(>.rhosts<)>. This file should contain the name of the calling host. You can test this by logging onto the host containing the gateway process under the name user ID used by the process and entering the following command: remsh < host name> < program name>. The < host name> and < program name> must be the same as in SM59>. If you call an RFC server program without parameters, the call of RfcAccept always returns an error code ( RFC_HANDLE_NULL>) and the program terminates immediately.
There is no entry in 'Host Name' (or, in ABAP_RELEASE 3.0, you selected 'Server') : In this case, the program is started from the ABAP_ASINSTANCE >. Make sure that it can be reached from this server. Ensure that the ABAP_ASINSTANCE has the authorization to start the program. Check this by logging on under the user ID of the ABAP_ASINSTANCE (usually c11adm). Go to the 'work' directory of the ABAP_ASINSTANCE (/usr/sap/.../D.../work) and try to start the RFC server program manually. As above: If an RFC server program is called without parameters, the RfcAccept call always produces an error code (RFC_HANDLE_NULL)> and the program Example would have to terminate immediately).
The radio button 'User' can be selected in 3.0. In this case, the program is started by 'SAPgui', that is, under the user ID and environment of the user. * Ensure that the program can be reached from 'sapgui'/'saptemu'. * Ensure that 'sapgui has the authorization to start the program. * Try to start the RFC server program from your own user environment.
Problems in the RFC server program itself
You can catch the 'stderr' output of the server program by entering a master program instead of the server program as the destination. The frame program> starts the actual server program using the same command line, and routes the standard output of the server program to a file.
Example: RFC server program /xxx/xxxx The C shell script is called however (do not forget to specify the shell in the first line) : #!/bin/csh date >> /tmp/rfclog /xxx/xxxx $* >> /tmp/rfclog echo $status >> /tmp/rfclog
You can the use log file /tmp/rfclog to further analyze the error.
You can also activate the trace switch in the RFC destination> (do not forget to save). Then, the RFC server program writes a file 'dev_rfc' to its current directory, containing all of the data, operations, and errors that occurred.
Debugging an RFC server program: You can analyze an RFC server program with a C debugger such as dbx, xdb or codeview. To do this, proceed as follows:
In transaction SM59> enter a program for the destination that writes the command line passed to a defined file:
Example (C shell)
#!/bin/csh echo $* > /tmp/rfc
Call the C debugger with your RFC server program, xdb < program name> for example, and set a break point after the RfcAccept call.
Start the calling ABAP program. This results in the master program above writing its command line to the output file (/tmp/rfc in our example).
Read this file and start the RFC server program loaded into the debugger with the same command line.