Show TOC

Background documentationProgramming Example of Working Without Local sideinfo File Locate this document in the navigation structure

 

Syntax Syntax

  1. RFC_OPTIONS	rfc_opt;	/*	Parameter for RFC connection	*/
  2. RFC_CONNOPT_CPIC	rfc_connopt_cpic;
    		/*	Specific param. for RFC to R/2	*/
  3. RfcEnvironment(...);	/*	Install error handling function	*/
  4. rfc_connopt_cpic.gateway_host = “iw1009”
  5. 		/*	host name of the SAP gateway	*/
  6. rfc_connopt_cpic.gateway_service = “sapgw00”
  7. 		/*	service no. of the SAP gateway	*/
  8. rfc_opt.mode = RFC_MODE_CPIC;	/*	RFC to SAP R/2	*/
  9. rfc_opt.destination = “K50”	/*	Entry with this destination	*/
  10. 		/*	be in  the sideinfofile for	*/
  11. 		/*	the SAP gateway	*/
  12. rfc_opt.connopt = rfc_connopt_cpic;
    		/*	includes connect parameters	*/
  13. rfc_opt.client = “000”;	/*	Client in SAP R/2	*/
  14. rfc_opt.user = “RFCTEST”;	/*	CPIC user	*/
  15. rfc_opt.password = “SECRET”;	/*	Password	*/
  16. rfc_opt.language = “E”;	/*	Language	*/
  17. rfc_opt.trace = 0;	/*	No RFC trace	*/
  18. rfc_handle = RfcOpen();	/*	Open RFC connection	*/
  19. ...
End of the code.

You can also issue RfcConnArgv or RfcConnArgv3 before RfcOpen to pass on the information about the SAP gateway to the RFC library. The RfcOpenExt and RfcOpenExtV3 are for non-C programs, such as Visual Basic programs. For more details, see the delivered 'sapinfo.c' and 'srfctest.c'.