Programming Example of Working With saprfc.ini File

RFC_OPTIONS         rfc_opt;       /* Parameter for RFC connection    */

RfcEnvironment(...);             /* Install error handling function */

rfc_opt.mode            = RFC_MODE_PARAMETER;
                                       */ saprfc.ini file is used         */

rfc_opt.destination     = “BIN”;       /* Destination in saprfc.ini       */

rfc_opt.connopt         = NULL;        /* Connect parameters in           */
                                       /* saprfc.ini file                 */

rfc_opt.client          = “000”;       /* Client in SAP R/2               */
rfc_opt.user            = “RFCTEST”;   /* CPIC or dialog user             */
rfc_opt.password        = “SECRET”;    /* Password                        */
rfc_opt.language        = “E”;         /* Logon language                  */
rfc_opt.trace           = 0;           /* No RFC trace                    */

rfc_handle = RfcOpen(&rfc_opt);     /* Open RFC connection             */

...

Entry in saprfc.ini file

The saprfc.ini file must be in the same directory as the RFC client program, or it can be defined with its path and file name by the environment variable RFC_INI

Windows: set RFC_INI=d:\rfctest\saprfc.ini

The following example contains a reference to a specific application server:

DEST=BIN
TYPE=A
ASHOST=hs0311
sysnr=53
RFC_TRACE=0
ABAP_DEBUG=1
USE_SAPGUI=1

The following example illustrates the load balancing feature available as of Release 3.0:

DEST=BIN
TYPE=B
R3NAME=BIN
GROUP=PUBLIC
RFC_TRACE=0
ABAP_DEBUG=1
USE_SAPGUI=1

The new RFC features in Release 3.0C, such as RFC with SAPGUI or RFC with ABAP-debug, can be used via some more definitions in the saprfc.ini file not shown in the examples above. For more defails, see The SAPRFC.INI File.