关于new enhancement sap源程序里也给我们留了很多。
以下例句point 、section、spot说明这些知识点。
1.不管是point还是section 都是基于spot的,spot相当于一个增强的容器。
2.point创建后没有代码只有一个预留点:
ENHANCEMENT-POINT ZENH_POINT01 SPOTS ZENH_SPOT01 .
需要去实现:可以实现多个
ENHANCEMENT 1 ZENHC_IMP01. "active version write ‘this is enhancement-point zenh_point01 implementation‘ . WRITE : /. ENDENHANCEMENT. ENHANCEMENT 1 ZENHC_IMP02. "active version write ‘this is enhancement-point zenh_point02 implementation‘. ENDENHANCEMENT.
3.section创建后是有代码的,代码在ENHANCEMENT-SECTION 和END-ENHANCEMENT-SECTION之间
ENHANCEMENT-SECTION ZENH_SECTION01 SPOTS ZENH_SPOT01 . WRITE /. WRITE ‘thsi is enchancement-section‘. WRITE /. END-ENHANCEMENT-SECTION.
如果需要实现时,创建实现代码会自动带出ENHANCEMENT-SECTION 和END-ENHANCEMENT-SECTION之间的代码然后做修改,这样就只执行实现的代码不执行原来的代码,可以创建多个实现,但是测试下来貌似只是执行第一个实现,这里面的话只会执行ZENHC_IMP01. 如果没有ZENHC_IMP01会执行ZENHC_IMP02,如果没有ZENHC_IMP01和ZENHC_IMP02的话会执行ZENHC_IMP03不会执行ZENHC_IMP04.
ENHANCEMENT 2 ZENHC_IMP01. "active version WRITE /. WRITE ‘thsi is enchancement-section ZENHC_IMP01‘. WRITE /. ENDENHANCEMENT. ENHANCEMENT 2 ZENHC_IMP02. "active version WRITE /. WRITE ‘thsi is enchancement-section ZENHC_IMP02‘. WRITE /. ENDENHANCEMENT. ENHANCEMENT 1 ZENHC_IMP03. "active version WRITE /. WRITE ‘thsi is enchancement-section ZENHC_IMP03‘. WRITE /. ENDENHANCEMENT. ENHANCEMENT 1 ZENHC_IMP04. "active version WRITE /. WRITE ‘thsi is enchancement-section ZENHC_IMP04 ‘. WRITE /. ENDENHANCEMENT.
下图表示创建定义point和sction的步骤,
创建增强实现如下图:
特别说明:创建的实现增强,可以在另外的point或者section中继续实现,如下图,zence_imp01在zenh_point01中实现过,在ZENH_SECTION01 中还可以继续实现,只不过
ID累加位2,如果在section中只会执行ID最高的实现。如果下面enchencement 2 zenhc_imp01 还有enchencement 2 zenhc_imp02 或者enchencement 1 zenhc_imp03,也只会执行enchencement 2 zenhc_imp01 。
ENHANCEMENT 1 ZENHC_IMP01. "active version write ‘this is enhancement-point zenh_point01 implementation‘ . WRITE : /. ENDENHANCEMENT.
ENHANCEMENT 2 ZENHC_IMP01. "active version WRITE /. WRITE ‘thsi is enchancement-section ZENHC_IMP01‘. WRITE /. ENDENHANCEMENT.
关于point和sction的static 测试下来没有发现特别的。