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:

Function Parameters:

See also RfcCall and RfcReceive.