Enhancement Framework的目的:在不改变(或尽量少改变)SAP标准程序的情况下满足客户的定制开发需求。Keep less Modification.
Enhancement Framework的基本概念:
Ehancement Spot: 用来组织Enhancement options,it's a container of Enhancement options.
Enhancement Implementation:用来组织Enhancement options的实现代码。
Implicit and Explict Enhancement:隐式和显式增强
隐式增强就是系统内置的Enhancement options,有一点AOP的味道,但只能针对单个对象。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-POINT Syntax:
ENHANCEMENT-POINT enh_id SPOTS spot1 spot2 ...
ENHANCEMENT-SECTION ,用例替换原有的功能代码,ENHANCEMENT-SECTION 和 END-ENHANCEMENT-SECTION.之间有代码, implementation 之后,替换旧代码,只执行新代码,原来的代码不再执行.
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-SECTION Syntax:
ENHANCEMENT-SECTION enh_id SPOTS spot1 spot2 ...
END-ENHANCEMENT-SECTION.