<3 digit suffix> 示例:sd的VA01事务,对应的程序是SAPMV45A ,你会在程序里查到(用CALL CUSTOMER-FUNCTION字符串)如下代码: CALL CUSTOMER-FUNCTION '003' exporting
xvbak = vbak xvbuk = vbuk xkomk = tkomk importing
lvf_subrc = lvf_subrc tables
xvbfa = xvbfa xvbap = xvbap xvbup = xvbup.
则exit calls function module的名称就是: EXIT_SAPMV45A_003 2、先试用SMOD建立一个SAP增强
2.1、选择一个增强,如:SDVFX001 ,点击修改,进入sap增强维护屏幕; 2.2、点击“组件”按钮,进入组件维护屏;
2.3、将光标移到“功能模块名”,输入模块名,如:EXIT_SAPLV60B_001; 2.4、选择“代码修改”按钮进入函数模块;
2.5、双击函数模块的包含单元,进入包含单元加入自定义代码并激活保存。 3、使用CMOD建立增强项目
3.1、输入自定义的项目名,点击“创建”;
3.2、进入增强项目,选择“配置增强”,进入增强配置屏幕;
3.3、输入增强名如:SDVFX001 3.4、保存,并退出;
4、使用CMOD将增强项目激活,便大工告成。 Business Transaction Events (Open FI)
The Open FI enhancement technique was developed in the Financial
Accounting component. Open FI is based upon the following principles: Application developers must define their interface in a function module, an assignment table is read in the accompanying (generated) code, and the customer modules assigned are called dynamically.
This technique differentiates between enhancements that are only allowed to have one implementation and enhancements that can call multiple implementations in any sequence desired. Both industry-specific and country-specific enhancements may be defined.
The concepts behind the Business Add-Ins enhancement technique and Open FI are basically the same. However, the two enhancement techniques do differ from each other in the following points:
Open FI can only be used to make program enhancements, that is, you can only enhance source code using Open FI. You cannot enhance user interface elements with Open FI like you can with Business Add-Ins.
Open FI assumes that enhancement will only take place on three levels (SAP - partners - customers), whereas with Business Add-Ins you can create and implement enhancements in as many software layers as you like.
Open FI uses function modules for program enhancements. With
Business Add-Ins, ABAP Objects is used to enhance programs.
BADI的查找
1、badi对象的信息存储在SXS_INTER, SXC_EXIT, SXC_CLASS 和SXC_ATTR 这四个表中(参见SECE包);
2、sap程序都会调用cl_exithandler=>get_instance来判断对象是否存在,并返回实例;其实get_instance就是对上述几个表和他们的视图(V_EXT_IMP 和 V_EXT_ACT)进行查询和搜索。
3、基于这个机理,我查用ST05来监控一个TCODE来跟踪,然后选择查找有关上述几个表和视图的操作,就可获得相关BADI。
4、se18 查找接口,se19 实现接口就可以实现用户增强。 示例:用LE_SHP_DELIVERY_PROC控制跨月Cancel
METHOD IF_EX_LE_SHP_DELIVERY_PROC~CHANGE_DELIVERY_HEADER . data : thismonth(2) type c.
data : wa_likp type line of SHP_LIKP_T.
data : wa_log type line of SHP_BADI_ERROR_LOG_T. clear ct_log[],thismonth.
thismonth = sy-datum+4(2). \"----->這一個月的月份 loop at it_xlikp into wa_likp.
check IS_V50AGL-WARENAUSG_STORNO ='X'.\"--->代表作GI cancel if wa_likp-WADAT_IST+4(2) < thismonth. wa_log-VBELN = cs_likp-vbeln. wa_log-MSGTY = 'E'. \"錯誤訊息
wa_log-MSGID = 'ZDN_ERROR'. \"這一個class要自己建 wa_log-MSGNO = '001'.
append wa_log to ct_log. \"Error log寫入 endif. endloop. ENDMETHOD.
HU_BADI LE_SHP_BADI LE_TRA_BADI LE_WM_BADI MRM_BADI PL_PACKINST_BADI S_BADI_FORMULA_BUILDER VA_BADI VF_BADI Business Add-Ins for Handling Units Business Add-Ins in Shipping Business Add-Ins in Transportation Business Add-Ins in Warehouse Management Business Add-Ins in Invoice Verification Business Add-In in the Packing Instruction BADI Implementation with Formula Builder BADIs R/3 Sales BAdIs for Billing