Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

About the relation of various technques in Enahncement Framework

Former Member
0 Kudos

I have the confusion.Now that the Enhancement Framework could incorporate all the enhancement technologies such as function module exit,menu exit..... So I wanna know,for the four techs Source Code Enhancement,Function Enahncement,Class Enhancement in the Framework,to which one does function module exit belong,and BAdI belong,and others? What I mean is the the absolute mapping relation of two.

In other words,I just want to know whether User Exit ,Screen Exit are parts of Enhancement Framework,and how they are incorporated in to the framework?

2 REPLIES 2

Former Member
0 Kudos

Hi Alex,

The New Way to Enhance Your ABAP Systems

Please go through this link.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9cd334f3-0a01-0010-d884-f5612003...

Cheers,

Swamy Kunche

Former Member
0 Kudos

Hi ,

Relation between Enhancement Framework?

Enhancement Framework is the new paradigm to bring all enhancement techniques under one roof. It can also be switched using Switch Framework. The following are different enhancement technologies available under this framework.

 Source Code Enhancement

 Function Group Enhancement

 Class Enhancement

 Kernel-BADI Enhancement

Semantically related enhancement options are grouped under a 'Simple Enhancement Spot'. 'Composite Enhancement Spot' contains one or more of Simple and other Composite Enhancement Spots. On the other hand (implementation side), various related implementation elements are grouped under a 'Simple Enhancement Implementation'. A 'Composite Enhancement Implementation' can contain one or more of Simple and other Complex Enhancement Implementations. The important point to note here is these four entities form the basis of transportable objects in the Enhancement Framework.

Enhancement concept: Defining the relationship

Enhancement Framework Technologies

Enhancement framework tools are tightly integrated into the ABAP workbench. There is a new browser called Enhancement Information System available in SE80 to centrally manage all the enhancement definitions and implementations available in the system. The enhancement objects can also be individually managed in the respective Package under the Repository Browser of SE80.

Enhancement browser integrated into SE80

As mentioned earlier, the four technologies available as part of the Enhancement Framework are:

 Source Code enhancement

 Function Group enhancement

 Class enhancement

 Kernel-BADI enhancement

The first three methods, viz., Source Code enhancement, Function Group enhancement, and Class enhancement are brand new ways to enhance the ABAP system. The final one Kernel-BADI is an improvement of the old classic-BADI now integrated into the Enhancement Framework. Let us look at each one of these and understand what they are and how and when to use them. Remember that all of these techniques are considered enhancing and not modifying the system.

Source Code enhancement

Whenever enhancement needs to be incorporated directly into the ABAP source code, this technology shall be provided. Implementing this technology is also called as Source Code Plug-In. There are two types of Source Code enhancements possible.

 Implicit enhancement option

 Explicit enhancement option

Note that, in order to implement any of these Source code enhancements, you need to be in the u2018Change Enhancement modeu2019 (the spiral icon available in the editor).

Technically the source code plug-in implementations are stored in a separate include program and not as part of the original source program.

Implicit enhancement option

Throughout the ABAP system, enhancement options are automatically available at certain pre-defined places. Some of the implicit options are:

 At the end of all the programs (Includes, Reports, Function pool, Module pool, etc.), after the last statement

 At the beginning and end of all FORM subroutines

 At the end of all Function Modules

 At the end of all visibility areas (public, protected and private) of local class

To view all the implicit options available in a source code, choose u2018Edit -> Enhancement Operations -> Show Implicit Enhancement Optionsu2019 from the editor.

Implicit Source Code Enhancement Options

You donu2019t need to have an explicitly defined enhancement spot in order to implement these enhancements. Just position the cursor on any of these implicit points and choose u2018Create Enhancementu2019 from the menu to implement it.

Explicit enhancement option

The Implicit enhancement options are provided at specific source code places explicitly by SAP (Note that these enhancement definitions can also be created by partners and customers in their code).

There are two types of Explicit Enhancement options available. One which can be provided at a specific place - called Enhancement Point, and another which can be used to replace a set of statements u2013 called Enhancement Section. For this, we now have two new ABAP statements, viz.

 ENHANCEMENT-POINT

 ENHANCEMENT-SECTION

Explicit Source Code Enhancement Options

When the Enhancement-Section is implemented, only the implementation gets executed and the original code doesnu2019t get executed. This is a new technique, which didnu2019t exist previously in any of the old ways of enhancing, to exclude any standard SAP code from execution. Because of this, there can be only one active implementation of an Enhancement-Section. On the other hand, there can be multiple active implementations of an Enhancement-Point, in which case all the implementations will be executed with no guarantee in the order of execution.

Function Group enhancement

All application function modules can be enhanced by adding parameters to the standard function module interface. These parameters must be u2018optionalu2019 in nature, since adding a mandatory parameter will require all calls to be changed. Additionally any function module that is part of the Central Basis can not be enhanced (for example: function module u2018POPUP_TO_CONFIRMu2019). From the menu, choose u2018Function module -> Enhance interfaceu2019 to add optional parameters to a function module.

Enhancing Function Module interface

Think about all the steps that customers currently go through for adding new parameters to a BAPI. Cloning of BAPI is an option but maintaining and syncing up during upgrade could be a nightmare. Now with a combination of Function Group enhancement and Source code plug-in, BAPIu2019s can easily be enhanced to add new parameters and add custom logic to process those parameters.

Class enhancement

The global Classes and Interfaces can be enhanced as follows:

 Adding optional parameters to existing Methods

 Adding new Methods to the global Class / Interface

 Adding Pre-exit, Post-exit or Overwrite-exit to an existing Method

The Pre and Post exits get executed before and after invoking the respective method. These are achieved by an automatically generated local class. All methods are stored as part of this local class. (Point to ponder: Are private and protected attributes accessible from the Pre and Post exits?).

Choose menu option u2018Class -> Enhanceu2019 to add new methods or parameters. Choose menu option u2018Edit -> Enhancement operationsu2019 to add or delete the Pre/Post/Overwrite exit methods.

Enhancing global Classes / Interfaces

Kernel-BADI enhancement

The old classic-BADIu2019s are implemented purely at the ABAP Workbench level; that is, both the definition and implementation are realized as workbench repository objects (global classes and interfaces). The new Kernel-BADI takes it to the ABAP language level. Because of this, the new Kernel-BADIu2019s are much faster compared to the old classic-BADIu2019s.

There are two new ABAP statements available now to support the Kernel-BADIu2019s, namely GET BADI and CALL BADI.

Example:

data bd_hdl type ref to badi_name.

GET BADI bd_hdl filters filt_1 = u2018VALUEu2019.

CALL BADI bd_hdl->method

exporting param_1 = 10.

The old classic-BADI used to mix both implementation selection and method call in the same CALL METHOD statement. The implementations could only be chosen at run-time because of the above reason and due to the fact that the BADI handle could only be gotten from another method call by passing the BADI name.

Whereas in the new Kernel-BADI, the active BADI implementations are included into the load of BADI handle at compile time and the filter criterion are expanded as IF statements. This is the reason the new Kernel-BADIu2019s are much faster than classic-BADIu2019s.

Some of the other new features of Kernel-BADIu2019s are:

 Improved Filters with complex filter condition editor

 Stateful BADI support and Context based lifetime control

 Possibility to inherit the implementations

 Switchable using Switch Framework

Creating BADI definition in SE80

Since Kernel-BADI is yet another enhancement technology under Enhancement Framework, we need to create Enhancement Spot in order to hold the BADI definitions. Similarly, the BADI implementations must also be assigned to Enhancement Implementations. The BADI definition and implementation editors are integrated into SE80.

Benefits / Value Proposition

By now you would have understood and appreciated the benefits this new technology brings to the table. Here is the summary.

 All enhancement technologies are now under a single roof of Enhancement Framework, and integrated into the ABAP workbench. Result: Enhancement is easily manageable.

 The Enhancement Framework can be switched using Switch Framework through package assignment.

 With new enhancement technologies (like Source Code, Function & Class enhancements), the options to enhance standard SAP code have increased tremendously. This cuts down on the need to do Core-mod, which requires more effort than enhancement

 Kernel-BADIu2019s are much faster compared to the old classic-BADIu2019s

 Implementing classes of Kernel-BADIu2019s are re-usable through inheritance

 The lifecycle of BADI implementation instances are better managed through advanced options (Stateful BADIu2019s through Context based and reusable instantiation)

 During the upgrade, SPAU_ENH transaction lets you create enhancement implementations to hold the BADI implementations, which guarantees the Return On Investment (ROI) for the old classic-BADI implementations.

One final word

With these new enhancement features (especially Implicit source code technology), the enhancement options are pretty much omnipresent. Like any technology which gives more power to the users of the system, this technology too if not used properly could lead to disorder. For example, just because more enhancement options are available it should not be over-used. Customersu2019 business requirements for the need to adapt should still be the yard stick.

u201CWith great power comes great responsibilityu201D! So, choose the options wisely. My best-practice recommendation for the order in which the enhancement options should be considered and used is:

 Use a BADI; if there is no BADI to suite your need then,

 Try to solve it using Explicit Source code, Function and Class enhancements; and,

 Implicit Source code enhancement should be the last option to choose

Of course, if none of the above could solve your adaptation needs and if your business demands it, modification should be the last option.

Reward if useful

Thanks

Jagadeesh.G