RFC-Interview Questions & Answers-SAP ABAP-5.


21. What Do You Mean By The Terms RFC Client & RFC Server?

RFC client is the instance that calls up the Remote Function Call (RFC) to execute the function that is provided by an RFC server. The process that starts the RFC is called the sender or client, and the process in which the RFC is executed is the recipient or server.

Say we have CRM and R/3 System. If we want to read Sales Order’s Delivery Status record from R/3 System’s database, we will have to create a remotely callable function module in the R/3 environment which retrieves Sales Order’s Delivery Status records. Now we will have to call this function from the CRM System using a remote function call (Also list the destination for the target R/3 System in SM59). In this case CRM server acts as an RFC Client and R/3 acts as an RFC Server.


22. What Do You Understand By The Term DESTINATION Used In RFC?

CALL FUNCTION RemoteFunction DESTINATION Dest
    EXPORTING
       f1 =...
       f2 =...
    IMPORTING
       f3 =...
    TABLES
       t1 =...
    EXCEPTIONS......

The field 'Dest' can be either a literal or a variable. Its value is a logical destination (for example,
"CRM110") known to the local SAP System. Logical destinations are defined using transaction SM59 and the corresponding data is stored in standard database table RFCDES.


The remote function call concept, for example, allows you to access a function module in an R/3 System from an ABAP program in a CRM System. If you want to read Sales Order’s Delivery Status record from your R/3 System’s database, create a remotely callable function module in the R/3 environment which retrieves Sales Order’s Delivery Status record. Call this function from your CRM System using a remote function call and listing the destination for the target R/3 System:


CRM System: Client

CALL FUNCTION ‘RFC_SALES_DEL_STATUS’
DESTINATION ‘R10’
EXPORTING VBELN = SALESNO
TABLES STATUS_T = IT_TAB
EXCEPTIONS NO_RECORD_FOUND = 01.

R/3 System: Server

FUNCTION RFC_SALES_DEL_STATUS.
.... (Read Sales Order’s Delivery Status record)
ENDFUNCTION.


23. How Parameter Handling Is Different For Remote Function Calls & Local Function Calls?

In Remote Function Calls, The actual table is transferred, but not the table header. If a table parameter is not specified, an empty table is used in the called function.

Internal ABAP tables can be used as parameters for function module calls. In a local function module call, a parameter table is passed on by reference, and no new local copy has to be created. RFC does not support the ‘by reference’ mechanism, so the whole table has to be exchanged between the RFC client and the RFC server. When the RFC server receives the table entries, it creates a local copy of the internal table.


24. Can We Call Remote Function Calls Locally?

Sometimes there might be a need to call a remote function call from within the same system. This function can run either as a remote or a local call, depending on the CALL FUNCTION statement on how it is declared. It’s a known fact that parameter handling are different for Remote Function Call and Local Function Call, so whether the call runs as remote or local the parameter handling gets affected adversely.


We can call remote functions calls locally using two ways.

CALL FUNCTION...DESTINATION = 'NONE'

This is a remote call, even though DESTINATION = 'NONE' means that the remote function will run in the same system as the caller. As a remote call, the function module runs in its own roll area, and parameter values are handled as for other remote calls

CALL FUNCTION ‘RFC_SALES_DEL_STATUS’
DESTINATION ‘NONE’
EXPORTING VBELN = SALESNO
TABLES STATUS_T = IT_TAB
EXCEPTIONS NO_RECORD_FOUND = 01.

CALL FUNCTION... [no DESTINATION used]

This is a local call, even though the function module is registered as remote. The module does not run in a separate roll area, and is essentially like a normal function call. Parameter transfer is handled as for normal function modules. In particular, if the call leaves some EXPORTING parameters unspecified, it terminates abnormally.

CALL FUNCTION ‘RFC_SALES_DEL_STATUS’
EXPORTING VBELN = SALESNO
TABLES STATUS_T = IT_TAB
EXCEPTIONS NO_RECORD_FOUND = 01.


25. Can a Server System Call Remote Function Of Client System BACK or When to use DESTINATION ‘BACK’?

In general, the client and the server are determined at the start of an RFC. While a function is being processed on the server, this server can call a remote function on the client. In other words, the remote function can invoke its own caller (if the caller is itself a remote function module), or any remote function module loaded with the caller. The called-back function then runs in the same program context as the original caller.

This call-back mechanism can be triggered by using the special destination name ‘BACK’. If this name is specified in an RFC call on the system acting as the server, the system uses the same RFC connection that was established when the server received the first call. Once an RFC connection is established, it is maintained until it is either explicitly closed or until the calling program terminates. During a call-back, the system will always attempt to use existing RFC connections before establishing a new one.

To perform a call-back, the syntax is:

CALL FUNCTION... DESTINATION 'BACK'

In the below screenshot, remote function B of System B invokes remote function A in the calling System A.

























More Questions & Answers On SAP RFC:

26. How Can You Differentiate Types Of RFC By Syntax In An ABAP Program?
27. What Do You Mean By Trusted RFC Connections? What Are The Advantages Of It?
28. What Are The Different Testing Options Available For RFC Connection?
29. How To Debug A Remote Function Call (RFC)?
30. What Are The Basic Transaction Codes Used For RFC's?

1. What Do You Mean By RFC? Explain In Detail.
2. What Is An RFC Interface? What are the types of RFC Interface?
3. What Are The Functions Of RFC Interface?
4. Explain A Scenario Where There Will Be A Need Of Using RFC?
5. What Are The Advantages Of RFC – Remote Function Call?


... Return To ABAP Interview Questions With Answers Index