SAP开发SD相关的增强BADI

上传人:yh****1 文档编号:300790357 上传时间:2022-05-30 格式:DOC 页数:101 大小:1.37MB
返回 下载 相关 举报
SAP开发SD相关的增强BADI_第1页
第1页 / 共101页
SAP开发SD相关的增强BADI_第2页
第2页 / 共101页
SAP开发SD相关的增强BADI_第3页
第3页 / 共101页
SAP开发SD相关的增强BADI_第4页
第4页 / 共101页
SAP开发SD相关的增强BADI_第5页
第5页 / 共101页
点击查看更多>>
资源描述

《SAP开发SD相关的增强BADI》由会员分享,可在线阅读,更多相关《SAP开发SD相关的增强BADI(101页珍藏版)》请在金锄头文库上搜索。

1、-SD相关的BADIHU_BADIBusiness Add-Ins for Handling UnitsLE_SHP_BADIBusiness Add-Ins in ShippingLE_TRA_BADIBusiness Add-Ins in TransportationLE_WM_BADIBusiness Add-Ins in Warehouse ManagementMRM_BADIBusiness Add-Ins in Invoice VerificationPL_PACKINST_BADIBusiness Add-In in the Packing InstructionS_BADI_F

2、ORMULA_BUILDERBADI Implementation with Formula BuilderVA_BADIBADIs R/3 SalesVF_BADIBAdIs for Billingsap的用户出口总共有三代:1、第一代sap提供一个空代码的子过程,在这个子过程中用户可以添加自己的代码,控制自己的需求。这类增强都需要修改sap的标准代码。例如:USERE*IT. in SAPMV45A2、第二代sap提供的是CUSTOMER-FUNCTION,它是通过SMOD和CMOD完成实现。参见我的3、第三代sap提供的第三代的用户出口就是BADI,他的调用方式是CALL METHOD

3、(instance),相关的TCODE是SE18和SE19,你可以通过E*IT_HANDLER这个单词查找BADI。另外还有一种出口叫BTE相关TCODE: FIBFBusiness 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 inter

4、face 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 implementa

5、tions 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 F

6、I 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), wh

7、ereas 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.如何使用SMOD和CMOD进展SD的用户增强1、关于增强的简单介绍1.1SMOD包含具体的增强,而CMOD是包含一组SMOD编写的增强. 1

8、.2 User e*its (Function module e*its)是sap提供出口,它的命名规则如下: E*IT_ 例如:sd的VA01事务,对应的程序是SAPMV45A ,你会在程序里查到用CALL CUSTOMER-FUNCTION字符串如下代码:CALL CUSTOMER-FUNCTION 003 e*porting *vbak = vbak *vbuk = vbuk *komk = tkomk importing lvf_subrc = lvf_subrc tables *vbfa = *vbfa *vbap = *vbap *vbup = *vbup. 则e*it calls

9、 function module的名称就是: E*IT_SAPMV45A_003 2、先试用SMOD建立一个SAP增强2.1、选择一个增强,如:SDVF*001,点击修改,进入sap增强维护屏幕;2.2、点击组件按钮,进入组件维护屏;2.3、将光标移到功能模块名,输入模块名,如:E*IT_SAPLV60B_001;2.4、选择代码修改按钮进入函数模块;2.5、双击函数模块的包含单元,进入包含单元参加自定义代码并激活保存;3、使用CMOD建立增强工程3.1、输入自定义的工程名,点击创立;3.2、进入增强工程,选择配置增强,进入增强配置屏幕;3.3、输入增强名如:SDVF*0013.4、保存,并退

10、出;4、使用CMOD将增强工程激活,便大工告成。如何查找*判断是否存在相应增强的定义(SMOD) select single name from modsapa into mod0-name where name = PPCO0002. if sy-subrc = 0. endif. select single * from tadir into ps_tadir_db where pgmid = R3TR and object = SMOD and obj_name = PPCO0002.*判断是否存在相应增强工程的定义(CMOD) SELECT SINGLE name FROM MODAT

11、TR into mod0-name WHERE NAME = PPCO0002.*提取增强的定义的组件 (可以用此反查增强定义) select * from modsap where name = PPCO0002.*判断该增强是否移植到BADI实现*Enhancement & has already been migrated in Business Add-In definition select single migrated badi_def into (migrated, e*it_name) from modsapa where name = modname. if sy-subr

12、c = 0 and migrated = see*_true. message s621 with modname e*it_name. check mode ne CHAM. endif.MODTYP 类型:E : 功能退出S : 屏幕T : 表C : GUI代码sap增强存在MODSAP表内*获取增强组件的参见函数MOD_SAP_MEMBER_TE*T*获得退出功能模块的信息 select single * from tftit where SPRAS = 1 AND FUNCNAME = E*IT_SAPLCORE_001 if sy-subrc = 0. endif.*值得学习的函数M

13、OD_KUN_ACTIVATE(会操作相关报表)如何从SAP中查找BADIBADI作为SAP的第三代用户出口,他的应用也越来越广泛,但如何找到适宜的badi是许多abap程序员的困惑。我这里就介绍一下我个人的应用的经历,供大家参考。1、badi对象的信息存储在S*S_INTER, S*C_E*IT, S*C_CLASS 和S*C_ATTR这四个表中参见SECE包;2、sap程序都会调用cl_e*ithandler=get_instance来判断对象是否存在,并返回实例;其实get_instance就是对上述几个表和他们的视图V_E*T_IMP和 V_E*T_ACT进展查询和搜索。3、基于这个机

14、理,我查用ST05来监控一个TCODE来跟踪,然后选择查找有关上述几个表和视图的操作,就可获得相关BADI。4、se18 查找接口,se19 实现接口就可以实现用户增强。例如:用LE_SHP_DELIVERY_PROC控制跨月CancelMETHOD IF_E*_LE_SHP_DELIVERY_PROCCHANGE_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_*likp into wa_likp.check IS_V50AGL-WARENAUSG_STORNO =*.-代表作GI cancelif wa_likp-WADAT_IST+4(2) thismonth.wa_log-VBELN = cs_likp-vbeln.wa_log-MS

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 教育/培训

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号