Вы находитесь на странице: 1из 3

guru99.

co m

http://www.guru99.co m/all-abo ut-rfc-remo te-functio n-calls.html

What is RFC and discover different interfaces of RFC


What is RFC?
A Remote Function Call(RFC) is a call to a f unction module running in a system dif f erent f rom the caller's.
T he remote f unction can also be called f rom within the same system (as a remote call).T he RFC interface
provides the ability to call remote f unctions.
RFC consists of two interf aces :
1. A calling interf ace f or ABAP Programs
2. A calling interf ace f or Non-SAP programs.
Any ABAP program can call a remote f unction using the CALL FUNCT ION...DEST INAT ION statement. T he
DEST INAT ION parameter tells the SAP System that the called f unction runs in a system other than the
caller's.
Syntax1

CALL FUNCTION 'remot efunct ion'<br>

DESTINATION dest <br>

EXPORTING f1 =<br>

IMPORTING f2 =<br>

TABLES t 1 =<br>

EXCEPTIONS

Logical Destinations are def ined via transaction SM59 and stored in Table RFCDES
Functions of the RFC interface
Converting all parameter data to the representation needed in the remote system
Calling the communication routines needed to talk to the remote system.
Handling communications errors, and notif ying the caller, if desired ( using EXCEPT IONS paramater
of the CALL FUNCT ION).

Types of RFC
1. Synchronous RFC - T he calling program continues the execution only af ter the called f unction is
complete.
2. Asynchronous RFC - T he calling program continues the execution without waiting f or return f rom
the called f unction.
3. Transactional RFC - T he called f unction module is executed exactly once in the RFC target
system.Each f unction call is seen as a transaction in the target system. Transactional RFCs use the
suf f ix IN BACKGROUND TASK . Eg : CALL FUNCT ION 'remotef unction' IN BACKGROUND TASK

How to Code an RFC ?


1.In the f unction module attributes tab (transaction code SE37), set the processing type as Remote-

enabled module to create a remote f unction module.

2.Write the code f or the f unction module.

3.Def ine the destination of the RFC server in the RFC client system that calls the remote f unction ( via
SM59 transaction).

4.Declaring Parameters: All parameter f ields f or a remote f unction module must be def ined as ref erence
f ields, that is, like ABAP Dictionary f ields.
5.Exceptions: T he system raises COMMUNICAT ION_FAILURE and SYST EM_FAILURE internally. You can
raise exceptions in a remote f unction just as you would in a locally called f unction.

Debugging Remote Function Calls


It is not possible to debug a remote f unction call to another system.
However, when testing ABAP-to-ABAP RFC calls, you can use the ABAP debugger to monitor the
execution of the RFC f unction in the remote system.
With remote calls, the ABAP debugger (including the debugging interf ace) runs on the local system.
Data values and other run inf ormation f or the remote f unction are passed in f rom the remote
system.
inShare

Вам также может понравиться