Show TOC Start of Content Area

Background documentation Explicit Enhancement Options in ABAP Source Code  Locate the document in its SAP Library structure

Definition

In ABAP programs, you can select either a position or a program section as an explicit enhancement option. Source code plug-ins for an enhancement are either entered at such a position or they replace the selected section.

Note

An explicit enhancement option is part of the ABAP program. It is assigned to the package of the program and not to the package of the enhancement spot to which it belongs.

Activities

To create an explicit enhancement option in the ABAP source code, proceed as follows:

...

       1.      In the ABAP Editor, open the program you want to edit.

       2.      Switch to change mode.

       3.      In the source code, right click and choose Enhancements Create Option from the context menu.

The Create Enhancement Option dialog box appears.

       4.      Choose between ENHANCEMENT-POINT and ENHANCEMENT-SECTION and specify a name for the type of enhancement option you have selected.

       5.      Choose whether to include the enhancement option in the source code as a conditional or as an unconditional call. See the F1 help for more information.

       6.      Create a new enhancement spot where to store your new enhancement option or choose an existing spot.

       7.      Choose Enter.

Note

After the program has been saved, the enhancement option is managed by the Enhancement Builder, and can only be deleted using the function Enhancements Remove Enhancement from the context menu, while your cursor is positioned on the enhancement option.

Declaring Explicit Enhancement Options

A position in an ABAP program marked as an explicit enhancement option looks like that:

ENHANCEMENT-POINT <name> SPOTS <spot1> [<spot2>] [STATIC] ...

Note

The STATIC addition is intended for the enhancement of data declarations, while the statement ENHANCEMENT-POINT without the STATIC addition is designed for the enhancement of executable coding.

      Static enhancement statement – for example, additional data declaration

      Dynamic enhancement statement – for example, additional source code

A section in an ABAP program marked as an explicit enhancement option looks like that:

ENHANCEMENT-SECTION <name> SPOTS <spot1> [<spot2>] [STATIC]

...

END-ENHANCEMENT-SECTION.

      Static enhancement statement – for example, replace an existing data declaration

      Dynamic enhancement statement – for example, replace existing source code.

Note

In contrast to the statement ENHANCEMENT-POINT, the addition STATIC of the statement ENHANCEMENT-SECTIONcan only be used with maximum caution for changes of data declarations, because a replacement and no completion is carried out.

Data declarations are always static, even if they are inside a dynamic enhancement option. Form routines, methods, and local classes cannot be part of dynamic enhancement points and sections. You need to place them in static enhancement points or sections.

During program generation, the source code plug-ins that are in the current system for the assigned enhancement implementations and have the switch status stand-by or on, are included at this position or they replace the selected section.

 

 

End of Content Area