An RFC server program is a program that contains RFC functions to be called by ABAP programs.
The RFC API provides routines to implement RFC server programs. After having started, the RFC server programs must inform the RFC library about all RFC functions that can be called within this server program. It then waits for incoming call requests, and the RFC library dispatches the requested calls (using RfcListenAndDispatch in a loop).
A typical server looks as follows:
RFC Server Program
There are two methods of receiving an RFC call. The most simple way in an external program is to register a C function to be called when a call request is received. The function RfcInstallServerFunction registers a C function to be called when receiving the request for an RFC call. After RfcRegisterServer ( RfcStartServer), or after receiving the return code RFC_CALL when calling RfcInvoke, the program must use RfcListenAndDispatch to call the corresponding registered function internally. The return code of the registered function is returned again by RfcListenAndDispatch.
There are some standard functions which are installed automatically. Apart from internally-used functions, the function modules are as follows:
RFC_PING
Is used to test the connection.
RFC_SYSTEM_INFO
Returns some information about the library and its environment.
RFC_DOCU
Returns the function documentation which was installed during RfcInstallServerFunction calls
RFC_DOCU does not return information of functions that have been implemented in a way other than using RfcInstallServerFunction (e.g. functions implemented via RfcInstallGenericServerFunction).