You are on page 1of 64

IBM Global Business Services

SAP Enhancement Framework A Great Way of


Enhancing the SAP Code
July 2009

IBM Corporation 2013

IBM Global Business Services

Learning Objectives
Understand the fundamental idea of the Enhancement Framework and Switch
Framework (available in SAP NetWeaver 2004s)
Reduce TCO by using enhancement technologies instead of modifications
Enhance SAP standard objects and understand how Enhancement definitions
are created

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Enhancement Framework in SAP NetWeaver

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Adapting SAP
One of the advantages of SAP software is the possibility to adapt the software of own requirements and
the possibility of keeping the adaptations during upgrade.
Ways of adaptations:
1. Customizing Configurations done in SAP (T Code SPRO)
2. Enhancement Additional Customer Requirements typical for a client and which is not available
in Standard SAP
3. Modifications Changing the Standard SAP Code to enhance the code to add new
functionalities.

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Modification vs. Enhancement - Motivation


Disadvantages of Modifications
No support for multiple users or projects
No support for parallel developments
Will appear much more often in adjustment tools
Higher adjustment effort (during upgrade & SP import)

Advantage of Enhancements
Enhancing objects instead of modifying them reduces the effort of adjustment
during Service Pack import or upgrade.
In ECC 6.0 Enhancement Functionality becomes more flexible and easier. ECC
6.0 introduces a new facility on enhancement called Enhancement Point.

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Evolution of SAP Enhancement Technology

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Source Code Plug-in

Source Code Plug-in

Implicit
Enhancement

Enhancement Framework

Explicit
Enhancement

July 2009

IBM Corporation 2013

IBM Global Business Services

Implicit Enhancement vs. Explicit Enhancement


Implicit Enhancement Option

At common enhancement places, implicit Enhancement options are


available.
Examples:
End of Executable Program, Include, Function group, Dialog module

Begin/End of Form routine / Function module / Method


End of a structure
End of Private/Protected/Public Section of a local class

Explicit Enhancement Option


Predefined enhancement options can be defined in source code.
They are additionally stored inside Enhancement Spots.

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Enhancement - Relations

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Implicit Enhancements

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 1 - Activate the enhancement functionality


Using SE80 open the program/include you want to enhance and click on the enhancement button or
press <Shift + F4> or go to Program > Enhance

11

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 2 - Enhancement functionality activated


The SE80 screen will now look something like below. Menu add new buttons for Enhancement.

12

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 3 - Show implicit enhancement points


Go to menu Edit->Enhancement Operations->Show Implicit Enhancement Options to display implicit
enhancement points within the ABAP code

13

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 4 - Enhancement points with the code


Once you have done this, you will be able to see all the implicit enhancement points available within your
code, these are denoted by the line of quotation marks and the black arrow at the start.

14

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 5 - Create an implicit enhancement point


In order to implement an implicit enhancement point simply right click on the required enhancement point
and select Enhancement Implementation > create.

15

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 6 - Enhancement point type


Next click on the Code button to create a code implementation.

16

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 7 - Name and description


Next give the enhancement point a name and description. Click the green tick.

17

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 8 Package information


Once you click the green button, it will ask for Package. Enter the package name and click to Save button.

18

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 9 - Change request


Next assign the Transport number.

19

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Step 10 - Enhancement point created


The enhancement point will now have been created in the appropriate place. Denoted by the
ENHANCEMENT...ENDENHANCEMENT tags.

20

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Summary
Implicit Enhancement is present in SAP standard program mostly in below
mentioned places.
End of Executable Program, Include, Function group, Dialog module
Begin/End of Form routine / Function module / Method
End of a structure
End of Private/Protected/Public Section of a local class

21

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Enhancement Spot
Implementation of Enhancement

22

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Enhancement Spots
The enhancement spots are used to manage explicit enhancement options.
Enhancement spots carry information about the positions at which enhancement
options were created.
One enhancement spot can manage several enhancement options of a
Repository object.
Conversely, several enhancement spots can be assigned to one enhancement
option.

23

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

How to Find an Enhancement Spot

24

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Locate Enhancement Spot


Go to Program LEINKF01

Search for Enhancement spot ES_SAPLEINK

25

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Double click to display the enhancement object

The Enh Spot by the name ES_LV61A501 is present.

26

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Create Enhancement
Click on Enhance Icon (Spiral)

Click on the Ehnancement Spot ES_SAPLEINK and in Enhancement


Implementation Click on Create

27

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Create Enhancement (Cont.)

28

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Create Enhancement Implementation

29

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Enhancement is created in SAP

30

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Code Logic
Write your code, save and activate. An active version of the Enhancement is
created

31

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Exercise
Create an Explicit Enhancement Spot Implementation

Save and activate


Check if the Enhancement is created or not

32

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Function Group Enhancement - Technology


Function Group Enhancements allows adding new optional parameters to existing
function modules
Transaction SE37

33

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Create Enhancement
Go to SE37 and select a Function Module

Click on the Function Module Menu


Click on Enhance Interface

34

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Create Implementation and Add New Parameter


Create Enhancement Pop Up box comes, click on Create Icon

35

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Run Function Module and check new parameter


Save and Activate

Test the changes

36

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Exercise
Go To SE37

Enhance a Function Module Interface


Save and activate
Execute to Test

37

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Class/Interface Enhancements
Class/Interface Enhancements allow addition of:
optional parameters to existing methods
methods
events and event handlers
references to interfaces
Exits to existing methods
Pre-Exit Called at the beginning of a method
Post-Exit Called at the End of a method
Overwrite-Exit Replaces the original method

38

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Add new method and parameters

39

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Kernel BAdi Technology


What are BAdIs?
Business Add-Ins
is an anticipated point of extension these points act like
sockets and exist in the original coding
has a well-defined interface in contrast to source code plug-ins
and is therefore more stable to changes in the original coding
Kernel BAdIs - New Features
Are integrated directly in the ABAP Language/Runtime
Improved filter support allows non-character filter types
(packed, numeric, string) and complex filter conditions
Enable reusable implementation instances (Stateful BAdI)
Control of the lifetime of implementations (BAdI-context)
Allow for inheritance of implementations
Can be switched by the Switch Framework

40

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Comparison: Usage of Old BAdIs vs. new BAdIs


Classic and new BAdIs differ in a number of features that are important for
migration:
BAdI object
With classic BAdIs, a BAdI object is created by calling a factory method, and
referenced via a reference variable of the type of the BAdI interface.
With new BAdIs, a BAdI object is created via the ABAP statement GET BADIas a
handle for the calls of BAdI methods, and referenced via a reference variable of
the type of the BAdI. A BAdI object is an instance of an internal BAdI class, which
otherwise is invisible to the outside.

41

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Passing comparison values for the filter


With the classical BAdIs, the filter values are stored in a structure and passed
with the call of the BAdI methods.
With the new BAdIs, the comparison values for the filters used to search for
implementations are passed when the BAdI object is created with the GET BADI
statement.

42

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Calling BADI Methods


Passing comparison values for the filter

A classic BAdI can be called only once and the call positions are registered
centrally.
With new BAdIs, multiple calls are possible and the call positions are not
registered centrally.
For the above reasons, an automatic call migration is not possible.

43

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Transaction SE18
Go to SE18

There are two options available in the BAdi Builder


Enhancement Spot
BAdi Name
Give a BAdi name and click the button Display

44

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

BADI Definition
Display the BAdi

Check the Enhancement


spot to which the BAdi
is migrated

45

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Create a BAdi Enhancement


Give the BAdi Name and from the menu select Enhancement Implementation
Create

46

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Implementation

47

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Save and Activate the BAdi

48

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Sample Code in method PROCESS_ITEM

49

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Display BAdi

50

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Check Enhancement via SE18


Go Back to SE18 and give the BAdi Name in the Enhancement Spot Radio
Button
Click Display Button
Expand the BAdi Definition, you can see the implemented Enhancement

51

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Exercise
Create a BADI Enhancement Implementation in SE18

Create a method
Activate the Implementation
Check it in SE18
Reconfirm the Implementation in Enhancement Spot Display in SE18

52

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Custom BAdi Migration


Automatic migration from BAdI Builder (SE18)
SE18Utilities Migrate Classical BAdi (Cntrl+F3)
Specify Enhancement Spot for BAdI Definition

Specify Enhancement Implementation for BAdI Implementation


Benefits
No special knowledge necessary

Effort: approximately 5 minutes per BAdI.

53

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Overview

54

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Switch Framework
Goal of Switch Framework:

Control visibility of repository objects at runtime through


switches
The Switch Framework can be used to
Switch on industry solutions / Enterprise Add-ons

Develop new functions without affecting existing ones


Enhance delivered systems at partner and customer site in the
context of the enhancement framework with own functions

55

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Switch Framework..
Benefits:

Industry Solutions are available with every release and SP without delay (i.e.
timely provision of legal requirements),
CRTs* are no longer necessary for add-on systems
Industry Solutions can be enriched by generic functions from other industries

Synchronization of release cycles and planning

56

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Switchable Objects
By package assignment

Appends, SI-, CI-includes for structures in DDIC


Fixed value appends to domains
Secondary Indexes
Append Search Helps

Enhancement Implementations
Switch Business Configuration Sets ( Switch BC-Sets)

57

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Switchable Objects
By direct assignment

Screen elements & Flow logic


Menu entries & functions
IMG nodes
Customizing

58

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

SFW1

59

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

SFW2

60

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

SFW3

61

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

SFW5
Industry Solutions Tcode -SFW5

Select a function and activate it

62

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Switch Framework: Architecture

63

Enhancement Framework

July 2009

IBM Corporation 2013

IBM Global Business Services

Links
Please visit the following web links for more details

http://help.sap.com
http://sdn.sap.com

64

Enhancement Framework

July 2009

IBM Corporation 2013

You might also like