Professional Documents
Culture Documents
Framework
for Nordic User group
Contributing Speakers
Michael Acker
Development Architect, NW AS ABAP Workbench, SAP AG
This document is a preliminary version and not subject to your license agreement or any other agreement
with SAP. This document contains only intended strategies, developments, and functionalities of the SAP
product and is not intended to be binding upon SAP to any particular course of business, product strategy,
and/or development. Please note that this document is subject to change and may be changed by SAP at any
time without notice. SAP assumes no responsibility for errors or omissions in this document.
Create your own Enhancement Spots for your own source code
Ways of adaptation:
Customizing
Enhancement
Modification
Reducing TCO
Enhancing objects instead of modifying them reduces the effort
for adjustment during SP import or upgrade.
Disadvantages of modifications
No support for multiple users or projects
No grouping
No support for parallel developments
Will appear much more often in adjustment tools
Higher adjustment effort
Application Development
Enhancement 1 Enhancement 2
Add On Development
Enhancement 11 Enhancement 12 Enhancement 01
Customer Development
Enhancement 001
n m
[Simple] Enhancement Spot [Simple] Enhancement Implementation
n n
1 1
n
n
Composite Enhancement Spot Composite Enhancement Implementation
1 1
Enhancement
Implementation Elements
Implementations
Contained
Composite
Enhancement
Implementations
contains [Simple]
Enhancement
Implementations
ERP IS_OIL
Composite Enhancement Spot Composite Enhancement Implementation
SD Upstream
Composite Enhancement Spot
Search for
Enhancements possibilities
Existing Enhancement Implementations
Enhancement Implementations to be adjusted after upgrade
SE03 / SE06
New option:
Enhanceable Only creation of enhancement
implementations is allowed
ENHANCEMENT 1.
PROGRAM p1. WRITE Hello
Paris.
WRITE Hello World. ENDENHANCEMENT.
ENHANCEMENT 2.
ENHANCEMENT-POINT ep1 SPOTS WRITE Hello
s1. London.
ENDENHANCEMENT.
..
..
..
ENHANCEMENT 3.
ENHANCEMENT-SECTION ep2 WRITE Enhanced.
SPOTS s1. ENDENHANCEMENT.
WRITE Original.
END-ENHANCEMENT-SECTION.
Compilation Unit
Point A
Spot Point C
Hugo
SpotA B
Section
Spot
Flights
Point D
Point F
Point E
Compilation Unit
[Simple] Enhancement
Implementation 1
Point A E2 E2 E3
Spot Point C
Hugo
SpotA B
Section
Spot
Flights
Point D
Point F
Point E
Compilation Unit
[Simple] Enhancement
Implementation 1
Point A E2 E2 E3
Spot Point C
Hugo
SpotA B
Section
Spot
Flights
Point D
Point F
Point E E1 E2 E2
[Simple] Enhancement
Implementation 2
Compilation Unit
[Simple] Enhancement
Implementation 1
Point A E2 E2 E3
Spot Point C
Hugo
[Simple] Enhancement
Implementation 3
SpotA B
Section
Spot
E1
Flights
Point D
Point F
Point E E1 E2 E2 E2
[Simple] Enhancement
Implementation 2
Program
Example:
An SAP Program is enhanced by an Industry
Enhancement e.g. Solution.
Industry Solution
The source code of the Industry Solution
enhancement is exchanged by a customer
Enhancement e.g. enhancement.
Customer
Call method instance->hugo( ).
A BAdI
is an anticipated point of extension these points act like sockets and
exist in the original source code
METHOD if_mybadi~add_tax.
GET BADI mytaxbadi result = value +
FILTERS LANGUAGE = sy- XY
g e= myfunc(value).
langu. g ua
lan ENDMETHOD.
..
lan
gua
CALL BADI mybadi->add_tax ge
= D
E
EXPORTING METHOD if_mybadi~add_tax.
value = my_value result = value * 1.16.
IMPORTING ENDMETHOD.
result = my_result.
..
write / my_result.
METHOD
GET BADI mybadi. if_mybadi~value_changed.
.. insert value ..
CALL BADI mybadi->value_changed ENDMETHOD.
EXPORTING
value = my_value
.. METHOD
if_mybadi~value_changed.
write value ..
ENDMETHOD.
METHOD
if_mybadi~get_result.
do ..
ENDMETHOD.
badi_name
bd
Inst1 Inst2
Cl_imp1 Cl_imp2
SAP AG 2006, Enhancement Framework/ 51
BAdI-Handle is No Proxy
bd
Definition Implementation
BAdI Implementation 1
BAdI Implementation 2
BAdI Definition A
BAdI Implementation 2
BAdI Definition B
BAdI Implementation 2
BAdI Definition C
BAdI Implementation 3
Definition Implementation
Simple Enhancement Spot BAdI Implementation 1
Spot_1
BAdI Implementation 2
BAdI Definition A
BAdI Implementation 2
BAdI Definition B
BAdI Implementation 2
BAdI Definition C
BAdI Implementation 3
Definition Implementation
Simple Enhancement Spot BAdI Implementation 1
Spot_1
BAdI Implementation 2
Enhancement Implementation E2
BAdI Definition A
BAdI Implementation 2
BAdI Definition B
BAdI Implementation 2
BAdI Definition C
BAdI Implementation 3
Enhancement Implementation E1
Definition Implementation
Simple Enhancement Spot
Spot_1 BAdI Implementation 1
Simple Enhancement Implementation SEI1
Package A
BAdI Implementation 2
BAdI BADI_A
Switch_1
Definition Implementation
Simple Enhancement Spot
Spot_1 BAdI Implementation 1
Simple Enhancement Implementation SEI1
Package A
BAdI Implementation 2
BAdI BADI_A
Switch_2
SAP AG 2006, Enhancement Framework/ 57
Enhancement Spots and Enhancement Implementation (5)
Definition Implementation
Simple Enhancement Spot BAdI Implementation 1
Spot_1
Simple Enhancement Implementation SEI1
BAdI BADI_A BAdI Implementation 2
BAdI BADI_B
BAdI Implementation 3
BAdI BADI_C
BAdI Implementation 4
Simple Enhancement Spot Simple Enhancement Implementation SEI2
Spot_2
BAdI Implementation 5
BAdI BADI_E
BAdI Implementation 6
Types of Implementations
A BAdI-Definition may have an associated fallback class
A BAdI-Implementation is either default or non-default
bd1:badi_name1 bd2:badi_name1
imp:cl_imp
badi_name
bd1
Inst1 Inst2
Cl_imp1 Cl_imp2
badi_name
bd2
bd1
Cl_imp1 Cl_imp2
badi_name
bd1
Inst1 Inst2
Cl_imp1 Cl_imp2
badi_name
bd2
bd1
Inst1 Inst2
Cl_imp1 Cl_imp2
In ABAP:
DATA ctx TYPE REF TO cl_myctx.
GET BADI bd CONTEXT ctx.
Implementation Class n
badi_name
same_ctx dif_ctx
Inst1 Inst2
Cl_imp1
SAP AG 2006, Enhancement Framework/ 69
Encapsulating Data for Two BAdIs Within One Class
Interface A
method M1
badi_1 Impl1
Interface B
method M2
Class a
Interface A
*some code method M1
GET BADI bd1 ref to badi_1 CONTEXT me
CALL BADI bd1->met
*some code
GET BADI bd2 ref to badi_2 CONTEXT me
CALL BADI bd2->met Cl_1
badi_2 Impl2
Interface B
method M2
Automatic migration
Automatic migration by selecting
by selecting utilities
utilities migration
migration from BAdI
from BAdI
Builder Builder (SE18)
(se18)
Specify Enhancement Spot for BAdI Defintion
Specify
Specify Enhancement
Enhancement Spot forfor
Implementation BAdI Definition
BAdI Implementation
special
no Specify Enhancement
knowledge Implementation for BAdI
necessary
Implementation
effort: 5 minutes per BAdI (with some implementations). The migration
no special knowledge necessary
can be automated.
Implementation 1
Implementation 2
Implementation n
CL_EXITHANDLER=> Context
GET_INSTANCE
Proxy Class
CALL METHOD CL_EX_<BAdI>
if_ex_badi->m
BAdI
CALL BADI
mybadi->meth.
Complete migration:
Delete the classic BAdI.
Change Context Settings if you need no context.
Find all calls of the classic BAdI by GET_INSTANCE and
reprogram the BAdI call using the new commands GET
BADI and CALL BADI.
For BAdIs that are called more than once in one program the
context settings may be changed to improve the
performance.
Expert knowledge of the application necessary
1 2-27 40-600
x faster than classic BAdI x faster than classic BAdI
Customer System
SAP System
Implementation Z1
BAdI A of BAdI A
Use case
1.BAdIs used in Frameworks often have only one key to select BAdI
implementations e.g.: ESI
A special implementation for these BAdIs will allow to keep efficiency
even when thousands of BAdI-Implementations for one BAdI exist in a
system
SAP Customer
PROGRAM PROGRAM
SAP Customer
PROGRAM PROGRAM
*Section Implementation
Code Changes
Code Adjustments ???
BAdIs
BAdI interface was changed or a filter was deleted
Import Log
Editor
SPAU_ENH
+
SPAU_ENH
3. Go to tab Adjustment
SPAU_ENH
7. Press Button
8. Activate Enhancement
Semantic Changes
Automatic Adjustment
Tool-Aided Adjustment
Manual Adjustment
Enhancement is adjusted
Implementation is empty
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
Switchable Objects
by package assignment
Appends, SI-, CI-includes for dictionary structures
Fixed value appends to domains
Secondary Indexes
Append Search Helps
Enhancement Implementations
Switch Business Configuration Sets (Switch BC-Sets)
Switchable Objects
by direct assignment
Screen elements & Flow logic
Menu entries & functions
IMG nodes
Customizing
Maintenance Views
Appends Appends
P4 P5
Redefinitions Redefinitions
Reports BadI-Implem.
BadI-Implem. Function Group
Redefinitions Transactions
Transactions Transactions
BC set 3 Appends
BC set 2 BC set 1 BC set 5
BC set 4
Screen 1 IMG-Node 1
Element 1 IMG-Node 2 Screen 3 IMG-Node 6
P6
Screen 2 IMG-Node 3 Element 4 IMG-Node 7
Function Group
Element 3 Element 5
Appends Appends
P4 P5
Redefinitions Redefinitions
Reports BadI-Implem.
BadI-Implem. Function Group
Redefinitions Transactions
Transactions Transactions
BC set 3 Appends
Reports Reports
BC set 5
BC set 2 BC set 4
BC set 1
Screen 1 IMG-Node 1
Element 1 IMG-Node 2 Screen 3 IMG-Node 6
P6
Screen 2 IMG-Node 3 Element 4 IMG-Node 7
Function Group
Element 5
Element 3
Appends Appends
P4 P5
Redefinitions Redefinitions
Reports BadI-Implem.
BadI-Implem. Function Group
Redefinitions Transactions
Transactions Transactions
BC set 3 Appends
Reports Reports
BC set 4
BC set 2 BC set 5
BC set 1
Screen 1 IMG-Node 1
Element 1 IMG-Node 2 Screen 3 IMG-Node 6
P6
Screen 2 IMG-Node 3 Element 4 IMG-Node 7
Function Group
Element 3 Element 5
Transaction SFW5
SFW5
SFW5
The Batch Job for DDIC and BC-Set activation starts immediately.
Caution: Caution:
Only one Business There is no possibility,
Function Set can be to deactivate a BFS
activated
Business Functions
Switches can be added by enhancements.
The new BAdIs are more flexible and faster than the
classic ones.
Public Web
http://help.sap.com Documentation SAP Netweaver Application
Platform ABAP technology ABAP Workbench Enhancement
Framework
http://sdn.sap.com Weblogs by author Thomas Weiss
The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted in any form or for any purpose
without the express prior written permission of SAP AG.
This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This document contains only intended
strategies, developments, and functionalities of the SAP product and is not intended to be binding upon SAP to any particular course of business, product
strategy, and/or development. Please note that this document is subject to change and may be changed by SAP at any time without notice.
SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics,
links, or other items contained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited
to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.
SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use
of these materials. This limitation shall not apply in cases of intent or gross negligence.
The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use
of hot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party
Web pages.