Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

SAP ABAP Enhancements There are various techniques which come under the

enhancement framework which are,


1. Source code enhancements (plug-ins)
2. Function group enhancements3. Class Enhancements4. Kernel-BADI
enhancements
Source Code Enhancement:
Source Code Enhancement is one of the enhancement technologies available
under Enhancement Framework. Implementing this technology is also called as
Source Code Plug-In. Technically the source code plug-in implementations are
stored in a separate include program and not as part of the original source
program.
Source code enhancements (plug-ins) allow us to directly enhance the standard
source code without any modifications in the source code. There are two possible
source code enhancements:
1. Implicit Source code enhancement option
2. Explicit Source code enhancement options
Implicit enhancements are predefined enhancements provided by SAP in the source
code, the
Explicit enhancements can be implemented by the customers or partners.
Enhancement Operations -> Show implicit Enhancement Options All Implicit Enhancement
Option will be displayed. All yellow lines indicate Implicit Enhancement options. In
ABAP programs, implicit enhancement options are predefined at the following
places:
• Begin/End of an include
• Begin/End of Method/Function Module/Form Routine
• End of a structure
• End of Private/Protected/Public Section of a local class
Note
- Explicit enhancements though can be placed anywhere in the source code but,
not just anywhere except some areas where SAP would allow (program allows).
In Explicit Enhancements there are more two ways of enhancing,
1. Enhancement point (Syntax - ENHANCEMENT-POINT)
2. Enhancement section (Syntax - ENHANCEMENT-SECTION)
Enhancement section is used to replace a set of code or statements with the
customer (custom code). In this technique the original source code does not get
executed but, the customer implementation (custom code) gets executed. The
following enhancement option types are available in a source code:
· ENHANCEMENT-POINT
– can either be static (for example, additional data declaration) or dynamic (for
example, additional coding).
· ENHANCEMENT-SECTION
– can either be static (for example, replace an existing data declaration) or
dynamic (for example, replace coding).
· Overlay enhancement
– overwrite an existing enhancement instead of modifying it.
Source Code Enhancements vs. Modifications Advantages of source code enhancements:
· No modifications;
· No object key is needed;
· Are switchable by the switch framework;
· Fewer upgrade effort.
Disadvantages of source code enhancements:
· exist only at special source code lines (implicit, explicit).

Implicit Enhancement Options in ABAP Source Codes Use


In ABAP programs, implicit enhancement options are predefined at the following
places:
· At the end of aninclude. There are some restrictions, for example, not at the end
of a method include.
· At the end of a PUBLIC-, PROTECTED-, PRIVATE-SECTION of a class.
· At the end of the implementation part of a class(Before the ENDCLASS, which
belongs to CLASS IMPLEMENTATION)
· At the end of an interface definition (before the ENDINTERFACE).
· At the end of a structure definition(Before TYPES END OF, DATA END OF,
CONSTANTS END OF, and STATICS END OF).
· At the beginning and at the end of a procedure (FORM, FUNCTION, METHOD).
That is, after commands FORM, FUNCTION, and METHOD, and before statements
ENDFORM, ENDFUNCTION, and ENDMETHOD.
· At the end of the CHANGING-, IMPORTING-, EXPORTING-
parameter list of a method. These enhancement options are located in the middle
of a statement.
Implicit enhancement options always exist and no enhancement spot
is assignedto themExplicit Enhancement Options in ABAP Source CodesUse
In ABAP programs, you can select either a position or a program section as an
explicitenhancement option. Source code plug-ins for an enhancement are either
entered at such aposition or they replace the selected section.An explicit
enhancement option of an ABAP program is part of the program. It is
thusassigned to the package of the program and not necessarily to the package of
theenhancement spot to which it belongs.
Activities
· To mark a position in an ABAP program as an explicit enhancement option,
use thefollowing ABAP statement:
ENHANCEMENT-POINT enh_id SPOTS spot1 spot2 ...
· To mark a section in an ABAP program as an explicit enhancement option,
use thefollowing ABAP statement:
ENHANCEMENT-SECTION enh_id SPOTS spot1 spot2 ......END-ENHANCEMENT-
SECTION.Creating Source Code Plug-InsProcedure
1. Call the
Enhancement Builder
from the ABAP Editor using forward
navigation.2. Create an enhancement implementation for an implicit or explicit en
hancementoption. For more information,
see Creating an Enhancement Implementation
.An empty source code plug-in is automatically created. It has a unique ID and is
displayedin the ABAP Editor below the enhancement option as
follows:ENHANCEMENT
id....ENDENHANCEMENT.3. Implement the enhancement between the ENHANCE
MENT andENDENHANCEMENT lines.A source code plug-in is assigned to exactly
one enhancement option. An enhancementoption can be enhanced through
several source code plug-ins of an enhancementimplementation and through
several enhancement implementations.

Although source code plug-ins is displayed in the same source code as the
respectiveenhancement options, they are actually stored in other Include
programs managed by theEnhancement Builder.
Enhancement Builder
Definition
The Enhancement Builder is an ABAP Workbench tool for creating and managing
enhancements within theenhancement concept. The Enhancement Builder is fully
integrated into the ABAP Workbench. You cannot use atransaction code to call
it directly.
Use
The Enhancement Builder is a collection of individual tools for creating and
maintaining enhancement spots andenhancement implementations, and their
administration. The tools of the Enhancement Builder are called byforward
navigation from within the other ABAP Workbench tools. In addition, there
are special tools for navigationand administration.
Creating, Editing, and Deleting Enhancement Implementations
Purpose
Enhancement implementations are created and changed by means of forward navigation.

For explicitenhancement options, enhancement implementations are created for the


relatedenhancementspots.

For implicit enhancement options, enhancement implementations are created directly.The


appropriate tool for the respective enhancement technology is opened automatically.
Procedure
...

1.

Start the Object Navigator (SE80).

2.

Display the package in which an enhancement implementation is defined, or is to be created.


I f y o u
w a n t
t o T h e n
Create an enhancement implementationThe
m e t h o d i s d i f f e r e n t f o r e x p l i c i t a n d i m p l i c i t enhancement
options. For an explicitenhancement option, select the enhancementspot in the Object
Navigator, and choose
Implement
in the context menu. For an implicitenhancement option, call the EnhancementBuilder
in the relevant tool (ABAP Editor,Function Builder, Class Builder) for executingan
enhancement.Then, in the dialog box that appears, continuewith the following steps:
...

1.

Enter a name for the (simple)enhancement implementation.

2.

Enter a short text for the (simple)enhancement implementation.

3.

Select a composite enhancementimplementation, or create a new one.

4.

Choose
Creation of Enhancement (Enter)
.The subsequent process depends on theenhancement technology of theenhancement spot.

Edit an enhancement implementation


...

1. Select the package and expand it.

2.Expand the Enhancements node.

3. Expand the Enhancement Implementations node.


4. Select the desired enhancement implementation.

5. Select
Change
from the contextmenu.If you only want to display theenhancement implementation,
choose
Display
.Delete an enhancement implementation
...

1. Select the package and expand it.

2. Expand the Enhancements node.

3. Expand the Enhancement Implementations node.

4. Select the desired enhancement implementation.

5. Select Delete from the context menu.

You might also like