enhancement framework

27
Enhancement Framework

Upload: saket-shahi

Post on 11-Nov-2014

259 views

Category:

Documents


17 download

DESCRIPTION

Enhancement Framework

TRANSCRIPT

Page 1: Enhancement Framework

Enhancement Framework

Page 2: Enhancement Framework

Enh

ance

men

t Fra

mew

ork.

ppt

Agenda

Introduction

Components

Enhancement Options•Explicit Enhancement Option•Implicit Enhancement Option

Enhancement Spots

Enhancement Implementations

Page 3: Enhancement Framework

Introduction to Enhancement Framework

Page 4: Enhancement Framework

- 4 -- 4 - Enh

ance

men

t Fra

mew

ork.

ppt

Current options available for Enhancements

User-Exits: The very first mechanisms provided by SAP to execute custom code in between the standard SAP control flow. This is implemented as subroutine call (PERFORM xxx). A classical example for User-Exit is MV45AFZZ include in order processing module of SAP R/3.

Customer Exits: It is implemented using Function Modules and so has a well defined parameter interface. Also since the custom coding done as part of these customer-exits is located away from the original SAP code, the maintenance is easier than user-exits. (Before 4.6, only through customer-exits)

BADI’s: It exist in pre NW04s releases are now called old classic-BADI’s. This was the first object-oriented way to enhance the ABAP system. This, to a certain extent, allows multiple implementations with limited filter support. The classic-BADI’s are implemented using ABAP Objects.

Page 5: Enhancement Framework

- 5 -- 5 - Enh

ance

men

t Fra

mew

ork.

ppt

Evolutions of SAP Enhancement Technology

Page 6: Enhancement Framework

- 6 -- 6 - Enh

ance

men

t Fra

mew

ork.

ppt

Drawbacks of previous Enhancement Techniques

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)

Page 7: Enhancement Framework

- 7 -- 7 - Enh

ance

men

t Fra

mew

ork.

ppt

What is Enhancement Framework

New enhancement concept in SAP. Released from SAP NetWeaver 7.0

Replace or incorporate the existing enhancement and modification concepts (solve the issues with the previous concepts).

Enables the integration of different concepts for modifying and enhancing development objects.

The enhancements of the enhancement concept can be switched on/off using the Switch Framework.

Page 8: Enhancement Framework

- 8 -- 8 - Enh

ance

men

t Fra

mew

ork.

ppt

Different components of the Enhancement Framework

The enhancement framework consists of three higher level components :

Enhancement Option - Are positions in Repository objects where enhancements can be made. These options are either explicitly defined (by the developer) or exist implicitly.

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.

Enhancement Implementation - The enhancement implementations manage the enhancements of the enhancement options, both explicitly and implicitly.

Page 9: Enhancement Framework

- 9 -- 9 - Enh

ance

men

t Fra

mew

ork.

ppt

Enhancement Options

Page 10: Enhancement Framework

- 10 -- 10 - Enh

ance

men

t Fra

mew

ork.

ppt

Types of Enhancement Options

Enhancement options can be classified into two categories :

Explicit Enhancement Option Implicit Enhancement Option

Are defined explicitly by the developer.

Managed using enhancement spots

Enhanced using enhancement implementations

Are of two types :– Source code plug-in

– Kernel BADI (or new BADI)

Always exist and do not have to specified by developer

No enhancement spots are needed

Enhanced using Enhancement Implementations

Are of three types :– Specific options in programs

– Parameter interfaces of function modules

– Methods of classes

Page 11: Enhancement Framework

- 11 -- 11 - Enh

ance

men

t Fra

mew

ork.

ppt

Enhancement Spots

Page 12: Enhancement Framework

- 12 -- 12 - Enh

ance

men

t Fra

mew

ork.

ppt

What are Enhancement Spots

Enhancement spots are created to manage explicit enhancement options

An explicit enhancement option is always referenced using spot name and option name

An enhancement spot can contain multiple enhancement options

An enhancement option can be assigned to multiple enhancement spots.

A composite enhancement spot can hold multiple simple enhancement spots.

Spots are always provided by the application developer

No spots are required for implicit enhancement options

Page 13: Enhancement Framework

- 13 -- 13 - Enh

ance

men

t Fra

mew

ork.

ppt

Enhancement Implementation

Page 14: Enhancement Framework

- 14 -- 14 - Enh

ance

men

t Fra

mew

ork.

ppt

What is an Enhancement Implementation

Used to manage enhancements

Enhancement Implementations are created by the customer

An enhancement can/must be a part of only one enhancement implementation

An enhancement implementation can contain multiple enhancements

An individual enhancement inside an implementation is known as an enhancement implementation element.

An enhancement implementation element for a explicit enhancement option must be associated with an enhancement spot.

A composite enhancement option can contain multiple simple enhancement options.

Page 15: Enhancement Framework

- 15 -- 15 - Enh

ance

men

t Fra

mew

ork.

ppt

Representation of Spot and Implementation

Page 16: Enhancement Framework

- 16 -- 16 - Enh

ance

men

t Fra

mew

ork.

ppt

Explicit Options

Page 17: Enhancement Framework

- 17 -- 17 - Enh

ance

men

t Fra

mew

ork.

ppt

Source Code Plug-in

The following enhancement options are available in the source code:

Enhancement - Point • Can be static (data declaration) or dynamic (coding).• Used as a place holder to place additional coding.• Can belong to multiple enhancement spots• Multiple active implementations possible and will be executed with no

guarantee in the order of execution.

Enhancement – Section• Can be static or dynamic• Used to modify / replace a certain section of code. Only one is active at a

time.• Can belong to multiple enhancement spots.• Implementation gets executed and the original code does not gets

executed.

Page 18: Enhancement Framework

- 18 -- 18 - Enh

ance

men

t Fra

mew

ork.

ppt

Source Code Plug - in – Editor Modes

Creating enhancement options – Use the Change mode for creating enhancement points or sections– Use the button to switch between change display modes

Implementing enhancement options – Use the Enhancement mode to create implementations– Use the button to get into the enhancement mode.

– Use the button to leave the enhancement mode.

Page 19: Enhancement Framework

- 19 -- 19 - Enh

ance

men

t Fra

mew

ork.

ppt

Demos for Explicit Enhancement Options

Demo for Enhancement Point

Demo for Enhancement Section:

•Before Implementation

•After Implementation

Page 20: Enhancement Framework

- 20 -- 20 - Enh

ance

men

t Fra

mew

ork.

ppt

BADI Enhancement Option

What are BADIs ?– Business Add – Ins

– Is an anticipated point of exception – these points act like sockets and exist in the original coding

– has well defined interface in contrast to source code plug-ins and is more stable to changes in the original code

Kernel BADIs – New Features– Can be switched by switch framework

– Integrated directly in the ABAP language runtime

– Improved filter support (non-character filter types)

– Enable Reusable Implementations – Stateful BADI

– Control lifetime of Implementations – BADI-Context

Page 21: Enhancement Framework

- 21 -- 21 - Enh

ance

men

t Fra

mew

ork.

ppt

BADI Enhancement Option - Comparison

The new BADI has several advantages over the classic BADIs

Classic BADI New BADI

Page 22: Enhancement Framework

- 22 -- 22 - Enh

ance

men

t Fra

mew

ork.

ppt

Demo for Kernel BADI

•Creation of Enhancement Spot fro BADI

•Creation of Enhancement Implementation for BADI

•Call of the BADI from the program

Page 23: Enhancement Framework

- 23 -- 23 - Enh

ance

men

t Fra

mew

ork.

ppt

Implicit Options

Page 24: Enhancement Framework

- 24 -- 24 - Enh

ance

men

t Fra

mew

ork.

ppt

Source code (Specified points) options :

These are enhancement options at predefined points in a program :

At the end of an Include

At the end of a private, public or a static section of a class

At the end of an implementation for a class

At the end of an interface definition

At the end of structure definitions

At the start of a procedure (Subroutine, Method, Function)

At the end of a procedure

At the end of parameter set of a method (Changing, Importing, Exporting)

Demo for Implicit Enhancement of Subroutine

Implicit enhancement options always exist and no enhancement spot is assigned to them.

Page 25: Enhancement Framework

- 25 -- 25 - Enh

ance

men

t Fra

mew

ork.

ppt

Parameter Enhancement Option

The parameter enhancement option provides an option to add new parameters to a function module interface

The parameters are always optional.

The added parameters can be utilized by making other enhancement implementations in the source code.

Demo for Parameter enhancement option for Function Module

Page 26: Enhancement Framework

- 26 -- 26 - Enh

ance

men

t Fra

mew

ork.

ppt

Class Enhancement Option

Using the class enhancement options you can :

Add new methods to a class / interface

Add new attributes (Public / Private / Protected)

Add pre or post methods to an existing method

Demo for Class Enhancement Option

Page 27: Enhancement Framework

Copyright © 2008 Deloitte Development LLC. All rights reserved.