Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

The new Enhancement

Technology for SAP

November 30, 2015 © 2010 Wipro Ltd - Confidential 1


Approaches to adapt SAP Source Code

• Modifications:

These are changes of a SAP development object and are supported as


well as tracked by the Modification Assistant.

• Enhancements:

These do not change the SAP development object, but rather add
something to it or enhance it. Up to now, there were so-called User
Exits and Customer Exits where you could put in additional source
code. Since release 4.6 there were also BADIs (Business Add-Ins). A
BADI specifies an object-oriented interface that can be implemented
by a customer.
Enhancement Framework
• Introduction:

The basic idea of Enhancement Framework is to make modification


free enhancements of development objects such as programs,
function modules, global classes, and Web Dynpro components.

• Enhancement Options For Modification-Free Enhancements

The basic concept is the enhancement option. Think of an


enhancement option as a hook where you can attach the
enhancement implementation elements to. If an SAP system
provides these hooks, you can add an implementation element there
at later stages of development in other system, without modifying
the original SAP code.
Explicit & Implicit Enhancement Options

Principally, there are two types of enhancement options:

• Explicit enhancement options are created/made available in ABAP


programs by the following statements:
ENHANCEMENT-POINT
ENHANCEMENT-SECTION

• Implicit enhancement options are provided by the framework


without any effort on the developer's part. The enhancement
definition is for free, while, of course, the implementation has to
be inserted. Implicit enhancements comprise class enhancements,
function group enhancements and predefined enhancement points
at particular predefined posit
Explicit Enhancement Option
Explicit Enhancement Options

ENHANCEMENT-POINT:

Defines a position in an ABAP program as an enhancement option,


at which one or more source code plug-ins can be inserted.

ENHANCEMENT-SECTION:

Defines a section of an ABAP program as an enhancement option,


which can be replaced by one or more source code plug-ins.
Implicit Enhancement Option
Implicit Enhancement Option

Implicit enhancement options exist in the following places in ABAP


programs:
• After the last line of the source code of executable programs,
function groups, module pools, subroutine pools, and Include
programs,

• Before the first and after the last line of the implementation of a
procedure (after the opening statement and before the END
statement),

• At the end of a visibility section in the declaration section of a local


class,

• At the end of a list of formal parameters of the same type in the


declaration of local methods.
Enhancement Spot

• A repository object for the administration of explicitly created


enhancement options. Enhancement spots are components of a
tree structure hierarchy, of which the branches represent
composite enhancement spots and the leaves are simple
enhancement spots.

• Implicitly available enhancement options do not have any


enhancement spots.
Scenario using Explicit Enhancement
• Tax Code Validation on XK02(Vendor Change)

Identify the appropriate Enhancement point and create


implementation as shown below:
Scenario using Explicit Enhancement
Scenario using Explicit Enhancement

• The code for Validation could be inserted within the ENHANCEMENT


ENDENHANCEMENT blocks.

• Activate the Enhancement and test the validation


Scenario using Implicit Enhancement

• Validation on Cost Center

Implicit Enhancement options have to be used incase no Explicit


Enhancements are available
Scenario using Implicit Enhancement

• Choose the Type of Enhancement as Code

• And proceed to create implementation as described earlier


Scenario using Implicit Enhancement

• The code for Validation could be inserted within the ENHANCEMENT


ENDENHANCEMENT blocks.

• Activate the Enhancement and test the validation


Different Enhancement Technologies
• Class Enhancements: You can add additional methods, optional
parameters, pre- and post-methods to existing methods.
• Function group enhancements: You can enhance the interface of a
function module by additional parameters using function group
enhancements.
• Source code enhancements: Enhancement points are positions in the
source code where you can attach source code plug-ins that enhance
the source code at these positions. Also, the code of a so-called
Enhancement Section is substituted by the respective source code
plug-in.
• The BAdI is an object-oriented enhancement option. The BAdI
defines an interface that can be implemented by classes that are
transport objects of their own. The new BAdI is fully integrated into
the Enhancement Framework.
Function Module Enhancement

• The Interface parameters as well as the Source code of Function


Modules can be enhanced.
Function Module Enhancement

• The internal table structure used in the FM also needs to be


modified. This will be done using the Implicit option detailed earlier
Function Module Enhancement
Function Module Enhancement

• Source Code Changes


Thank You

You might also like