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. 查询在应用程序运行得很慢, 但在SSMS运行得很快的原因探究

    原文:查询在应用程序运行得很慢, 但在SSMS运行得很快的原因探究 查询在应用程序运行得很慢, 但在SSMS运行得很快的原因探究 -理解性能疑点 1      引言 内容来自http://www.so ...

  2. SVG 学习(一)

    SVG 意为可缩放矢量图形(Scalable Vector Graphics). SVG 使用 XML 格式定义图像. 什么是SVG? SVG 指可伸缩矢量图形 (Scalable Vector Gr ...

  3. [翻译]初识SQL Server 2005 Reporting Services Part 4

    原文:[翻译]初识SQL Server 2005 Reporting Services Part 4 这一篇是关于SQL Server 2005 Reporting Services四篇文章中最后一篇 ...

  4. 使用Flexible实现手淘H5页面的终端适配(转)

    曾几何时为了兼容IE低版本浏览器而头痛,以为到Mobile时代可以跟这些麻烦说拜拜.可没想到到了移动时代,为了处理各终端的适配而乱了手脚.对于混迹各社区的偶,时常发现大家拿手机淘宝的H5页面做讨论—— ...

  5. AJAX 表单提交 文件上传

    1. AJAX = 异步 JavaScript 和 XML. AJAX 是一种用于创建快速动态网页的技术.通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更新.这意味着可以在不重新加载 ...

  6. iOS基础 - 瀑布流

    一.瀑布流简介 瀑布流,又称瀑布流式布局.是比较流行的一种网站页面布局,视觉表现为参差不齐的多栏布局,随着页面滚动条向下滚动,这种布局还会不断加载数据块并附加至当前尾部.最早采用此布局的网站是Pint ...

  7. AIX errpt命令说明

    查看系统的错误记录 在系统运行时,一些系统错误会记录在errlog 中,其中有些错误还会在终端上显示.检查错误日志可用以下命令: # errpt IDENTIFIER  TIMESTAM P  T  ...

  8. Xps实现文档显示、套打功能

    wpf采用Xps实现文档显示.套打功能(原创) 近期的一个项目需对数据进行套打,用户要求现场不允许安装office.页面预览显示必须要与文档完全一致,xps文档来对数据进行处理.Wpf的Documen ...

  9. VS2012 Unit Test

    VS2012 Unit Test 个人学习汇总(含目录) 首先,给出MSDN相关地址:http://msdn.microsoft.com/en-us/library/Microsoft.VisualS ...

  10. 由ASP.NET所谓前台调用后台、后台调用前台想到HTTP

    由ASP.NET所谓前台调用后台.后台调用前台想到HTTP 在由ASP.NET所谓前台调用后台.后台调用前台想到HTTP——理论篇中描述了一下ASP.NET新手的三个问题及相关的HTTP协议内容,在由 ...