源代码增强的一点说明(souce code enhance )

souce code enhance 分为显式和隐式两种。

下面以显式创建为例子:

1、在ABAP编辑器中, 打开想要编辑的程序,切换到可编辑模式

2、在源代码中的指定位置右键,弹出菜单,选择 Enhancements #Create Option

此处说明一下:你需要进入Utilities》设置》ABAP Editor 中,将downwards-comp.Line Lngth(72)的复选框取消勾选,否则在创建源代码增强的的时候,会提示消息creating of enhancements supported only for line length > 72 。

3、在弹出的对话框中,选择ENHANCEMENT-POINT(增强点) 或ENHANCEMENT-SECTION(增强部分),然后在后面填写名称,如'ZEH1'

4、选择有条件调用还是无条件调用。

对于有条件调用和无条件调用的说明:

  • As an unconditional call (the enhancement option then receives in the source code the addition "STATIC"):
    In such "static" enhancements, data declarations - for example - can be added or replaced. The call of enhancements is independent of the client - the choice of a "static" call should therefore be carefully thought out beforehand.
  • As a conditional call:
    The enhancements implemented here are "dynamic" - that is, they are called in connection with the switch settings.

5、创建增强点,并填入增强点名称,如'ZSP1',描述,pakage,如果有请求号,需要将请求号填入,还有开发类等

说明:一个增强点名称下,可以分配多个增强点,既,这里可以创建多个增强点。

6、选择右下角的对号,回到abap编辑器中,你会发现光标位置出现类似如下代码ENHANCEMENT-POINT ZEH1 SPOTS ZSP1 ZSP2 .

 需要说明的时候,在创建的时候,注意命名的问题,需要以字符Z或Y开头

posted @ 2020-11-05 17:13  荒野游侠  阅读(150)  评论(0编辑  收藏  举报