Function sapnwrfc::binding::RfcOpenConnection
[−]
[src]
pub unsafe extern "C" fn RfcOpenConnection(
connectionParams: *const RFC_CONNECTION_PARAMETER,
paramCount: c_uint,
errorInfo: *mut RFC_ERROR_INFO
) -> RFC_CONNECTION_HANDLE
Opens an RFC client connection for invoking ABAP function modules in an R/3 backend.
Opens a client connection to an SAP System. The connectionParams may contain the following name-value pairs: - client, user, passwd, lang, trace
and additionally one of
-# Direct application server logon: ashost, sysnr.
-# Logon with load balancing: mshost, msserv, sysid, group.\n
msserv is needed only, if the service of the message server is
not defined as sapms
When logging on with SNC, user&passwd are to be replaced by - snc_qop, snc_myname, snc_partnername and optionally snc_lib.
(If snc_lib is not specified, the RFC library uses the "global" GSS library defined via environment variable SNC_LIB.)
When logging on with SSO Ticket, you can use mysapsso2 instead of user&passwd. The old SSO format (mysapsso) is no longer supported.
Alternatively the connection parameters can be defined in the config file sapnwrfc.ini. In this case you just pass the parameter dest=... and all parameters that are missing in the sapnwrfc.ini entry into %RfcOpenConnection().
For a complete list of logon parameters to be used in connectionParams as well as in the sapnwrfc.ini file, see the sample sapnwrfc.ini file in the SDK's demo folder.
If the logon was ok, %RfcOpenConnection() returns a client connection handle, which 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 connectionParams was invalid - RFC_COMMUNICATION_FAILURE Something is wrong with the network or network settings - RFC_LOGON_FAILURE Invalid user/password/ticket/certificate - RFC_ABAP_RUNTIME_FAILURE Something is wrong with the R/3 backend - RFC_MEMORY_INSUFFICIENT A malloc failed when trying to allocate a temporary buffer
\in *connectionParams An array of RFC_CONNECTION_PARAMETERs with the names as described above and the values as necessary in your landscape. \in paramCount Number of parameters in the above array. \out *errorInfo Returns more error details, if the connect attempt fails. \return A handle to an RFC client connection that can be used for invoking ABAP function modules in the backend.