cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DIFFERENCE BETWEEN RFC and TRFC

Former Member
0 Likes
6,537

Hi

I'm very much confused by stufying the document.. so, can any one briefly explain abt what is the difference between RFC and TRFC..

where exactly we can use RFC and TRFC.. when can we go for RFC and when can we go for TRFC ..

thanks

Babu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

HI,

Asynchronous RFC :



This is used when you need to increase the performance of ABAP program by having system call more than one function module in parallel than forcing the program to wait for results .


Transactional RFC

This let you group one or more function module call together o tRFC LUW and ensure that fucnction module within LUW is called once . In contrast to aRFC and sRFC the tRFC belonging to tRFC LUW are executed in order .

tRFC is always used if a function is executed as a Logical Unit of Work (LUW). Within a LUW, all calls are

1.Executed in the order in which they are called

2.Executed in the same program context in the target system

3.Run as a single transaction: they are either committed or rolled back as a unit.

Implementation of tRFC is recommended if you want to guarantee that the transactional order of the calls is preserved

Asynchronous remote function calls (aRFCs) are similar to transactional RFCs, in that the user does not have to wait for their completion before continuing the calling dialog. There are three characteristics, however, that distinguish asynchronous RFCs from transactional RFCs:

· When the caller starts an asynchronous RFC, the called server must be available to accept the request.

The parameters of asynchronous RFCs are not logged to the database, but sent directly to the server.

· Asynchronous RFCs allow the user to carry on an interactive dialog with the remote system.

· The calling program can receive results from the asynchronous RFC.

You can use asynchronous remote function calls whenever you need to establish communication with a remote system, but do not want to wait for the function’s result before continuing processing. Asynchronous RFCs can also be sent to the same system. In this case, the system opens a new session (or window). You can then switch back and for between the calling dialog and the called session

RECEIVE RESULTS FROM FUNCTION Remotefunction is used within a FORM routine to receive the results of an asynchronous remote function call. The following receiving parameters are available:

IMPORTING

TABLES

EXCEPTIONS

The addition KEEPING TASK prevents an asynchronous connection from being closed after receiving the results of the processing. The relevant remote context (roll area) is kept for re-use until the caller terminates the connection.

Regards

Sudheer

Answers (8)

Answers (8)

Former Member
0 Likes

thanks

paruchuri_nagesh
Active Contributor
0 Likes

rfc is used to establish communcation between two systems

rfcs are 3 types

synchronous RFC: it will deliver document when the previous request has been updated only(when response come from the target system)

asynchronous rfc: it delivers document without waiting for the previous response

trfc(transactional rfc):but in case of trfc if the target system is not available at the time of delivery it will try to attempt to deliver the document at regular intervals

and also ensure to deliver the document only once (consistency maintainence is possible

reward for use ful points

regards

Nagesh.Paruchuri

Former Member
0 Likes

hi.,

RFC is used to get the data from Remote systems or from third party tools.

tRFC is used in distributed environment like iDoc transfer from one system to another system.

<i><b>

Reward points if useful</b></i>

Chandra

Former Member
0 Likes

Hi,

Remote Function Call:

RFCs are requests that an SAP component sends to invoke functions on remote systems, or calls that remote systems initiate to invoke functions on an SAP component.A process that can accept RFCs from SAP components. This allows SAP components to access functions in external systems. In SAP BC terminology, the process is called a Listener. Listeners are one or more threads on SAP Business Connector that wait for incoming requests from SAP components. Listeners are named and register with an SAP gateway to indicate that they are ready to accept requests. Listeners can accept RFC or tRFC requests.

Transactional RFC (tRFC) and Queued RFC (qRFC). tRFC is used mainly to transfer ALE Intermediate Documents (IDocs).

Transactional RFC:

If an error occurs during a synchronous remote function call, the system cannot tell at what point the error occurred (most crucially, whether the function module was actually processed in R/3 before the operation failed). Restarting a failed call is therefore a dangerous thing to do, since you risk duplicating a completed function call.

To alleviate this problem, you can use transactional RFC, which guarantees that each function call you issue will only be executed once, even if you submit it repeatedly to the R/3 System. The system implements this safeguard by assigning a unique transaction ID (TID) to each transaction that you submit. When you attempt to process the transaction, the system checks whether that TID has already been processed. If it has, the transaction is ignored.

Queued RFC:

When you use transactional RFC, you cannot guarantee the order in which the function calls will be processed in the system (it is quite possible that one call might overtake another). For cases where you need to specify a particular processing order, you can use queued RFC, which is an extension of transactional RFC. In qRFC, you place each function call in a logical queue. A function call cannot be executed until all of its predecessors in the queue have been processed. Queued RFC calls are processed asynchronously.

RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of communication processes between systems.

RFCs enable you to call and execute predefined functions in a remote system - or even in the same system.

RFCs manage the communication process, parameter transfer and error handling.

reward if useful

Former Member
0 Likes

RFC:

Remote Function Call (RFC) is the standard SAP interface for communication between SAP systems. The RFC calls a function to be executed in a remote system.

Transactional RFC (tRFC) and Queued RFC (qRFC). tRFC is used mainly to transfer ALE Intermediate Documents (IDocs).

Transactional RFC:

If an error occurs during a synchronous remote function call, the system cannot tell at what point the error occurred (most crucially, whether the function module was actually processed in R/3 before the operation failed). Restarting a failed call is therefore a dangerous thing to do, since you risk duplicating a completed function call.

To alleviate this problem, you can use transactional RFC, which guarantees that each function call you issue will only be executed once, even if you submit it repeatedly to the R/3 System. The system implements this safeguard by assigning a unique transaction ID (TID) to each transaction that you submit. When you attempt to process the transaction, the system checks whether that TID has already been processed. If it has, the transaction is ignored.

Queued RFC:

When you use transactional RFC, you cannot guarantee the order in which the function calls will be processed in the system (it is quite possible that one call might overtake another). For cases where you need to specify a particular processing order, you can use queued RFC, which is an extension of transactional RFC. In qRFC, you place each function call in a logical queue. A function call cannot be executed until all of its predecessors in the queue have been processed. Queued RFC calls are processed asynchronously.

Just go through these links

http://help.sap.com/saphelp_nw2004s/helpdata/en/22/0424fe488911d189490000e829fbbd/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/6f/1bd5b6a85b11d6b28500508b5d5211/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/22/042578488911d189490000e829fbbd/content.htm

Please give me reward points if it is useful.

Thanks

Murali Poli

Former Member
0 Likes

hI

RFC:

Remote Function Call (RFC) is the standard SAP interface for communication between SAP systems. The RFC calls a function to be executed in a remote system.

Transactional RFC (tRFC) and Queued RFC (qRFC). tRFC is used mainly to transfer ALE Intermediate Documents (IDocs).

Transactional RFC:

If an error occurs during a synchronous remote function call, the system cannot tell at what point the error occurred (most crucially, whether the function module was actually processed in R/3 before the operation failed). Restarting a failed call is therefore a dangerous thing to do, since you risk duplicating a completed function call.

To alleviate this problem, you can use transactional RFC, which guarantees that each function call you issue will only be executed once, even if you submit it repeatedly to the R/3 System. The system implements this safeguard by assigning a unique transaction ID (TID) to each transaction that you submit. When you attempt to process the transaction, the system checks whether that TID has already been processed. If it has, the transaction is ignored.

Queued RFC:

When you use transactional RFC, you cannot guarantee the order in which the function calls will be processed in the system (it is quite possible that one call might overtake another). For cases where you need to specify a particular processing order, you can use queued RFC, which is an extension of transactional RFC. In qRFC, you place each function call in a logical queue. A function call cannot be executed until all of its predecessors in the queue have been processed. Queued RFC calls are processed asynchronously.

<b>rEWARD IF USEFULL</b>

Former Member
0 Likes

Transactional RFC

1 This type of RFC was renamed from asynchronous to transactional RFC, because asynchronous RFC has another meaning in R/3 Systems.

2 The called function module is executed exactly once in the RFC server system. Each function call is seen as a transaction in the target system.

3 Transactional RFCs use the suffix IN BACKGROUND TASK. The remote system need not be available at the time when the RFC client program is executing a tRFC.

4 The tRFC component stores the called RFC function together with the corresponding data in the R/3 database, including a unique transaction identifier (TID).

5 If a call is sent, and the receiving system is down, the call remains in the local queue until a later time.

6 The calling dialog program can proceed without waiting to see whether or not the remote call was successful. If the receiving system does not become active within a certain amount of time, the call is scheduled to run in batch.

7 The system logs the remote call request in the database tables ARFCSSTATE and ARFCSDATA with all of its parameter values. You can display the log file using transaction SM58.

8 When the calling program reaches a COMMIT WORK, the remote call is forwarded to the requested system for execution.

9 Transactional RFC requests are transferred, with parameter data in byte-stream form, using TCP/IP or X400.

10 LUW's are identified by transaction ID's that are unique world-wide. The transaction ID can be determined from an ABAP program by calling function module ID_OF_BACKGROUNDTASK. (You must call this function after the first asynchronous CALL, and before the related COMMIT WORK.)

11 The system function module ARFC_DEST_SHIP transports the data to the target system and the function module ARFC_EXECUTE executes the stored function calls. If an error or an exception occurs during one of the calls, all the database operations started by the preceding calls are rolled back and an appropriate error message is written to the file ARFCSSTATE.

12 Once you have identified the ID of the LUW, you can use the function module STATUS_OF_BACKGROUNDTASK to determine the status of the transactional RFC.

13 Call transaction SM58 (Tools _ Administration _ Monitoring _ Transactional RFC). This tool lists only those transactonal RFCs that could not be carried out successfully or that had to be planned as batch jobs. The list includes the LUW ID and an error message. Error messages displayed in SM58 are taken from the target system. To display the text of the message, double-click on the message.

14 If a LUW runs successfully in the target system, the function module ARFC_DEST_CONFIRM is triggered and confirms the successful execution in the target system. Finally, the entries in the Tables ARFCSSTATE and ARFCSDATA are deleted.

DISADVANTAGES

1 These can reduce performance significantly in both the send and the target

systems.

2 In addition, the sequence of LUWs defined in the application cannot be kept. Therefore, there is no guarantee that the transactions are executed in the sequence dictated by the application. The only guarantee is that all LUWs are transferred sooner or later.

SYNTAX

Eg : CALL FUNCTION ‘remotefunction’ IN BACKGROUND TASK

CALL FUNCTION func IN BACKGROUND UNIT

parameter_list. The field ‘dest’ can be either a literal or a variable. Logical destinations are defined in the RFCDES table via transaction SM59 or via the menu path: Tools ->Administration,Administration->Network->RFC destinations.

SAMPLE PROGRAM

RSTRFCT0

former_member189629
Active Contributor
0 Likes

Babu,

Check this link for info on RFC & TRFC...

http://help.sap.com/saphelp_nw04/helpdata/en/62/73241e03337442b1bc1932c2ff8196/content.htm

Reward if helpful,

Karthik