Show TOC

Background documentationProgramming Example of Working With saprfc.ini File Locate this document in the navigation structure

 

Syntax Syntax

  1. RFC_OPTIONS	rfc_opt;	/*	Parameter for RFC connection	*/
  2. RfcEnvironment(...);	/*	Install error handling function	*/
  3. rfc_opt.mode	= RFC_MODE_PARAMETER;
    		*/	saprfc.ini file is used	*/
  4. rfc_opt.destination	= “BIN”;	/*	Destination in saprfc.ini	*/
  5. rfc_opt.connopt	= NULL;	/*	Connect parameters in	*/
  6. 		/*	saprfc.ini file	*/
  7. rfc_opt.client	= “000”;	/*	Client in SAP R/2	*/
  8. rfc_opt.user	= “RFCTEST”;	/*	CPIC or dialog user	*/
  9. rfc_opt.password	= “SECRET”;	/*	Password	*/
  10. rfc_opt.language	= “E”;	/*	Logon language	*/
  11. rfc_opt.trace	= 0;	/*	No RFC trace	*/
  12. rfc_handle = RfcOpen();	/*	Open RFC connection	*/
  13. ...
End of the code.
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

Example Example

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

End of the example.

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

Example Example

DEST=BIN

TYPE=A

ASHOST=hs0311

sysnr=53

RFC_TRACE=0

ABAP_DEBUG=1

USE_SAPGUI=1

End of the example.

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

Example Example

DEST=BIN

TYPE=B

R3NAME=BIN

GROUP=PUBLIC

RFC_TRACE=0

ABAP_DEBUG=1

USE_SAPGUI=1

End of the example.

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.