Better use the call RfcOpenEx.
The following function opens an RFC connection. All parameters are passed as single fields:
RFC_HANDLE SAP_API RfcOpenExt(char* destination,
RFC opens the connection using the given options, and returns a handle for the connection established.
The input parameters to this function carry the same information as that sent to RfcOpen, but not packed in structures. Instead, individual fields are sent. At any given time, some of these fields are empty, depending on the value of mode:
The fields hostname, sysnr, gateway_host, and gateway_service have valid information in them.
Only the fields gateway_host, and gateway_service have valid information in them.
This function is defined in SAPRFC.H.
· Returns a handle to the RFC connection (RFC_HANDLE) or
· Returns RFC_HANDLE_NULL
name of destination
connection mode (RFC_MODE)
hostname of target system
system number (0-99)
gateway hostname or NULL
gateway service or NULL
signon data: client
signon data: user
signon data: password
signon data: language
If the field trace contains a non-zero value, the outgoing and incoming RFC data are written to a trace file dev_rfc in the current directory. A trace file is also written on the target system. On SAP systems, you can view this file using the utility program RSRFCTRC.
See also RfcOpen, RfcOpenExtV3 and RFC_OPTIONS for further description of these fields. In general, the input parameters allow the system to avoid accessing the sideinfo table. If you send the relevant parameters as null fields (hostname for SAP system, the gateway fields for R/2), the sideinfo table will be accessed to get the needed information.