Presentation on SAP Enhancement Techniques

New Enhancement Framework
Why it came in Picture?
The main problem with user exits was that only a single implementation is possible. The new enhancement concept of the ABAP Workbench (Enhancement Framework) enables the integration of different concepts for modifying and enhancing development objects. The enhancement concept is supported by the Enhancement Builder tool and ABAP language elements. To over come this issue SAP has came with BAdI and Enhancement Spot. There are four types of enhancement technique: ABAP Source Code Enhancement by using the source code plug-in Function Module Enhancement refer to various type of enhancement Global Class Enhancement refer to enhancement made to global classes and interfaces. Business Add-Ins What is an Enhancement Options? Enhancement Options are positions in repository objects where enhancement can be made. These options can be either Explicit or Implicit. Types of Enhancement with the Enhancement Framework:  Explicit Enhancement Points  Implicit Enhancement Points

Explicit Enhancement Points : These are basically hooks already coded into the
program by SAP various points of the code. Implicit Enhancement Points: These are basically points within ABAP code

where an enhancement point is implied, and in which case can be created.
In Explicit Enhancements there are more two ways of enhancing, 1. Enhancement point (Syntax - ENHANCEMENT-POINT) 2. Enhancement section (Syntax - ENHANCEMENT-SECTION) Enhancement section is used to replace a set of code or statements with the customer (custom code). In this technique the original source code does not get executed but, the customer implementation (custom code) gets executed. Enhancement Spots: Enhancement Spots are points in a SAP system where enhancement options are created.

specific one will be executed based on some criteria (filter) • Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces • No SSCR (SAP Software Change Registration) required . and as country versions. partners. industry solutions.definition can either be SAP provided or user may also create it • No longer assumes a two-system infrastructure (SAP and customers) • Allows multiple levels of software development (by SAP. and customers. Advantage of BAdI • Uses Object oriented approach • Two parts .Definition and its Implementation . and the like) • Can have multiple representations .BadI What is BAdI? Is an enhancement technique which adds extra business functionality with the existing standard code.

which have increased duly and hence a need for reusable object. i. there is no feature of reusability.BAdI vs. Then as it is developed on ABAP objects.e. There are many stages in SAP software reaching customer. it caters the need of reusability. These are planned by SAP. . User Exit User exit is what we call the customer exit. BAdI is customer exit plus Business transaction event. The main disadvantage with this method is that it can be used only once in the system. customers can develop on their own. where you can insert your own code. These are points in SAP application program planned by SAP Developers.

2.Defining and Implementing Business Add-ins (BADI) (Step-by-step with screenshots) Defining a Business Add-in 1. From SAP menu. choose Tools -> ABAP Workbench -> Utilities -> Business Add-ins or transaction code SE18. Enter the BADI name and choose create .

3. Enter the short text. .

.

.

Give the short description .

.

.

.

.

Implementation of BADI .

.

.

.

.

.

Now save and activate then execute. .

.

Now how to call BAdI in your report program .

. If an enhancement for country specific versions then it is likely that different partners can implement this enhancement. • Filter dependent BAdi is called using one filter value only. The application program provides the filter values for the implementation method. all the methods created in the enhancement’s interface need to have filter value as their importing parameter. it is possible to check active implementation for the filter value using the function module SXC_EXIT_CHECK_ACTIVE. • In the enhancement definition. industry sector) we can have filter dependent option. The individual countries can create and activate their own implementation.Filter dependent Badi • Business Add-in definition level (for example a country.

4. In case of multiple use add-ins. Typical example is benefit calculation in HR depending on the implementation. an event that may be interest to other components in program flow. alternative calculations can be executed. There is no sequence control for multiple-use implementations of BAdi’s.Multiple use Badi 1. 3. The concept of multiple use of the Business Add-in is that has been implemented once already can be implemented again by right of the software chain. Any number of components could use this event as a hook to hang their own additional actions on to. This option can be choose at Business Add-in definition. The distinction is base on the procedure or event character of an enhancement. There are multiple use and single use Business Add-ins. at the time of the definition the interface does not know which implementations parameters will be change the implementations. 2. In the first case the program waits for the enhancement to return a return code. . Sequence control is technically impossible.

Method to find the BAdIs First: Run the transaction SE24. Click on display button.How many ways we can find the BadIs? There are 3 ways we can BAdI the BadI. . 1. Under object type put the class name ‘CL_EXITHANDLER’.

.Under this class ‘CL_EXITHANDLER’ select the method ‘GET_INSTANCE’ and double click.

Under the method ‘GET_INSTANCE’ put break point on a function module called ‘CALL METHOD CL_EXITHANDLER=>GET_CLASS_NAME_BY_INTERFACE’ .

.

In this example transaction code is VL02. Run the transaction VL02. that function module will give all BADI used by the transaction in each screen and activity on the application (VL02). As in 1st step we have putted a break point.Step 2: Then according to the requirement run the transaction. .

.

Under the parameter EXIT_NAME this debugger screen will give all BAdI name for each screen . .

BADI NAME: EHS_DG_001 LE_SHP_DELIVERY_PROC LE_SHP_PRICING BADI_LAYER CU_CONFIG_DELEGATION 1st screen of transaction VL02. . you will get all BAdI used for the screen. After that system will go for next screen.Each time press F8.

2. Under BAdI Name press F4 button. . Method to find the BadIs Run the transaction SE18.

After pressing the F4 button below screen will appear than click on Information System .

.

Here you need to give the package name .

After giving the package name press enter it will give the badi name .

Run the transaction SE84. Method to find the BAdIs.3. .

.

.

.

.

.

in contrast to BADI's. there are some differences between them: • Only code enhancements may be created with BTE's. SAP Partners. On the other hand. With BADI's. an assignment table is read • Based on this result. Nevertheless. BTE's are based in the following principles: • The developer defines its interface in a FM • In the generated code.Like SD's Customer Exits. • BTE's are based on Function Modules. which implement object methods . BADI's are multi layer.Business Transaction Events BTE's or Business Transaction Events are a special type of extension for the FI Module. you may also extend structures and Dynpros • BTE's have a three layer architecture (SAP. customer functions are called dynamically Business Transaction Events and Business Add Ins rely on the same concept.BTE's . Customer). BTE's allow customer to adapt the system to their needs.

a Process Interface may be implemented and it will replace the standard process flow. process interfaces replace the standard process. If for some reason the standard procedure does not match the client needs.BTE's Types of Interfaces Two types of interfaces exist: • Publish and Subscribe Interface • Process Interface Publish and Subscribe Interfaces These interfaces inform about particular events (such as a document created). this software can not return data to the SAP System. . Examples of this type of interface include: • A document was created. With Process Interfaces you can modify the standard behavior of the SAP System. and the resulting data of these events are made available to external software. Process Interfaces These kind of interfaces are generally used to send business processes to a customer created control. modified or blocked This type of interface does not change the standard processing. that is. modified or deleted • Master Data was created.

How we create BTEs Spro->SAP Reference IMG -> Financial Accounting -> Financial Accounting Global Settings -> Business Transaction Events .

Click on SAP reference IMG .

.

.

.

.

.

It will show the function module related to the that BTE . .In next screen you will in the SE37 tcode.We have to copy that function module into Z or Y function module module to add the code.

click on copy button. Specify the "Z" or "Y" function module name in the To Function Module field .

and the ABAP code is generated for function groups. You will be prompted for a development class and transport when creating the function group. Click on the Change button.Specify a Function Group. If you need to create a "Z" or "Y" function group. In Function Builder (transaction SE37). enter the new "Z" or "Y" function module. A function group is a logical grouping of function modules. . go to transaction code SE37 and follow menu path: Go to Function Groups Create Group. The system will default into the source code screen where you may enter your ABAP code.

.

Save and activate the function module . Now assign the function module "Z_SAMPLE_PROCESS_00001120" to the Event.of a customer. Go to IMG Menu Path: Financial Accounting ->Financial Accounting Global SettingsBusiness Transaction Events-> Settings->Products->-. To assign Function module to the Event. Go to IMG Menu Path: Financial Accounting ->Financial Accounting Global Settings>Business Transaction Events-> Settings->Process function modules->-. otherwise the BTE will not trigger. Click on the "New Entries" button. Test the BTE by creating posting document. Enter the Product name and make sure you select the "Active" check box. .Enter the source code as per the requirement.of a customer. first create a product say "ZTEST".

Thanx .

Sign up to vote on this title
UsefulNot useful