|
资源链接:http://bbs.sapclub.cc/thread-518-1-1.html
在不改变(或尽量少改变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 Implementation:用来实现Enhancement options。
-
Implicit and Explict Enhancement:隐式和显式增强
- 隐式增强就是系统内置的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 point和Enhancement section
se38新建程序 <ignore_js_op> Enhancement Operations -> Create Option
1、先讲Enhancement point: <ignore_js_op> 新建Enhancement Sport和Package:$TMP表示保存在本地,如要发布传输,新建一个Package即可 <ignore_js_op> 这里是定义了一个增强point,然后对他实施implementation,需要切换到增强实施状态 <ignore_js_op> 输入Enhancement implementation名称和描述,回车
一个Enhancement point,可以多次实施,我们再次implementation <ignore_js_op> <ignore_js_op> 代码增强的注意点:
2、再讲Enhancement section: <ignore_js_op> Enhancement Operations -> Create Option,在程序编辑状态下,新增Enhancement section的定义 <ignore_js_op> 实施可以通过菜单,但是有的系统可能菜单中没有,此处可能是系统配置的原因吧,但是我们还可以通过右键进行创建实施 <ignore_js_op>
3、执行程序,查看结果 <ignore_js_op> Enhancement point和Enhancement section的区别:
- Enhancement-point 定义时只有一个预留点,允许在这个位置implementation
- Enhancement-section可以在定义时就code初始化代码,而他的implementation之后,新的implementation中的代码就会替换定义段中的代码
- Enhancement-point 是提高原来代码, 而Enhancement-section 是可以替换原来程序中的代码。
|