Anfang des Inhaltsbereichs

Programming Example of Working Without Local sideinfo File  Dokument im Navigationsbaum lokalisieren

RFC_OPTIONS rfc_opt; /* Parameter for RFC connection */
RFC_CONNOPT_CPIC rfc_connopt_cpic;
/* Specific param. for RFC to R/2 */

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

 

rfc_connopt_cpic.gateway_host = "iw1009"
/* host name of the SAP gateway */
rfc_connopt_cpic.gateway_service = "sapgw00"
/* service no. of the SAP gateway */

rfc_opt.mode = RFC_MODE_CPIC; /* RFC to SAP R/2 */

rfc_opt.destination = "K50" /* Entry with this destination */
/* be in the sideinfofile for */
/* the SAP gateway */

rfc_opt.connopt = rfc_connopt_cpic;
/* includes connect parameters */

rfc_opt.client = "000"; /* Client in SAP R/2 */
rfc_opt.user = "RFCTEST"; /* CPIC user */
rfc_opt.password = "SECRET"; /* Password */
rfc_opt.language = "E"; /* Language */
rfc_opt.trace = 0; /* No RFC trace */

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

...

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’.