Remote Function Calls (RFC) - Introduction
Remote Function Calls allow users to call R/3 function modules or external functions "remotely".
RFC
development libraries exist for
OS/2, Windows,
Windows NT, and for all UNIX
platforms supported by SAP. These help you to communicate with external programs (C and C++).
The
R/3 Function Builder also contains an RFC generator that you can use to generate external programs and download them onto your frontend system.
In an RFC, a series of tasks is performed automatically:
- Logon to the SAP partner system
- Conversion of all RFC data types
- Control of the communication flow
The following basic conditions apply when you call
a function module remotely:
The function module that you call must be flagged as "remote".
You set this attribute in the Function Builder.
Tools -> ABAP Workbench -> Development -> Function Builder. Note that all parameters in a remotely-callable
function module must have a reference field.
The target must be defined (see
Defining remote destinations). To do this, choose
Tools → Administration, Administration → Network →RFC destinations.
You
can execute a function module as follows:
Synvhronously:,,CALL
FUNCTION func DESTINATION dest
Asynchronously,,CALL
FUNCTION func ... STARTING NEW TASK taskname
Transactionally:,,CALL
FUNCTION func... IN BACKGROUND TASK
In a Remote Function Call, there is
an RFC client and an RFC server. The RFC client is the instance that calls the function "remotely".
The RFC server provides and executes the function.
To ensure that RFC functions are executed
on the RFC server regardless of the availablity of the server, you can make the call transactional (see
CALL FUNCTION func ...
IN BACKGROUND TASK). This buffers the parameters in the R/3 database and they are transferred
as a single unit.
See also the information about RFC logon to the
target system (remote logon), trusted systems, and the RFC authorization concept.
Typical problems and their solutions:
Help Documentation
For a comprehensive description of communication interfaces in the SAP environment, refer to Remote Communications.