Show TOC

Background documentationCall-Back from an ABAP Function Module Locate this document in the navigation structure

 

The following programming example shows you how to use this feature:

RFC client program

Function module in an SAP system

rfc_rc = RfcOpen(...);

FUNCTION ABC.

rfc_rc = RfcInstallFunction('XYZ', xyz_function,...);

rfc_rc = RfcCallReceive('ABC',...);

----->

CALL FUNCTION 'XYZ' DESTINATION 'BACK'

If(rfc_rc==RFC_CALL)

<-----

{

rfc_rc = RfcDispatch(...);

if(rfc_rc!=RFC_OK)

exit(1);

----->

...

}

rfc_rc=RfcReceive(...);

<-----

ENDFUNCTION

...

Syntax Syntax

  1. /* RFC function: ‘ABC’ */
  2. static RFC_RC xyz_function(RFC_HANDLE rfc_handle)
  3. {
  4.                                 rfc_rc = RfcGetData
  5. (...);                /*   Get RFC data  */
  6.                                 ...    
  7. Process RFC data */
  8.                                 rfc_rc = RfcSendData
  9. (...);               /*   Report result to ABAP   */
  10.    return 0;
  11. }
End of the code.