Function sapnwrfc::binding::RfcListenAndDispatch
[−]
[src]
pub unsafe extern "C" fn RfcListenAndDispatch(
rfcHandle: RFC_CONNECTION_HANDLE,
timeout: c_int,
errorInfo: *mut RFC_ERROR_INFO
) -> RFC_RC
Listens on a server connection handle and waits for incoming RFC calls from the R/3 system.
The mechanism for dispatching incoming function calls works as follows: First %RfcListenAndDispatch() checks, whether for the current combination of R/3 SystemID and function module name a callback function has been installed via RfcInstallServerFunction(). If not, it checks, whether a callback function for SystemID=NULL has been installed via RfcInstallServerFunction().If not, it checks, whether a global callback function has been installed via RfcInstallGenericServerFunction().
If a callback function has been found, the RFC call will be dispatched to that function for processing, and %RfcListenAndDispatch() returns the return code of the callback function. Otherwise %RfcListenAndDispatch() returns a SYSTEM_FAILURE to the R/3 backend and the return code RFC_NOT_FOUND to the caller.
In general the return codes of %RfcListenAndDispatch() have the following meaning: - RFC_OK\n A function call was processed successfully. - RFC_RETRY\n No function call came in within the specified timeout period. ("timeout" is given in seconds.) - RFC_ABAP_EXCEPTION\n A function call was processed and ended with a defined ABAP Exception, which has been returned to the backend.
In the above three cases "rfcHandle" is still open and can be used to listen for the next request.
- RFC_ABAP_MESSAGE\n A function call was started to be processed, but was aborted with an ABAP A-, E- or X-Message. The message parameters have been returned to the backend (and can be evaluated there via the sy-msgid, sy-msgtype, sy-msgno, sy-msgv1, ..., sy-msgv4 parameters).
- RFC_EXTERNAL_FAILURE\n A function call was started to be processed, but was aborted with a "SYSTEM_FAILURE", which has been returned to the backend.
- RFC_COMMUNICATION_FAILURE\n The connection broke down while processing the function call. No response has been sent to the backend.
- RFC_CLOSED\n The connection has been closed by the backend side (SMGW, SM04). No response has been sent to the backend.
- RFC_NOT_FOUND\n No handler has been found for the current function module name. A SYSTEM_FAILURE has been returned to the R/3 backend.
In these five cases the connection has been closed, so the "rfcHandle" needs to be refreshed via RfcRegisterServer.
- RFC_INVALID_HANDLE\n "rfcHandle" is invalid or points to a connection that has already been closed.
\in rfcHandle Server connection on which to listen for incoming requests. \in timeout Number of seconds to wait for an incoming request. \out *errorInfo Additional error information. \return RFC_RC