user exits, customer exits, badi
user exits, customer exits, badi?
Basic Concepts:1. User Exits: 是系統(tǒng)中預(yù)留的一些空的Form/Subroutine, 獲得Access key后可以在Form中寫入自己的邏輯.
2. Customer Exits :
a. FM Exits: 在FM中include 保留的 Z 程序來(lái)提供功能擴(kuò)展點(diǎn)
b. Menu Exits: 在GUI status中預(yù)留+Fcode menu item, 在程序中預(yù)留對(duì)應(yīng)的Handling FM Exits
c. Screen Exits: 在Screen 中預(yù)留 Subscreen, 在程序中預(yù)留transport data to subscreen & return / retrieve data from subscreen 的 FM Exits
3. Enhancement & Enhancement Project :
a. Enhancement: 把系統(tǒng)程序中的相關(guān)Customer Exits收集起來(lái)成為一個(gè)Enhancement, 一般情況是按功能和類型來(lái)收集的, 比方說幾個(gè)相關(guān)的FM eixts組成一個(gè)enhancemnet, 或就一個(gè) screen 或 menu exits 形成一個(gè)enhancement. 查看/修改 Enhancement的t-code為: SMOD
b. Enhancement Project: 在使用Enhacement時(shí), 要先建立一個(gè)Enhancement Project, 可以將多個(gè)Enhancement assign給一個(gè)enhancement project去管理, 對(duì)應(yīng)t-code: CMOD.
4. BADI (Business Add-in), 通過面向?qū)ο蟮姆绞絹?lái)提供擴(kuò)展點(diǎn),它支持Customer Exits所有的enhancement 類型,因目前Class中不能包含subscreen所以在用BADI enhance screen時(shí)比用Customer Exits要復(fù)雜些.相關(guān)機(jī)制請(qǐng)參考我以前的blog.
這里要提下的是非Multiple Case的BADI同時(shí)只能有一個(gè)Active Implementation, 即要Active新生成的需先inactive舊的. 若是Multiple Case的BADI則可同時(shí)有多個(gè)Active Implementation,且所有的Implementation在沒有Filter的情況下都會(huì)被遍歷執(zhí)行.
5. Other
User Exits與Customer Exits的區(qū)別在于User Exits的使用需要Access Key但Customer Exits不要.
FM exits在關(guān)聯(lián)的Function Group中的命名規(guī)則為: EXIT_program name_nnn
Customer exits的調(diào)用方式為:
a. FM Exits: CALL CUSTOMER-FUNCTION 'xxx' EXPORTING ... IMPORTING ...
b. Subscreen: Call CUSTOMER-SUBSCREEN INCLUDING
How to find user exits?
Using t-code: SE93 and specify the transaction code. from here goto the main program and click on the FIND button. Specify USEREXIT and select find in main program radio button and click search... if any user exit is used, it will list all the places as in SAP if any user exit is used, a comment is been written above the user exit.
How to find customer exits?
1. 通過一些專門的程序,見附件
2. Search string “call customer” in the main program source code;
3. SE80 -> Repository Infomation System -> Enhancements -> Customer Exits -> Input search condition -> Execute
4. SE11 -> Database table: MODSAPVIEW -> Display Contents -> Input "*program name*" into Enhancement field -> Execute -> 得到的SAP extension name 即為 Customer Exits Enhancement Name
How to find BADIs?
1. 通過一些專門的程序,見附件
2. Search string “type ref to” in the main program source code, then check if there is BAdi used in the program;
3. Set break-point in the method CL_EXITHANDLER=>GET_INSTANCE.
4. SE80 -> Repository Infomation System -> Enhancements -> Business Add-ins
Customer Exits and BADI implementation.
1. Customer Exits: SMOD, CMOD
2. BADI: SE18, SE19.
Attachment is an ABAP program which can find customer exits and BADIs conveniently.
How to find all the BADIs(including sap internal use): 1. Go to the TCode SE24 and enter CL_EXITHANDLER as object type.
2. In 'Display' mode, go to 'Methods' tab.
3. Double click the method 'Get Instance' to display it source code.
4. Set a breakpoint on 'CALL METHOD cl_exithandler => get_class_name_by_interface'.
5. Then run your transaction.
6. The screen will stop at this method.
7. Check the value of parameter 'EXIT_NAME'. It will show you the BADI for that transaction. 補(bǔ)充: 1. 如何能過customer exit name 找 enhancement?
通過表 MODSAP
2. 如果知道你要做的customer exit是否已經(jīng)有Project實(shí)現(xiàn)過了?
CMOD -> input customer name to "Enhancement component" field like "EXIT_SAPLRSAP_002" -> execute
總結(jié)
以上是生活随笔為你收集整理的user exits, customer exits, badi的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何增加SAP_ALL的权限
- 下一篇: 与variant有关的几个FUNCTIO