You can make an RFC call and receive return values using a single function:
RFC_RC SAP_API RfcCallReceive(RFC_HANDLE handle,
char * function,
RFC_PARAMETER * exporting,
RFC_PARAMETER * importing,
RFC_TABLE * tables,
char ** exception)
This function waits till it receives an answer before returning. The return values are just the same as those you would receive by calling RfcReceive. Note that RfcCallReceive can fail because you called RfcOpen with an invalid password. See
RfcOpen for more information.This function is defined in SAPRFC.H.
Return Values:
The call was successfully completed, and the values of the returned parameters were filled into the fields being supplied by the
An internal error has occurred.
The callee has raised an exception. The field ‘*exception’ points to the name of the exception. No data were transported.
The local or remote RFC system has raised an exception. Also, ‘*exception’ points to the name of the exception. The connection was automatically closed by the system and
The callee has issued an RFC call to the caller of RfcReceive. No data are transported. The call request must be handled by using the functions
Function Parameters:
connection handle
function module to call
‘exporting’ parameters
‘importing’ parameters
‘tables’ parameters
output parameter: pointer to exception string. This parameter is only set if RFC_EXCEPTION or RFC_SYS_EXCEPTION is returned
See also RfcCall and RfcReceive.