Better use the call RfcOpenEx.
The following function opens an RFC connection.
RFC_HANDLE SAP_API RfcOpenExtV3(char* destination,
char * lb_host,
char * lb_system_name
char * lb_group
All parameters are passed as single fields (using RFC_MODE).
The following parameters are always needed in this call: RFC_MODE mode and SAP logon information: client, user, password, language, trace, and use_sapgui.
The following parameters are necessary, depending on RFC_MODE:
Ў destination must be defined
Ў gateway-host and gateway_service can be defined
Ў sideinfo is necessary.
Ў use_load_balancing is 0 (OFF)
§ destination is not NULL:
gateway_host, gateway_service, hostname and sysnr can be defined. sideinfo is necessary.
§ destination is NULL:
gateway_host and gateway_service can be defined. hostname and sysnr must be defined.
Ў use_load_balancing is 1 (ON)
destination, gateway_host, gateway_service, hostname and sysnr will not be evaluated.
lb_host and lb_system_name must be defined. If lb_group is NULL, the group ‘PUBLIC’ will be used.
use_sapgui and ABAP-Debug are not available with R/2.
This function is defined in SAPRFC.H.
· Returns a handle to the RFC connection (RFC_HANDLE) or
· Returns RFC_HANDLE_NULL
name of destination or NULL
connection mode (RFC_MODE)
hostname of target system or NULL
system number (0-99)
gateway hostname or NULL
gateway service or NULL
signon data: client
signon data: user
signon data: password
signon data: language
trace (OFF/ON/ABAP-DEBUG or also trace ON and ABAP-DEBUG: 0/1/2/3)
using load balancing feature (OFF/ON/0/1)
host name of the ‘message server’
name of the target system (e.g. C11)
application server group or NULL for PUBLIC
using sapgui to display SAP dynpros and graphics (OFF/ON: 0/1)