Transactional RFC
When using transactional RFC (tRFC), the called function module is executed exactly once in the called system (service property: Exactly Once).
The remote system does not have to be available when the RFC client program is executing a tRFC. The tRFC component stores the called RFC function in the SAP system database under a unique transaction number (TID), along with the corresponding data.
If a call is sent, and the receiving system is down, the call remains in the local queue. The calling dialog program can proceed without waiting to see whether 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.
Transactional RFCs use the suffix IN BACKGROUND TASK. 
As with synchronous calls, the DESTINATION parameter defines a program context in the remote system. If you call a function module with the same destination several times (or several function modules once), you can therefore access the global data for the called function module in the same context.
The system logs the remote call request in database tables ARFCSSTATE and ARFCSDATA with all parameter values. You can display the log file using transaction SM58. When the calling program reaches a COMMIT WORK, the remote call is forwarded to the requested system.
All tRFCs with a single destination that occur between one COMMIT WORK and the next belong to a single logical unit of work (LUW).
 
tRFC Process Flow Diagram
You can use transactional RFCs, for example, for complex processes that require updating of related database tables during different phases in a transaction.
Transactional RFC processing ensures that all the planned updates are carried out when the program reaches the COMMIT WORK statement.
Function modules that are called transactionally cannot have any EXPORT parameters in their definition, as a corresponding IMPORTING parameter in the calling program causes syntax errors.
Note also that you cannot make asynchronous calls to functions that perform call-backs.
System Availability
If the remote system is unavailable, the SAP System uses the relevant transaction ID (TID) to schedule report RSARFCSE as a background processing variant. This report, which forwards asynchronous calls for execution, is called repeatedly until it succeeds in connecting with the system in question.
When scheduled in batch, RSARFCSE runs automatically at set intervals (the default setting is for up to 30 attempts at 15 minute intervals). You can customize this interval and the length of time the program should carry on trying for. Use enhancement programsTo configure a destination, call transaction SM59, select the screen for a destination and choose Edit ® TRFC Options. This enables you to set the maximum number of connection attempts and the intervals at which they are made.
If the system cannot be reached within the specified amount of time, the system stops calling RSARFCSE, and the status CPICERR is written to the ARFCSDATA table. Within another specified time (the default is eight days), the corresponding entry in the ARFCSSTATE table will be deleted (this limit can also be customized). It is still possible to start this type of entry manually in transaction SM59. 
 
Further Information
●  You can find a description of the statements for tRFC in:
 
CALL FUNCTION - IN BACKGROUND TASK  
Syntax
CALL FUNCTION func IN BACKGROUND TASK
  [DESTINATION dest]
  parameter list
  [AS SEPARATE UNIT].
Addition:
... AS SEPARATE UNIT
Effect
Transactional call of a remote-capable function module specified in func using the RFC interface. You can use the addition DESTINATION to specify an individual destination in dest. NONEWhen the transactional call is made, the name of the called function, together with the destination and the actual parameters given in parameter list, are registered for the current SAP LUW in the database tables ARFCSSTATE and ARFCSDATA of the current SAP system under a unique transaction ID (abbreviated简称 as TID, stored in a structure of type ARFCTID from the ABAP Dictionary, view using transaction SM58). Following this registration, the program making the call is continued by way of the statement CALL FUNCTION.
When executing the COMMIT WORK statement, the function modules registered for the current SAP LUW are started in the sequence in which they were registered. The statement ROLLBACK WORKdeletes all previous registrations of the current SAP LUW.
If the specified destination is not available for COMMIT WORK, an executable called RSARFCSE is started in the background. This attempts to start the functional modules registered for an SAP LUW in their destination, every 15 minutes up to a total of 30 times. You can make changes to these parameters using transaction SM59. If the destination does not become available within the given time, this is noted in the database table ARFCSDATA as a CPICERR entry. By default, this entry in database table ARFCSSTATE is deleted after 8 days.
Addition
... AS SEPARATE UNIT
Effect
When using the addition AS SEPARATE UNIT, the relevant function module is executed in a separate context, a context in which the global data of the function group is not influenced by previous calls. Each function module that is registered with the addition AS SEPARATE UNIT is given a separate transaction ID. Without the addition AS SEPARATE UNIT, the usual description is applicable for the context of the called function modules. What this means is that, when using the same destination for multiple calls of function modules belonging to the same function group, the global data of this function group is accessed collectively.
You can use the function module ID_OF_BACKGROUNDTASK to define the transaction ID (TID) of the current SAP LUW, according to a transactional RFC.
The transactional RFC (tRFC) is suitable for realizing LUWs in distributed environments (a typical application is ALE). Here it must be noted that although executing the function modules within a transaction ID is predefined, the sequence of the LUWs on the RFC servers does not necessarily correspond to the sequence of SAP LUWs in the RFC client. To achieve a serialization on the RFC servers as well, the tRFC can be enhanced to queued RFC ( qRFC). For this, you can call function module TRFC_SET_QUEUE_NAME before a transactional RFC.
 
 
CALL FUNCTION - IN BACKGROUND TASK parameter_list
Syntax
... [EXPORTING p1 = a1 p2 = a2... ]
 [TABLES  t1 = itab1 t2 = itab2 ...] ... .
Effect
These additions are used to assign actual parameters to the formal parameters of the function module. The significance of the additions is the same as for synchronous RFC with the exception that no values can be copied with IMPORTING and CHANGING, and no return values can be allocated to exceptions that are not class-based.
 

Queued RFC (qRFC) 

The qRFC (queued Remote Function Call) is an extension of the tRFC. It allows you to serialize tRFC calls using a queue.

The tRFC call is preceded by function module TRFC_SET_QUEUE_NAME, which starts the serialization. The calls are then actually dispatched by a tRFC call.

The qRFC can be made with an outbound queue (serialization at the calling application) and also an inbound queue (serialization at the called application).

This results in the following scenarios for transactional data transfer:

Scenario 1: tRFC

This scenario is appropriate is the data being sent is independent of each other. A calling application (client) in system 1 uses a tRFC connection to a called application (r server) in system 2. In this scenario, data is transferred by tRFC, meaning that each function module sent to the target system is guaranteed to be executed once only. You cannot define the sequence in which the function modules are processed or the time when this happens. If an error occurs during the transfer, a batch job is scheduled, which sends the function module again after 15 minutes.

Scenario 2: qRFC with outbound queue

In this scenario, the sending system uses an outbound queue to serialize the data being sent. This means that mutually dependent function modules are placed in the outbound queue of the sending system. When the data is sent, the exact order is kept to, and the calls are sent to the target system exactly once in order.

The server system coding does not need to be changed in order to process qRFC calls. However, it must be tRFC enabled.

Scenario 3: qRFC with inbound queue (and outbound queue)

In this scenario, as well as an outbound queue in the sender system (client), there is also an inbound queue in the target system (server). If a qRFC with inbound queue exists, this always means that an outbound queue exists in the sender system.

The inbound queue only processes as many function modules as the system resources in the target system (server) at that time allow. This prevents a server being blocked by a client. A scenario with just one inbound queue in the server system is not possible, since the outbound queue is needed in the client system in order to set the order and to prevent individual applications from blocking all work processes in the client system.

More Information

You can find detailed information about qRFC in:

●  Queued Remote Function Call (qRFC)

Queued Remote Function Call (qRFC) 

 

Purpose

The qRFC is an enhancement of the Using Transactional Remote Function Calls that also allows you to send and receive data in a fixed call order.

While the tRFC offers the service quality Exactly Once (EO) (the call is guaranteed to be executed only once), with the qRFC, you can work with the method Exactly Once In Order (EOIO).

The service quality EOIO is important if the data must be posted in the same order in which is was created or sent for business or technical reasons.

Integration

The qRFC is based on the same transactional basic function as the tRFC.  For this reason, qRFC communication can only take place between tRFC-enabled systems.

The qRFC is enhanced by an additional queuing mechanism, which saves the LUWs to be sent or received in an outbound queue or an inbound queue respectively. These LUWs are sent or transferred to the receiver application in the exact order in which they were saved.

Additional Information

For more information about qRFC, see:

The qRFC Communication Model

●  qRFC with Outbound Queues

●  qRFC with Inbound Queue

qRFC Administration

●  qRFC Administration: Introductory Example

●  Outbound Queue Administration

●  Inbound Queue Administration

qRFC Programming

●  qRFC Programming: Introductory Example

●  Outbound Queue Programming

●  Inbound Queue Programming

●  qRFC API

RFC Transactional RFC (tRFC) queue RFC(qRFC) 概念的更多相关文章

  1. 消息队列(Message Queue)基本概念(转)

    背景 之前做日志收集模块时,用到flume.另外也有的方案,集成kafaka来提升系统可扩展性,其中涉及到消息队列当时自己并不清楚为什么要使用消息队列.而在我自己提出的原始日志采集方案中不适用消息队列 ...

  2. 消息队列(Message Queue)基本概念

    背景 之前做日志收集模块时,用到flume.另外也有的方案,集成kafaka来提升系统可扩展性,其中涉及到消息队列当时自己并不清楚为什么要使用消息队列.而在我自己提出的原始日志采集方案中不适用消息队列 ...

  3. 只读事务(@Transactional(readOnly = true))的一些概念

    念:从这一点设置的时间点开始(时间点a)到这个事务结束的过程中,其他事务所提交的数据,该事务将看不见!(查询中不会出现别人在时间点a之后提交的数据) 应用场合: 如果你一次执行单条查询语句,则没有必要 ...

  4. SAP RFC

    什么是RFC? RFC是SAP系统和其他(SAP或非SAP)系统间的一个重要而常用的双向接口技术,也被视为SAP与外部通信的基本协议.简单地说,RFC过程就是系统调用当前系统外的程序模块,从而实现某个 ...

  5. SAP RFC 的介绍

    第一部分 RFC技术 什么是RFC? RFC是SAP系统和其他(SAP或非SAP)系统间的一个重要而常用的双向接口技术,也被视为SAP与外部通信的基本协议.简单地说,RFC过程就是系统调用当前系统外的 ...

  6. SAP学习日志--RFC REMOTE FUNCTION CALL

    RFC  Remote function Call 远程功能调用, 是SAP系统之间以及非SAP系统之间程序通信的基本接口技术. 例如BAPI , ALE都是基于RFC实现的 SAP系统提供了三种外部 ...

  7. SAP RFC通信模式

    在网络技术中,数据通信可以大致划分为两种基本模式:同步通信和异步通信. 其本义是:异步通信时,通信双方时钟允许存在一定误差:同步通信时,双方时钟的允许误差较小.在SAP的系统间的通信过程中,也借用术语 ...

  8. SAP RFC函数

    RFC 接口 RFC是对一个函数模块的调用,但是调用者的系统与被调函数所在的系统是不一样的. RFC也可以在系统内被调用,但是通常调用和被调用是在不同的系统中的. 在sap系统中,远程调用的能力是有R ...

  9. ABAP RFC远程调用

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

随机推荐

  1. 《Programming Hive》读书笔记(两)Hive基础知识

    <Programming Hive>读书笔记(两)Hive基础知识 :第一遍读是浏览.建立知识索引,由于有些知识不一定能用到,知道就好.感兴趣的部分能够多研究. 以后用的时候再具体看.并结 ...

  2. Servlet配置load-on-startup

    <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http:// ...

  3. ASP.NET中Partial Class部分类

    原文:ASP.NET中Partial Class部分类 如果您在开发项目的公用函数库,用于公用函数库的内容越丰富越好,但这不可能一下子就写好,需要一点一点的积累,这时就可以使用Partial Clas ...

  4. WinForm中回车键实现文本框之间的跳转

    利用窗体的KeyPreView .设置KeyPreView = true 设置窗体的KeyPreView 属性为True后,那么窗体内的子控件响应KeyPress事件(或其他事件)之前,会先响应窗体的 ...

  5. 【转】Android 网络通信框架Volley简介(Google IO 2013)

    Volley主页 https://android.googlesource.com/platform/frameworks/volley http://www.youtube.com/watch?v= ...

  6. Android中那些权限

    Permission Permission Permission Group Permission Tree Users Permission ACCESS_CHECKIN_PROPERTIES 允许 ...

  7. 点击表格的单元格时实现变颜色,通过for循环为每个单元格添加一个onclick事件

    <title>无标题文档</title> <script type="text/javascript" language="javascri ...

  8. 使用POI 导入excel

    引言:最近一直在接触excel的问题,网页也有很多关于POI解析excel的资料,我也简单的整理了下,有不对地方的还望及时指正,渴望与大家交流并学习. public int importExcel(F ...

  9. C#编程断点续传

    C#编程总结(十二)断点续传 Posted on 2014-02-16 10:56 停留的风 阅读(384) 评论(3) 编辑 收藏 C#编程总结(十二)断点续传 我们经常使用下载工具,如bit精灵. ...

  10. HTTP压缩算法SDCH

    程序设计中使用的那些共享方法或者技术 前段时间看了个paper是讲述谷歌浏览器使用的压缩方法SDCH,其实原理还是比较简单的. 看了论文后就想总结一下程序中使用的一些共享方法或者技术吧. 1.Goog ...