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.destination	= “K50”;	/*	Destination in saprfc.ini	*/
  4. 		/*	and in sideinfo for the SAP	*/
  5. 		/*	gateway	*/
  6. rfc_opt.connopt	= NULL;	/*	Connect parameters in	*/
  7. 		/*	saprfc.ini file	*/
  8. rfc_opt.client	= “000”;	/*	Client in SAP R/2	*/
  9. rfc_opt.user	= “RFCTEST”;	/*	CPIC user	*/
  10. rfc_opt.password	= “SECRET”;	/*	Password	*/
  11. rfc_opt.language	= “E”;	/*	Logon language	*/
  12. rfc_opt.trace	= 0;	/*	No RFC trace	*/
  13. rfc_handle = RfcOpen();	/*	Open RFC connection	*/
  14. ...
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 be defined with its path and file name by the environment variable RFC_INI.

includepicture /SAPIrExtHelp/standard.asp?name=beispiel.gif \bmc \d

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

The sideinfo entry for the above test could be as follows:

Syntax Syntax

  1. DEST=K50
  2. TYPE=2
  3. GWHOST=is0001
  4. GWSERV=sapgw00
End of the code.

For more information on the saprfc.ini file, see The SAPRFC.INI File.