Show TOC

RfcStartServer Locate this document in the navigation structure



Starts the RFC server (and initializes the RFC library implicitly).

This function needs to be called, if the server program is to be started by the SAP application server (RFC destination of type "T" in startup mode).

argc and argv are the inputs of the mainU function. The SAP application server passes the correct command line to the program, when starting it up, so you only need to forwards these two parameters to RfcStartServer.

connectionParams is optional and is only needed, if you want to add additional logon parameters to the ones coming from the command line, e.g. for activating traces.

Like RfcRegisterServer the function returns a server connection handle that can be used in RfcListenAndDispatch.

The mechanism of this kind of RFC destination thus works as follows:

  1. The SAP application server opens a telnet connection to the host, where your server program is located, and starts the program with the necessary logon parameters (or creates a child process, if the startup method is "Start on application server".)

  2. Your server program calls RfcStartServer, which opens an RFC connection back to the SAP system.

  3. The SAP system then makes the function call over that RFC connection.

The main differences startup mode compared to the registration mode are:

Advantage: no logon parameters need to be maintained in the server program (unless you want to open an additional client connection for looking up function module metadata (RFC_FUNCTION_DESC_HANDLEs) in the SAP DDIC).

Disadvantage: every single function call creates a new process and a telnet connection in addition to the actual RFC connection.


RFC_CONNECTION_HANDLE SAP_API RfcStartServer (int argc, SAP_UC **argv, RFC_CONNECTION_PARAMETER const * connectionParams, unsigned paramCount, RFC_ERROR_INFO* errorInfo);