Better use the call RfcOpenEx.
The following function opens an RFC connection.
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, 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 only available with R/3 3.0C or later and not on Windows with a 16-bit-RFC-library.
use_sapgui and ABAP-Debug are not available with R/2.
This function is defined in SAPRFC.H.
See also RfcOpen and RFC_OPTIONS.