您的位置:首页 > 其它

[ZT]How to search for BADIs,如何查找BADI

2007-11-13 16:56 609 查看
如何查找BAdi

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3480

1、打开运行事务码: ST05 选择“table buffer trace”而不是常用的"SQL trace"

2、activate trace

3、运行事务码:BP

4、创建一个BP,保存

5、deactivate trace

6、点击display trace,在出来的选择条件中: objects中输入:V_EXT_IMP和V_EXT_ACT;在operations中输入“OPEN”

7、查询

Introduction

There are multiple ways of searching for BAdIs. My favorite one is using the Performance Trace (formerly known as SQL trace) transaction code ST05.

This analyzing technique is based on the fact that all BAdIs are registrated in SAP database tables. So for each BAdI call these database tables will be accessed. The BAdI database tables are SXS_INTER, SXC_EXIT, SXC_CLASS and SXC_ATTR. These tables are always accessed by the views V_EXT_IMP and V_EXT_ACT. So these two ABAP views (T: SE11) will be the basis for the trace.

This blog will not describe how to implement BAdIs. See http://help.sap.com/ for more information on implementing a BAdI.

The procedure to discover BAdIs by a Performance Trace will be explained by using the example used below.

Example case

I want to know which BAdIs are called in the transaction "Maintain Business Partners" transaction code BP.

Pre checks

Check if no other users (T:SM04) or batch jobs (T: SM50) are using the same user as you do.

Trace Actions

Start the Performance trace

Start transaction ST05 (Performance Analysis)
Set flag field "Buffer trace"
Remark: We need to trace also the buffer calls, because BAdI database tables are buffered. (especially view V_EXT_IMP and V_EXT_ACT)

Push button "Activate Trace"

Execute the Business transaction

Start transaction BP in a new GUI session
Push button "Organization"
Fill in your test data
NameNL4B
StreetOlympia
House number1a/1b
Postal code1213 NS
CityHilversum
CountryNL
Push button Save

Performance trace

Go back to the Performance trace session
Push button "Deactivate Trace"

Analyzing the Trace List

Showing the Trace List

Push button "Display Trace"
The popup screen "Set Restrictions for Displaying Trace" appears

Now we are going to filter the trace on Objects: V_EXT_IMP and V_EXT_ACT.

Push button "Multiple selections" button behind field Objects
Fill: V_EXT_IMP and V_EXT_ACT



Push button "Copy (F8)"
Fill Operations: OPEN
Push button Enter

See the result:



Interpreting the Trace list

All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BAdI class interfaces. The BAdI name is after the IF_EX_.

So the BAdI name of IF_EX_ADDR_LANGU_TO_VERS is ADDR_LANGU_TO_VERS.

In transaction SE18 you can see the BAdI definition.



(If you can’t find the BAdI definition name, search in table SXS_INTER.)

Exporting the Trace list

If you’d like to keep your analysis, you can export it to Excel file format.

Actually the file will be saved in tab separated file format, but giving the file the extension .xls it will automatically be opened by Excel.

Start menu: List > Save > Local File
Select Spreadsheet
Push Enter
Fill your preferred file location and file name



Push button "Generate"
Open the file (in Excel)



Delete the columns and rows you don’t need and the result looks like:



View V_EXT_IMP and V_EXT_ACT

The reason for filtering the result not only on the view V_EXT_IMP but also on V_EXT_ACT is necessary, because not all BAdIs are implemented in the same way.

For example:

V_EXT_IMP catches BAdI BPTIME_BP001.

V_EXT_ACT catches BAdI ADDRESS_SEARCH

Tips

Make a full test entry in the Business transaction before starting the Performance analysis.

So during the Performance trace you won’t make mistakes. Making mistakes during the recording will cause extra trace lines in your trace list.
Try to start with an empty Business transaction screen.

This tip is best explained by an example.

When I restart transaction BP after I have created, displayed or changed a business partner, the last opened business partner will be displayed automatically. This means also I will get extra trace lines in my trace list.

To start again with an empty business partner screen you have to close all GUI sessions and login again.
In the Business transaction you need to fill all required fields so all BAdIs will be called.

Appendix BP analysis

ViewCallBAdI
V_EXT_ACTR 20 ADDR_LANGU_TO_VERSADDR_LANGU_TO_VERS
V_EXT_IMPR 30 IF_EX_ADDR_LANGU_TO_VERSADDR_LANGU_TO_VERS
V_EXT_ACTR 20 BUPR_FILTER_RELTYPBUPR_FILTER_RELTYP
V_EXT_IMPR 30 IF_EX_BUPR_FILTER_RELTYPBUPR_FILTER_RELTYP
V_EXT_ACTR 20 BUPR_FILTER_RELTYPBUPR_FILTER_RELTYP
V_EXT_IMPR 30 IF_EX_BUPR_FILTER_RELTYPBUPR_FILTER_RELTYP
V_EXT_ACTR 20 BUPR_FILTER_RELSHPBUPR_FILTER_RELSHP
V_EXT_ACTR 20 BUPA_AUGRPBUPA_AUGRP
V_EXT_IMPR 30 IF_EX_BUPA_AUGRPBUPA_AUGRP
V_EXT_IMPR 30 IF_EX_BPTIME_BP001BPTIME_BP001
V_EXT_ACTR 20 ADDRESS_SUBSCREENADDRESS_SUBSCREEN
V_EXT_ACTR 20 ADDRESS_SEARCHADDRESS_SEARCH
V_EXT_IMPR 30 IF_EX_ADDRESS_SUBSCREENADDRESS_SUBSCREEN
V_EXT_IMPR 30 IF_EX_ADDRESS_SUBSCREENADDRESS_SUBSCREEN
V_EXT_IMPR 30 IF_EX_ADDRESS_SUBSCREENADDRESS_SUBSCREEN
V_EXT_IMPR 30 IF_EX_ADDRESS_SUBSCREENADDRESS_SUBSCREEN
V_EXT_ACTR 20 ADDRESS_SEARCHADDRESS_SEARCH
V_EXT_ACTR 20 ADDRESS_CHECKADDRESS_CHECK
V_EXT_ACTR 20 ADDRESS_CHECKADDRESS_CHECK
V_EXT_ACTR 20 ADDR_TXJCD_CHECKADDR_TXJCD_CHECK
V_EXT_ACTR 20 ADDRESS_CHECKADDRESS_CHECK
V_EXT_ACTR 20 ADDR_PRINTFORM_SHORTADDR_PRINTFORM_SHORT
V_EXT_IMPR 30 IF_EX_ADDR_PRINTFORM_SHORTADDR_PRINTFORM_SHORT
V_EXT_ACTR 20 BUPA_ROLE_EXPORTBUPA_ROLE_EXPORT
V_EXT_IMPR 30 IF_EX_BUPA_ROLE_EXPORTBUPA_ROLE_EXPORT
V_EXT_ACTR 20 BUPA_BANK_EXPORTBUPA_BANK_EXPORT
V_EXT_IMPR 30 IF_EX_BUPA_BANK_EXPORTBUPA_BANK_EXPORT
V_EXT_ACTR 20 BUPA_CCARD_EXPORTBUPA_CCARD_EXPORT
V_EXT_IMPR 30 IF_EX_BUPA_CCARD_EXPORTBUPA_CCARD_EXPORT
V_EXT_ACTR 20 BUPA_INDSEC_EXPORTBUPA_INDSEC_EXPORT
V_EXT_IMPR 30 IF_EX_BUPA_INDSEC_EXPORTBUPA_INDSEC_EXPORT
V_EXT_ACTR 20 BUPA_ADDR_EXPORTBUPA_ADDR_EXPORT
V_EXT_IMPR 30 IF_EX_BUPA_ADDR_EXPORTBUPA_ADDR_EXPORT
V_EXT_ACTR 20 BUPA_GENERAL_EXPORTBUPA_GENERAL_EXPORT
V_EXT_IMPR 30 IF_EX_BUPA_GENERAL_EXPORTBUPA_GENERAL_EXPORT
V_EXT_ACTR 20 BUPA_GENERAL_UPDATEBUPA_GENERAL_UPDATE
V_EXT_IMPR 110 IF_EX_BUPA_GENERAL_UPDATEBUPA_GENERAL_UPDATE
V_EXT_ACTR 20 BUPA_BANK_UPDATEBUPA_BANK_UPDATE
V_EXT_IMPR 110 IF_EX_BUPA_BANK_UPDATEBUPA_BANK_UPDATE
V_EXT_ACTR 20 BUPA_CARDS_UPDATEBUPA_CARDS_UPDATE
V_EXT_IMPR 30 IF_EX_BUPA_CARDS_UPDATEBUPA_CARDS_UPDATE
V_EXT_ACTR 20 BUPA_ROLES_UPDATEBUPA_ROLES_UPDATE
V_EXT_IMPR 30 IF_EX_BUPA_ROLES_UPDATEBUPA_ROLES_UPDATE
V_EXT_ACTR 20 BUPA_INDSEC_UPDATEBUPA_INDSEC_UPDATE
V_EXT_IMPR 30 IF_EX_BUPA_INDSEC_UPDATEBUPA_INDSEC_UPDATE
V_EXT_ACTR 20 BUPA_IDENT_UPDATEBUPA_IDENT_UPDATE
V_EXT_IMPR 30 IF_EX_BUPA_IDENT_UPDATEBUPA_IDENT_UPDATE
V_EXT_ACTR 20 ADDRESS_UPDATEADDRESS_UPDATE
V_EXT_IMPR 30 IF_EX_ADDRESS_UPDATEADDRESS_UPDATE
V_EXT_IMPR 30 IF_EX_ADDRESS_UPDATEADDRESS_UPDATE
V_EXT_ACTR 20 BUPA_ADDR_UPDATEBUPA_ADDR_UPDATE
V_EXT_IMPR 110 IF_EX_BUPA_ADDR_UPDATEBUPA_ADDR_UPDATE
V_EXT_ACTR 20 BUPA_TAX_UPDATEBUPA_TAX_UPDATE
V_EXT_IMPR 110 IF_EX_BUPA_TAX_UPDATEBUPA_TAX_UPDATE
V_EXT_ACTR 20 FSBP_BPID_UPDATEFSBP_BPID_UPDATE
V_EXT_IMPR 30 IF_EX_FSBP_BPID_UPDATEFSBP_BPID_UPDATE
V_EXT_IMPR 30 IF_EX_BPTIME_BP001BPTIME_BP001
V_EXT_ACTR 20 FSBP_BP001_UPDATEFSBP_BP001_UPDATE
V_EXT_IMPR 30 IF_EX_FSBP_BP001_UPDATEFSBP_BP001_UPDATE
V_EXT_IMPR 30 IF_EX_BPTIME_BUT021_FSBPTIME_BUT021_FS
V_EXT_ACTR 20 FSBP_BUT021_UPDATEFSBP_BUT021_UPDATE
V_EXT_IMPR 30 IF_EX_FSBP_BUT021_UPDATEFSBP_BUT021_UPDATE
V_EXT_ACTR 20 ADDRESS_SEARCHADDRESS_SEARCH
V_EXT_ACTR 20 PARTNER_UPDATEPARTNER_UPDATE
V_EXT_IMPR 30 IF_EX_PARTNER_UPDATEPARTNER_UPDATE
V_EXT_IMPR 30 IF_EX_PARTNER_UPDATEPARTNER_UPDATE
V_EXT_IMPR 30 IF_EX_BPTIME_BP001BPTIME_BP001
V_EXT_IMPR 30 IF_EX_BPTIME_BUT021_FSBPTIME_BUT021_FS
V_EXT_ACTR 20 GOS_SRV_SELECTGOS_SRV_SELECT
V_EXT_IMPR 30 IF_EX_GOS_SRV_SELECTGOS_SRV_SELECT
V_EXT_ACTR 20 ADDRESS_SEARCHADDRESS_SEARCH
Keywords: BAdI BAdIs BAdI’s Businesses Add In Business Add-In Business Add-Ins how to find BAdI’s

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐