您好,欢迎来到纷纭教育。
搜索
您的当前位置:首页SAP 增强出口概述

SAP 增强出口概述

来源:纷纭教育
SAP用户出口有几种:

第一种 是在系统预留的出口程序中插入自定义代码,Hard Code; 第二种 是使用功能组,借助TCode:CMOD和SMOD;

第三种 是传说中的BADI,是最新的技术。调用方式是CALL METHOD (instance),相关的TCODE是SE18和SE19,可以通过EXIT_HANDLER这个单词查找BADI; 第四种 是BTE,即Business Transaction Events (Open FI),好像专给财务用的;

第五种 是字段增强,过时的技术,效率很低,移植不便,但是有时候也不得不用它;

第六种 是屏幕增强,用来对付苛刻的用户,这一种和第二种稍有重叠。为实现某种客户功能,大部分的情形使用标准预留出来的接口即可实现,但是极端的时候我们可能不得不去更改标准程序。

如何使用SMOD和CMOD进行SD的用户增强 1、关于增强的简单介绍

1.1 SMOD包含具体的增强,而CMOD是包含一组SMOD编写的增强.

1.2 User exits (Function module exits)是sap提供出口,它的命名规则如下: EXIT_<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

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- fenyunshixun.cn 版权所有 湘ICP备2023022495号-9

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务