如何实现一个BTE

来源:互联网 发布:百度自然搜索排名优化 编辑:程序博客网 时间:2024/05/16 05:43

Example Business Scenario for Business Transaction Events
Company A would like to copy the group key field from the vendor master into the allocation field on all the line items within a vendor invoice and payments, including the vendor lines. This requirement assumes only one vendor is posted to in a document.

To accomplish this requirement, Company A will use the Business Transaction Event 1130, Post Document: SAP Internal Field Substitution.

1. IMG Menu Path: Financial Accounting Financial Accounting Global Settings Use Business Transaction Events Environment Infosystem (Processes).
2. Find the correct Business Event. You are updating a field, so you select the Processes Info System instead of the Publish and Subscribe Info System.
3. Execute the search with the defaults.
4. Find the correct interface for updating a document: Post Document: SAP- Internal Field Substitution
5. Put your cursor on the event and click on the Sample Function Module button.
6. You are now in transaction SE37 – Function Builder. This is the function module (sample_process_00001130) you will need to copy into a "Z" name function module for your coding
7. Click on the Copy button.
8. Enter the "Z" function module name in the To Function Module field
9. Enter a Function Group. If you need to create a "Z" function group, go to transaction code SE37 and follow menu path: Go to Function Groups Create Group. A function group is a logical grouping of function modules, and the ABAP code is generated for function groups. You will be prompted for a development class and transport when creating the function group.
10. In Function Builder (transaction SE37), enter the new "Z" function module. Click on the Change button.
11. The system will default into the source code screen where you may enter your ABAP code.
12. Notice the tables available for the code. Additional tables may be declared if necessary.
13. Enter the following source code 


 tables: lfa1.
data: z_groupkey like lfa1-konzs.
z_groupkey = ' '.
loop at t_bseg.
* check for vendor lines. If one is found, read the vendor master and
* retrieve the group key field.
if t_bseg-koart eq 'K'.
select single konzs from lfa1 into z_groupkey
where lifnr = t_bseg-lifnr.
endif.
* Move the group key field into all line items allocation field.
loop at t_bsegsub.
t_bsegsub-zuonr = z_groupkey.
modify t_bsegsub index sy-tabix.
endloop. "t_bsegsub
endloop. "t_bseg


14. Save the function module.
15. Back out to the main Function Builder screen by clicking on the green arrow button.
16. Activate the function module by clicking on the Activate button
17. Assign the function module to the event in the IMG: Financial Accounting Financial Accounting Global Settings Business Transaction Events Settings Process Function Modules of an SAP Appl.
18. Hit enter past the warning messages that this is SAP data.
19. Click on the New Entries button.
20. Enter the process for your interface. In your example it is 00001130.
21. Enter the country the interface is valid for. If it is valid for all countries, leave this field blank.
22. Enter the application the interface should be called for. If it should be called for all applications, leave this field blank. Please note that not all integrated transactions are programmed to go through these interfaces! You will need to test to find out!
23. Enter the new "Z" function module
24. Save the settings. At this point you will be prompted for a CTS number for the configuration change.
25. The Business Transaction Event is complete! You are ready for testing 

相关TCODE:

BERP
FIBF

相关连接:
http://help.sap.com/saphelp_erp2005/helpdata/en/3b/7f3e8be57c11d1951f0000e82dec10/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ad/fc5a4064b4ef6fe10000000a1550b0/frameset.htm
Example:http://fuller.mit.edu/user_exits/business_transaction_event.htm
http://www.workflowbook.com/TransactionIndex.pdf

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 宝宝发高烧怎么办能快速退烧 屁股上长了纹路怎么办 手机充电头歪了怎么办 屁股挠烂了化脓怎么办 手机充电那坏了怎么办 孩子在学校被老师冤枉怎么办 初中学校不好我该怎么办 天气太热屁股淹了怎么办 骑车骑的屁股疼怎么办 爬山时屁股摔紫青了怎么办 宝宝不肯脱裤子拉粑粑怎么办 国家对无地农民怎么办 生完孩子骨架变大怎么办 17岁长高很慢怎么办? 出月子腿着凉了怎么办 脚着凉了脚疼怎么办 腿着凉了特别疼怎么办 孩子骨龄大2两年怎么办 和人吃饭很尴尬怎么办 头不自觉向右偏怎么办 靠墙站立腰疼怎么办 小腿酸痛乏力肌肉萎缩怎么办 搬重物后手臂疼怎么办 和尚鹦鹉吃了盐怎么办 刚买鹦鹉不上手怎么办 word的文件时间改了怎么办 图强gps编码丢失怎么办 武统台湾后岛民怎么办 没有你我怎么办是什么歌 ios 12软件闪退怎么办 来大姨妈想吐怎么办 3岁宝宝体重轻怎么办 硕士延期毕业考上博士怎么办 中国人移民欧洲饮食不习惯怎么办 出车祸了报警警察不管怎么办 高中的孩子不好好上学怎么办 和老公消费观念不合拍怎么办 去医院没带现金怎么办 微信读书下架了怎么办 24岁血压有点高怎么办 吃鸡鼠标弹出来怎么办