To raise an exception while processing a received RFC call, use the function:

RFC_RC SAP_API RfcRaise(RFC_HANDLE handle, char * exception);

RfcRaise should be used instead of RfcSendData if an exception is to be raised.
If RfcRaise is used, then do not send off an additional RfcSendData.

If there are tables parameters in your function module use RfcRaiseTables instead.

This function is defined in SAPRFC.H.

Return Values:

  • RFC_OK

Function Parameters:

Function parameters:

  • handle

Rfc connection handle

  • exception

exception to be raised (null-terminated string)

See also RfcRaiseTables.