SAP enhancement article 5 of the 5th generation Enhanced (transferred from SAP Shoko)

Preface:

SAP ABAP, SAP standard enhancement is the expansion of the program functions. For example, when something new code ME21N PO,
when you save a specific need to do some checking, you need to use this time to enhance:
[] ME_PROCESS_PO_CUSE
SAP system has given us a lot of good pre-enhancement, we only need to write to these enhancements in Code on the line.

 

The following personal understanding, under rough introduction:

SAP has enhanced in accordance with the history, the main four categories: 

  • 1. The first generation (based on the enhanced source code) is SAP provides a sub-process code empty,
    now used for SD sales order module enhancements: SAPMV45A program, as well as PP module (learning)

 

This sub-process, the user can add their own code to control their own needs.
Such enhancements need to modify standard code for sap, which when released are empty,
focused on the penultimate character file name that contains the program of Z,
because the standard procedure, so:
Global (1) program data can be used.
Weaknesses: will be overwritten by the new version of the system upgrade;

This source code enhancement and reinforcement screen described
from Tcode:
find path related background configuration module's SPRO;
generally starts UserExit_ submodules.

Such enhancements to the service marketplace prior to the application object keys (Access key),
then you can modify this routine.
When used in such more enhanced SD module, such as creating SO (VA01).

  • 2. Second Generation enhancement (enhancement function based on the module), a maintenance SMOD and CMOD

In SAP releases, use the Call customer-function 'xxx' call the function module,
so you can search in the program
to find the second-generation enhanced cusomer-function,
the second-generation enhancement function name constitutes: EXIT_ program name _'xxx ',
so you can find the corresponding enhancement function module, and a code when they only released
include' xxx '
need not be like the first generation, like the need to enhance ACCESS key to modify the time, simply double-click enter on it.

Enhanced second generation is a subroutine, include or ???
only parameters passed in the interface.

The second-generation enhanced mainly the following categories:
1) E Enhancement exits:.
These export to Exit_ begin with, you can go to the SE37 view,
you can also check the function Exit_ beginning in the table TFDIR in

2) C. Gui codes, (GUI enhancements)

3) S. Subscreen (Screen Enhancement)

4) T. Include structure table / structural reinforcement,

SAP Extended (Enhanced table) MODSAP, which records all smod enhancements,
this table important field
NAME X enhanced name
TYP X component type
MEMBER X enhanced

TFDIR list of functions
important fields:
funcName (function name),
MAND (function module is activated if the C status on behalf of this function module is activated).

Have been asked this question CMOD and SMOD difference: the hope and to share

Were once practiced with CMOD, SMOD can see the implementation of components

 

  • 3.第三代增强(基于面向对象概念的增强 BADI-[ business add-in ]),使用SE18管理,SE19实施,

(1)SAP保证所有BADI的向上兼容性。版本升级不影响标准系统中增强的调用,也不会影响调用接口的有效性。你不必在SSCR中注册BADI。
(2)只能使用一次实施,增强功能可以同时被任意数量的客户激活。?
BADI可根据过滤器的值定义。这使您可以根据特定的标准来控制实施(例如:按照在特定国家)。
(3)BADI包含了所有必要实现特定任务的接口。?

 

源代码发布以接口方式,通过接口的方法调用来实现使用。
自定义增强实际上是实现一个或者多个基于这个接口的实现类,
因为-接口类实际上是一个抽象类,所以- 对于同一个增强会出现不同的源代码,
这些不同的源代码通过 过滤器(adapter) 来区分不同的 业务场景。

Tcode:SE18, SE19 来实现,

***BADI 的查找方法:
1)BADI 对象的信息存储在
SXS_INTER,
SXC_EXIT,
SXC_CLASS,
SXC_ATTR 这四个表

其中 SXC_ATTR 【Exit: Implementationsseite: Attribute】可以找到自建BADI,
IMP_NAME CHAR 20 0 业务加载项实施
VERSION CHAR 6 0 版本号
ACTIVE CHAR 1 0 客户增强激活
MST_LANG LANG 1 0 语言代码
ANAME CHAR 12 0 最后修改人
ADATE DATS 8 0 日期
ATIME TIMS 6 0 时间
UNAME CHAR 12 0 最后修改人
UDATE DATS 8 0 日期
UTIME TIMS 6 0 时间
LAYER CHAR 80 0 业务加载项管理的层值
MIG_ENHNAME CHAR 30 0


2)SAP BADI 程序都会调用
cl_exithandler=>get_instance 来判断对象是否存在,并返回实例,
**我们可以在这个方法处设置断点,获取实例。
这个方法实际是对上面四张表和视图 V_EXT_IMP 和V_EXT_ACT 进行检索,

3)它的调用方式是call method(instance), 可以通过exit_handler关键词来查找。

4)ST05选择“table buffer trace”而不是常用的"SQLtrace",
查找上面的几个表和视图找到对应的BADI.

5)se18 查找接口,se19 实现接口就可以实现用户增强

 

  • 4.第四代是第三代的加强switch Framework

  • SAP 进入NewWeaver 7.0后 推出的新增强体系,将BADI 改名叫新BADI。
    还新增了 Enhancement spot 和Enhancement section 以及隐式增强点的概念,
    基本在面向对象的程序里实现处处可以增强,
    这类增强一般
    可以加在一个函数过程的开头和结尾的地方。

  • ***隐式增强:
    1)寻找隐式增强方法:
    使用debug 方式,跟踪业务处理过程,记下经过的 程序,子程序,函数名,
    最好是在标准业务结束前的最后环节,去确认是否有可用的隐士增强点。

  • 如有,实施步骤:
    (1)使用轮回眼圈圈:增强menu,

  • (2)菜单:编辑-》增强操作-》显示隐式增强选项;

  • (3)代码框行号前有箭头的表明有隐式增强点,可以创建,
    操作隐式增强点 4个menu:
    创建,更改,替代,撤销,(所以隐式增强没有删除,是使用标准撤销)

     (4)创建实施,声明代码;

Guess you like

Origin www.cnblogs.com/BruceKing/p/12132586.html