Show TOC

Background documentationRfcOpenConnection Locate this document in the navigation structure


Opens a client connection to an SAP System. The connection parameters may contain the following name-value pairs:

client, user, password, lang, traceand additionally one of

  • Direct application server logon: ashost, sysnr.

  • Logon with load balancing: mshost, msserv, sysid, group.

msserv is only needed, if the service of the message server is not defined as sapms<SYSID> in /etc/services.

When logging on with SNC, userand password are to be replaced by snc_mode (0/1), snc_qop, snc_myname, snc_partnername, snc_lib.

When logging on with SSO Ticket, you can use mysapsso instead of

User and password or mysapsso2 instead of password.

Alternatively the connection parameters can be defined in the configuration file

sapnwrfc.ini. In this case you just pass the parameter dest=... and the

user credentials into RfcOpenConnection.

If the logon was ok, RfcOpenConnection returns a client connection handle, that can be used in RfcInvoke.

Otherwise the return value is NULL and errorInfo contains a detailed error description.

  errorInfo   code   will be one of:

  • RFC_INVALID_PARAMETER: One of the connection parameters was invalid.

  • RFC_COMMUNICATION_FAILURE: Problems in the network or network settings.

  • RFC_LOGON_FAILURE: Invalid user/password/ticket/certificate.

  • RFC_ABAP_RUNTIME_FAILURE: Problems in the SAP backend system.


RFC_CONNECTION_HANDLE SAP_API RfcOpenConnection (RFC_CONNECTION_PARAMETER const * connectionParams, unsigned paramCount, RFC_ERROR_INFO* errorInfo);