ENHANCEMENT-SECTION enh_id SPOTS spot1 spot2 ...
These statements turn a section of the current program into an explicit enhancement point, as a result of which the section can be replaced by a source code enhancement. When the program is generated, exactly one source code plug-in of the assigned enhancement implementation, whose switch has the state stand-by or on, replaces this program section. If no switch is assigned to a source code plug-in, it is handled as if the switch has the state on.
If the addition
STATIC is not specified, the source code enhancement is dynamic. In a dynamic source code enhancement,
declarative statements are not replaced. Instead,
the declarative statements of the source code plug-in are added to the declarative statements in the program section. Furthermore, only source code plug-ins whose
switches have the state on are respected by dynamic source code enhancements when a program is executed.
enh_id requires an ID for the enhancement point to be specified directly; this ID must be unique without the addition
INCLUDE BOUND in the current
compilation unit and it must be unique with this addition in the current include program. At least one
enhancement spot must
be assigned to the enhancement point by specifying the values
spot2, and so on, as
simple enhancement spots.
One or more source code plug-ins can be created for a single enhancement point. A source code plug-in is created by assigning an
enhancement implementation for the element definition in
This creates a source code plug-in with a unique ID automatically, which is displayed after
in the editor. Initially, the plug-in contains the code to be replaced between
the code can be overwritten there. A source code plug-in is assigned to exactly one enhancement option.
Multiple source code plug-ins of multiple enhancement implementations can be assigned to one enhancement option. If multiple source code plug-ins with the switch position on or stand-by are found when the program is executed, a conflict resolution is performed internally and the conflict resolving enhancement implementation that takes precedence is used. If more than one conflict resolving enhancement implementation takes precedence, or there is no conflict resolving enhancement implementation, the conflict cannot be resolved correctly. Instead, one of the primary conflict resolving enhancement implementations or one of the conflict resolving enhancement implementations is used. Exactly which implementation is used is the same for each program execution, but is otherwise undefined.
In the terminology of the
enhancement concept, the section between
END-ENHANCEMENT-SECTIONis both the enhancement spot element definition and the enhancement spot element invocation of the enhancement point.
ENHANCEMENT-SECTIONcan either be entered directly or created after a block of lines is selected by choosing Enhancements → Create Enhancement in Enhancement Builder. After the program has been saved or created by choosing Enhancements → Create Enhancement, the statement can only be deleted by choosing Enhancements → Delete Enhancement.
END-ENHANCEMENT-SECTIONcan also be included in a source code plug-in.
STATIC is used to define a static source code enhancement. The declarative statements of a source code plug-in are not added, but replace the ones from the program section.
In a static source code enhancement, all incorporated source code plug-ins are respected when the program is executed, including those whose switch has the state stand-by.
Unlike the statement
STATIC of the statement
should only be used with maximum caution when changing data declarations. This is because a replacement
is being done, not an enhancement. Application developers at SAP in particular should not use the addition
STATIC at all with
ENHANCEMENT-SECTION since the change will be active in the entire customer system.
... INCLUDE BOUND
This addition has the same effect as it does for the statement