在不改变(或尽量少改变Keep less Modification)SAP标准程序的情况下满足客户的定制开发需求。在SAP NETWEAVER中,所有的增强技术或者思想,都被完美集成到一个架构里面,这个架构就是Enhancement Framework。
Enhancement Framework的基本概念:
Ehancement Spot:it's a container of Enhancement options.
Enhancement spot是对Enhancement的一个管理平台,Enhancement技术与BADI是有区别的首先BADI是SAP预留的类的接口而Enhancement则是允许用户对现有的SAP代码进行修改。例如插入、替换。只要符合一定的规则即可,不需要SAP预先定义好
隐式增强就是系统内置的Enhancement options,只能针对单个对象。Implicit enhancements comprise class enhancements, function group enhancements and predefined enhancement points at particular predefined positions such as the end of a report, a function module, an include or a structure and the beginning and the end of a method.
显式增强就是我们人工加入到程序中的Enhancement options,有两种:
ENHANCEMENT-POINT:Defines a position in an ABAP program as an enhancement option, at which one or more source code plug-ins can be inserted.
ENHANCEMENT-SECTION:Defines a section of an ABAP program as an enhancement option, which can can be replaced by one or more source code plug-ins.
Enhancement Framework的基本概念:
Enhancement spot是对Enhancement的一个管理平台,Enhancement技术与BADI是有区别的首先BADI是SAP预留的类的接口而Enhancement则是允许用户对现有的SAP代码进行修改。例如插入、替换。只要符合一定的规则即可,不需要SAP预先定义好
ENHANCEMENT-POINT:Defines a position in an ABAP program as an enhancement option, at which one or more source code plug-ins can be inserted.
ENHANCEMENT-SECTION:Defines a section of an ABAP program as an enhancement option, which can can be replaced by one or more source code plug-ins.
下面我们就讲讲显式增强中的Enhancement point和Enhancement section
se38新建程序
Enhancement Operations -> Create Option
1、先讲Enhancement point:
新建Enhancement Sport和Package:$TMP表示保存在本地,如要发布传输,新建一个Package即可
这里是定义了一个增强point,然后对他实施implementation,需要切换到增强实施状态
输入Enhancement implementation名称和描述,回车
一个Enhancement point,可以多次实施,我们再次implementation
代码增强的注意点:
2、再讲Enhancement section:
Enhancement Operations -> Create Option,在程序编辑状态下,新增Enhancement section的定义
实施可以通过菜单,但是有的系统可能菜单中没有,此处可能是系统配置的原因吧,但是我们还可以通过右键进行创建实施
3、执行程序,查看结果
Enhancement point和Enhancement section的区别: