Business Transaction Events BTE 增强
BTE 介绍
BTEs Are enhancements that were developed for the Financial Accounting (FI) component
BTEs Have predefinZed interfaces allowing customer access
BTEs Have one of the following types of interfaces:
- Publish & Subscribe
- Process interfaces
Business Transaction Events use one of the following types of interfaces:
- Publish & Subscribe interfaces
These interfaces inform external software that certain events have taken place in an SAP standard application and provide them with the data produced. The external software cannot return any data to the R/3 System.
这些接口通知外部软件SAP标准应用程序发生了某些事件,并为他们提供生成的数据,但是外部软件系统无法返回任何数据到 R/3 系统。
- Process interfaces
These interfaces are used to control a business process differently than the way in which it is handled in the standard R/3 System. They intervene in the standard process, and return data to the SAP application.
这些接口用于处理业务流程,与标准R/3系统的处理方式不同,他们干涉标准进程,并且返回数据到SAP应用程序。
Publish & Subscribe interfaces:
- Allow you to start one or more (multiple) additional operations when a particular event is triggered. They do not influence the standard R/3 program in any way.
- Multiple operations do not interfere with each other.
- Add on components can only import data.
- Possible applications: Additional checks (authorizations, existing duplicates, and so on)
允许你在触发特殊事件的时候启动一个或多个附加操作,他们不会以任何方式影响标准R/3系统。
多个操作彼此之间不交互
附加部分只能够输入数据
可能的程序:附件的检查(权限,副本等)
(主数据被创建、修改或锁定 / 凭证被输入、预制、修改或冲销 / 项目被清除或重置 / 附加的开发中基于此事件和数据产生附加的处理 启动工作流 , 产生或修改附加数据 , 请求通信 )
Process interfaces:
- In contrast to Publish & Subscribe interfaces, data is exchanged in both directions with process interfaces. This affects the number of additions that can be attached to the interface.
- When an event is triggered, a process in the standard program can only be replaced by a single external process using the process interface.
- If you are using an add on from an SAP partner that uses a process interface, this enhancement is processed at runtime. If you choose to use this same process interface for one of your own developments, the partner enhancement is discarded and your own enhancement is processed at runtime instead.
与发布订阅接口相比,与处理接口的数据交互是双方向的。这影响到接口上附加的数量。
当事件触发,标准程序中一个进程只可以通过进程接口被一个外部进程替代。
如果你在进程接口中增加了一个SAP Partner , 那这部分增强将会及时响应。如果您选择在您自己的开发中使用相同的流程接口,那么伙伴增强将被丢弃,而您自己的增强将在运行时处理。
区别:
Publish & Subscribe interfaces 用于告诉外部程序在标准程序中触发了哪些事件,并且把相关的数据提供给外部,外部程序不能返回任何数据给SAP,Process interfaces会将外部程序处理后的数据返回给标准程序,可能对标准程序中后续的处理逻辑产生影响。
BTE分为三种级别,内部事件、合作伙伴的事件和客户的事件,内部事件由SAP发布,合作伙伴事件由SAP软件开发伙伴提供,客户事件由实施顾问配置开发用于实现企业内部的特殊需求。
BTE增强工作原理
该程序调用一个函数模块,该模块确定并处理增强的主动实现。函数模块的名称以OPEN_FI_PERFORM_或OUTBOUND_CALL_开头。
At the point system alse considers the condition under which the function module will be processed in the customer namespace. For example you can select the country or application as the condition , these conditions are also shown as filter value.
此时,系统还考虑在客户名称空间中处理函数模块的条件。例如,可以选择国家或应用作为条件。这些条件也显示为过滤器值。
The SAP developer registers the event and creates a template function module, sample_interface_<n>, which establishes the interface for the user.
To find out directly whether an application transaction offers business transaction events, you can use the procedure described on the left-hand side of the graphic, In the program source text, search for the character string OPEN_FI_PERFORM . The number that completes the name of the function module is also the name of event.
要直接查明应用程序事务是否提供业务事务事件,可以使用图左侧描述的过程。在程序源文本中,搜索字符串OPEN_FI_PERFORM。完成函数模块名称的数字也是事件的名称。
注:查找方法:
在 PC_FUNCTION_FIND、BF_FUNCTIONS_FIND 函数中打上断点,入参即对应事件的编号。
The Environment menu of the service transaction FIBF contains two programs that you can use to search for BTEs. You can restrict the search by using various parameters.
Use service transaction FIBF to create a product , A product groups together a collection of enhancements.
You can create prodocts for various layers in delivery chain. They define a sequence for processing the implementation of a business transaction event.
You can only switch each products on or off as a whole entity. This allow user to control which enhancement should be processed and which should not , It also ensures the integrity of the whole enhancement.
使用服务事务FIBF创建产品。
产品将一组增强功能组合在一起。
您可以为交付链的各个层创建产品。它们定义了处理业务事务事件实现的序列。
您只能将每个产品作为一个整体来开关。这允许用户控制应该处理哪些增强,不应该处理哪些增强。它还确保了整个增强的完整性。
First, you must choose an interface to attach your function module to , you can fill function module with any source text except COMMIT WORK .
In contrast to comtomer exits , business transactions events are client-specfic. This means that the same event can be used in defferent clients for differents purpose.
与用户出口或者其他增强相比,BTEs在不同client下是唯一的,这意味着同一个事件在不同的client端可以有着不同效果或者目的。
BTEs may also be used more than once.
BTEs可以同样被用到不止一次。
With Publish & Subscribe interfaces , you can choose which enhanment you want to use.
With process interfaces, the system executes a single component in the hierarchical sequence: SAP application, add-on, customer.
sap application 是SAP自己的 partner 是合作伙伴的(合作伙伴做的增强包,SAP认证好了 可以打进所有SAP里面,) customer的只是这个客户自己。
SAP以前的发布模式是发布产品然后客户可以通过customer exit进行增强。随着软件越来越component-oriented,SAP为每个industry提供了标准的solution,他们作为加入其它封装功能的基础,其下续应当是其合作伙伴来建立CSP(Complementary Software Program),而最后才是customer。在这个开发链上的每一个部分都可能是enhancement的潜在用户和提供者。而这不能通过customer exit来实现,因为它只能发布一次。所以提供了另外一种增强机制可以被重复发布。
两种BTE不同的特点比较:Public & Subscribe interface
l 当特定的事件触发时可以启动一个或多个additional operations,并不会影响standar R/3 program本身。
l 多个operation之间不会相互影响
l 他们只能import data
l 可以增加额外的check(比如:authority check,existing duplicates等)
对于process interface:
l 可以在两个方向交换数据。这样就影响到了可以加到这个interface上additions的数目。
l 当事件触发时,只有一个additional process可以替代当前的process
l 如果你要使用SAP Partner的add on,那么这个add on就会在运行时被处理,如果想使用自己的logic做add on那么Partner的add on就会被discard。
SAP program通过以OPEN_FI_PERFORM_<no>或outbound_call_<no>的形式称为service function module的形式implement BTE的。这些function module确定了每个enhancement不同的active implements并把他们放在internal table中。Function modules按照internal table定义的顺序执行。并且系统会按照不同的条件执行不同的customer namespace中的function module。比如你可以把国家作为条件。下面的代码演示了BTE的方式实现在SAP program中调用程序的过程:
REPORT <program_using_BTE>.
START-OF-SELECTION.
…
CALL FUNCTION
‘OPEN_FI_PERFORM_00001350_E’
EXPORTING
<i_variables>
FUNCTION POOL <sap_fp>.
….
FUNCTION open_fi_perform_00001350_e.
…
LOOP AT itab INTO wa.
CALL FUNCTION wa-fb_name
EXPORTING
<i_variables>.
ENDLOOP.
…
ENDFUNCTION.
BTE像customer exit一样允许你在某个task function加入additional logic。SAP开发人员来决定在什么地方加入并可以传输什么样的数据。他们还创建了sample function modules,short texts,interfaces和documentation以及这个enhancement可以实现的功能。首先sap开发人员给BTE分配一个8个数字的标识。这些命名遵循一个特定的规则。Sap开发人员注册这个event,并创建一个template function module,它为用户建立interface。
可以在application transaction的源代码中搜索OPEN_FI_PERFORM来确认这个transaction是否实施了BTE,function module的name跟BTE的名字一致。可以通过transaction FIBF来管理BTE。在menu ->environment中可以找到适合的BTE。
在找到的BTE list中,可以显示model function module,interface和documentation。Document详细描述了如何使用这个enhancement以及这个enhancement的局限性。可以通过FIBF来创建一个product,一个product是enhancements的集合。你可以在delivery chain的不同层次创建product,它定义了BTE implementations的顺序。Product只能作为一个整体被激活或取消激活。
可以在FIBF中处理实施BTE的所有动作。首先你必须选择一个attach你的FM
的interface,interface按钮显示了你的interface的parameters,可以通过documen来确认这个interface可以实现的功能。通过abap workbench来copy model module:sample_interface_<n>到customer namespace中。禁止修改function module的interface。Function module中不能使用语句COMMIT WORK。不要忘了激活function module,要给function module和product分配一个Number。
Customer exit和bte的比较:
Customer Exit | BTE | |
Source Code | 支持 | 支持 |
Menus | 支持 | 不支持 |
Screens | 支持 | 不支持 |
Tables | 支持 | 不支持 |
Administration levels | 支持 | 不支持 |
Reusable | 不支持 | 支持 |
Client specific | 不支持 | 支持 |
Filter specific | 不支持 | 支持 |
文章来自于网络,如果侵犯了您的权益,请联系站长删除!