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. C++中怎样获取类成员的指针

     我们都知道C++ class中有三种成员函数,static(静态的),nonstatic(非静态的),virtual(虚拟的)各种成员函数的指针各有差别,下面是一个完整的样例:(注意红颜色的差别 ...

  2. SQL Server 2005中设置Reporting Services发布web报表的匿名访问

    原文:SQL Server 2005中设置Reporting Services发布web报表的匿名访问 一位朋友提出个问题:集成到SQL Server 2005中的Reporting Services ...

  3. python网络爬虫进入(一)——简单的博客爬行动物

    最近.对于图形微信公众号.互联网收集和阅读一些疯狂的-depth新闻和有趣,发人深思文本注释,并选择最佳的发表论文数篇了.但看着它的感觉是一个麻烦的一人死亡.寻找一个简单的解决方案的方法,看看你是否可 ...

  4. HTML 速成

    html零基础者入. 记得学计算机网络的时候好像有学过一些HTML,但没运用起来都忘光了.近来想学学如何写网页.就从html(HyperText Markup Language超文本标记语言)入手了. ...

  5. shell脚本中执行另一个shell脚本

    分类: 可以在一个shell脚本中执行另一个shell脚本(或非可执行文件,主要用于取得一些变量的值),方法是: . 文件名(包括路径) 或 变量=文件名(包括路径) . $变量   注意,圆点后面有 ...

  6. 【分享】Python学习资源大合集

    地址:http://www.hejizhan.com/html/xueke/520/x520_03.html Python安装软件合集(Windows)(78) Python教程——游戏编程(13) ...

  7. Nutch搜索引擎Solr简介及安装

    Nutch搜索引擎(第2期)_ Solr简介及安装   1.Solr简介 Solr是一个高性能,采用Java5开发,基于Lucene的全文搜索服务器.同时对其进行了扩展,提供了比Lucene更为丰富的 ...

  8. SugarSync网盘之XML解析

    iOS的XML解析 刚在应用里支持了SugarSync网盘.其实也是第一次听说这个网盘,不过在国外貌似还蛮有名,这些都不是重点,重点是借此来总结一下iOS的XML解析.Xml想必也不陌生了,但是在iO ...

  9. RDLC(Reportview)报表直接打印,支持所有浏览器,客户可在linux下浏览使用

    最近在做一个打印清单的,但是rdlc报表自带的工具栏中的打印按钮只有在ie内核下的浏览器才可以使用(其他的就会 隐藏),这导致了使用火狐和谷歌浏览器还有使用linux系统的客户打印成了问题,于是就自己 ...

  10. MVC 4 插件化架构简单实现实例篇

    ASP.NET MVC 4 插件化架构简单实现-实例篇   先回顾一下上篇决定的做法: 1.定义程序集搜索目录(临时目录). 2.将要使用的各种程序集(插件)复制到该目录. 3.加载临时目录中的程序集 ...