ENHANCEMENT-SECTION enh_id SPOTS spot1 spot2 ...
[STATIC]
[INCLUDE BOUND].
...
END-ENHANCEMENT-SECTION.
1. ... STATIC
2. ... INCLUDE BOUND
: These statements turn a section of the current program into an explicit enhancement option, as a result of which it can be replaced by a source code enhancement. When the program is generated, exactly one source code plug-in replaces the assigned enhancement implementation whose switch has the status stand-by or on. If no switch is assigned to a source code plug-in, it is treated as if the switch is in the status on.
If the addition STATIC is not specified, the source code enhancement is dynamic. At a dynamic source code enhancement, declarative statements are not replaced, but the declarative statements of the source code plug-in are added to the declarative statements in the program section. Furthermore, only the source code plug-ins are considered at a dynamic source code enhancement during program execution, whose switches are in the status on.
The program section must only contain complete control structures and processing blocks. If no suitable source code plug-in is found, the original section is executed.With enh_id, an ID for the enhancement option must be entered directly, which is unique without the addition INCLUDE BOUND in the current compilation unit and is unique with this addition in the current Include program. At least one enhancement spot must be assigned to the enhancement option by specifying the simple enhancement spots spot1, spot2, and so on.
One or more source code plug-ins can be created for an enhancement option. A source code plug-in is created by the assignment of an enhancement implementation for the element definition in the Enhancement Builder. This process automatically generates a source code plug-in with a unique ID, which is displayed in the Editor underneath the END-ENHANCEMENT-SECTION. Initially, the plug-in contains the coding to be replaced between ENHANCEMENT and ENDENHANCEMENT, which can be overwritten there. A source code plug-in is assigned to only one enhancement option.
Multiple source code plug-ins of an enhancement implementation and the source code plug-ins of more
than one enhancement implementation can be assigned to one enhancement option. If several source code
plug-ins are found when the program is executed with the switch position on or stand-by, a
conflict resolution is performed internally and the primary
conflict resolving enhancement implementation
is used. If there are several high priority conflict resolving enhancement implementations or if there
are none, then correct conflict resolution is not possible. Instead, one of the primary conflict resolving
enhancement implementations or one of the conflict resolving enhancement implementations is used. Exactly which one is used is the same for each program execution, but is otherwise undefined.
... STATIC
You use the addition STATIC to define a static source code enhancement. Only declarative statements are allowed in the program section to be replaced, as well as in the included source code plug-ins. The declarative statements of a source code plug-ins are not added, but replace the ones from the program section.
At a static source code enhancement, all included source code plug-ins are considered at program execution. This also includes the ones whose
switch is in status stand-by.
In contrast to the statement
ENHANCEMENT-POINT, the addition STATIC
of the statement ENHANCEMENT-SECTION can only be used
with maximum caution for changes of data declarations, because a replacement and no completion is carried
out. Especially application development within SAP should not use the addition
STATIC at all with ENHANCEMENT-SECTION as the change will be active in the entire customer system.
... INCLUDE BOUND
: This addition has the same effect as it does for the statement ENHANCEMENT-POINT.