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: 

What is business add-ins and business transaction events

Former Member
0 Kudos

Dear All,

Would you mind tell me what it sht business add-ins and business transaction events ?

i still not understand about this after i read the training material

Regards

Luke

4 REPLIES 4

Former Member
0 Kudos

Hi,

Each BAdI has a definition and more than one implementation. The definition means the methods(in class concept) that are used for performing various functions. The BAdI definition can be viewed in SE18 transaction(for standard ones) and user-defined BAdIs can be created in the same transaction as well.

When you create a BAdI definition, an class interface will be automatically created and you can define your methods in the interface. The implementation of the methods can be done in SE19 transaction .

YOu can go through these links...

http://esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf

http://esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt

http://esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc

http://esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc

http://esnips.com/doc/365d4c4d-9fcb-4189-85fd-866b7bf25257/customer-exits--badi.zip

http://esnips.com/doc/3b7bbc09-c095-45a0-9e89-91f2f86ee8e9/BADI-Introduction.ppt

BTE:

Check this link..Very good example..

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/207835fb-0a01-0010-34b4-fef...

rEGARDS

Former Member
0 Kudos

HI

Business Transaction Events

It is also called as Open FI enhancement technique which is based on the following principle:

Application developers must define their interface in a function module. An assignment table is read in the corresponding (generated) code, and the customer modules assigned are called dynamically.

This technique differentiates between enhancements that are only allowed to have one implementation and enhancements that can call multiple implementations in any sequence desired. Both industry-specific and country-specific enhancements may be defined.

What are BAdIs?

• is an anticipated point of extension – these points act like sockets and exist in the original source code

• based on ABAP Objects. BAdI defines an interface that can be implemented by BAdI-implementations that are transport objects of their own

• Important! There are 2 roles: Enhancement Option-provider & Implementer.

• In the above context, Enhancement Implementation can be done only if option (hook) is provided by the Option-provider. In simple words there are no implicit BAdIs.

Note: In the following slides, Definitions are created so as to understand the method of BAdI definition & for example purpose. As stated above this is the role of Enhancement Option-Provider.

Classic BAdIs already exist since SAP Release 4.6

BAdIs have been Re-implemented in ECC7.0 under the new Enhancement Framework & Switch Framework

Classic BAdIs

• To understand what a powerful pattern a BAdI is, we will now define & then implement a BAdI

BADI Class is created automatically.

The various options are described below in detail:

1. Enhanceable: Enhanceability of filter types can only be specified for filter-dependent BADI definitions under very special conditions. For example, the domain belonging to the filter type must be linked with a value table that is of the type E or G. A BADI implementation can then be created in one step by creating a new filter value that is automatically entered into the value table at save and also copied into the transport order of the BADI implementation. In addition, it is also possible to create a new filter value and, at the same time, a BADI implementation with the same name. Naturally, you can also specify existing filter values.

You should select this feature if there is a prerequisite that a new filter value is created together with a new BADI implementation - that is, that BADI implementations are not created solely with existing filter values, although this, too, is possible.

2. Multiple-Use

3. Filter-Dependent

Instance Methods can access all of the attributes of a class and can trigger all events of a class. Static Methods can only access static attributes and static events.

Adding event handling & exception(s) is not a necessary step…

Exceptions:

Events:

Events can be defined in classes or in interfaces. Corresponding methods can trigger these events with the RAISE EVENT statement. Each class (or interface) that is going to handle the corresponding event must implement a relevant handler method, and register it using the SET HANDLER statement. When an event occurs, the system calls all of the handler methods registered for that event.

Like method definitions, events have a parameter interface. The only difference is that events may only have EXPORTING parameters.

Save and activate the BAdI definition!

BADI Implementation

BAdI Implementation (SE19)

Save and activate the BAdI implementation!

Implementation for SAP provided BAdI…

Roles: (BADI Definition & Implementation)

• Developer: Enhancement (BAdI) Option-Implementer

• SAP: Option-Provider

BAdI as a ‘controlled’ Enhancement Option:

• Option-provider defines the interface and limits the implementer to the class that the implements the BAdI

• Assured that BAdI implementer can only change the parameters handed over to the BAdI by the option provider

Steps:

1. Search for the BAdI corresponding to the transaction

2. Create a custom Implementation for the BAdI by adding code in the appropriate method

3. Test that the method with custom code is invoked on executing the transaction.

Create Material using MM01. Copy from existing Material.

Select the required views.

Enter mandatory data and click on Save.

Check the Exit Name ‘BADI_MATERIAL_CHECK’. This is the BAdI we are going to implement.

Implementing the BAdI ‘BADI_MATERIAL_CHECK’

Go to SE18 & check the BAdI definition (Methods)

We will be using the ‘CHECK_DATA’ method. Double Click to see the Method Parameters.

Implementing BADI

Go to SE19. Specify a name for the BAdI Implementation.

Enter the Definition Name.

Double-click the method ‘CHECK_DATA’ to enter the source code

Double-click the method ‘CHECK_DATA’ to enter the source code

We are only showing an message in this case; if division in ‘Basic Data’ tab of Material Creation is not entered.

The structure CMARA is defined as ‘Exporting Parameter’. Data can be modified using this.

Activate the Implementation

Testing the BAdI

Testing the BAdI implementation (BADI_MATERIAL_CHECK)

MM01 / MM02 and create / change material and save. On clicking Save, our BADI will trigger.

Message is displayed (Division not entered)

BAdIs…in the new Enhancement Framework (ECC 6.0)

• How the new BAdIs differ from the Classic BAdI?

• Good news is that…basic thing about the BAdI remains the same!

• Differ in the manner in which new BAdI is embedded in the container-structure of the Enhancement Framework

• Better performance & Lower Memory consumption

• Evaluates as much information as possible during compile time

• 40-600 times faster than Classic BAdIs

• Internal handle-class integrated in the SAP Kernel

• Provides ‘switchable’ implementation(s) through use of Switch Framework

• Special optimizations with ‘GET BADI’ & ‘CALL BADI’ (new ABAP commands)

• Implementation Inheritance

Usage of old (classic) BAdIs versus New BAdIs…

• Two new ABAP commands for the new BAdI:

• GET BADI : all active implementations are selected and the method of BAdI is called (amounts to a loop with different method calls in it)

Enhancement Spot as a container for BAdI…

• Enhancement Framework has containers for BAdI implementations as well

Former Member
0 Kudos

Hi LukeWong ,

BAdi:

SAP Business Add-Ins (BAdIs) are one of the most important technologies used to adapt SAP software to specific requirements. BAdIs were introduced with Release 4.6 and replace function module exits. This technology is not limited to SAP applications. BAdI calls can be integrated in customer applications. These can then be enhanced by other customer applications. In the various SAP applications, BAdI calls are implemented at places where enhancements are appropriate.Business add-ins are enhancements to the standard version of the system. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.

As with customer exits, two different views are available:

· In the definition view, an application programmer defines exit points in a source that allow specific industry sectors, partners, and customers to attach additional coding to standard SAP source code, without having to modify the original object.

· In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard solution, if one is available.

In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, country-specific versions, industry solutions, partner, customer, and so on). You can create definitions and implementations of Business Add-Ins at any level of the system landscape.SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.

The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to differentiate between Add-In implementations using the filter Country or other criteria.

The enhancement technique is set up in such a way that it is possible to define interfaces for ABAP soure code, screens, GUI interfaces, and tables. These allow customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task.

BADI is just an object-oriented version of user-exit. Instead of entering program code into some function module (as in customer-exit), you define some class which has to implement predefined methods and those methods are fired at predefined points just like an old user-exit. Some BADI can have multiple independent implementations which is much better for software deployment as several developers can implement the same BADI independently. BADI/UserExists are used to enhance R/3 For customer Needs.

Actually there is no transaction to find when and where the BADI

is called.

1. You can see the BADI description to find why it is called.

2. Once you implemented and activated the BADI, put some break points

in the BADI and see "where else used" option to check in what all

programs this BADI is called. In the ITS debug, when you are doing

the operation what exactly the BADI description tells, it will take

to the break points and you have to do manually debug the whole thing.

I know its bit difficult to do manual debug the whole thing, it

takes lot of time, but you have to be very patience when you are

dealing with BADI's.

Transaction SE18 is the BADI equivalent of transaction SMOD

Transaction SE19 is the BADI equivalent of transaction CMOD .

To find the BADI to be implemented and then implement this via SE19.

These steps should enable you to find any BADI related to any transaction in a matter of minutes.

Procedure 1:

1) Go to the transaction SE37 to find your function module.

2) Locate the function SXV_GET_CLIF_BY_NAME.

3) Put a breakpoint there.

4) Now open a new session.

5) Go to your transaction. 6) At that time, it will stop this function.

7) Double click on the function field EXIT_NAME.

😎 That will give you name of the BADI that is provided in your transaction.

Business Add-Ins

Procedure 2:

1) Goto se24 (Display class cl_exithandler)

2) Double click on the method GET_INSTANCE.

3) Put a break point at Line no.25 (CASE sy-subrc).

4) Now Execute SAP standard transaction

5) Press the required button for which you need to write an exit logic, the execution will stop at the break point.

6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.

7) This way you will find all the BADIs called on click of any button in any transaction

Check this blogs 2 find a BADI:

How To Define a New BAdI Within the Enhancement Framework (Some Basics About the BAdI,BAdI Commands in ABAP,

When to Use a BAdI?)

/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series

How to implement a BAdI And How to Use a Filter

/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework

Introducing Business Add-Ins

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f3202186-0601-0010-6591-b832b1a0...

How to implement BAdi in Enhancement Framework

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb9...

Business Add-Ins

http://help.sap.com/saphelp_47x200/helpdata/en/ee/a1d548892b11d295d60000e82de14a/frameset.htm

BAdI: Customer-Defined Functions in the Formula Builder

http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm

Difference Between BADI and User Exits

http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm

To Use BADI - Business Add In you need to Understand ABAP OO Interface Concept

http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm

Business Transaction Events

Business Transaction Events (Open FI) The Open FI enhancement technique was developed in the Financial Accounting component. Open FI is based upon the following principles: Application developers must define their interface in a function module, an assignment table is read in the accompanying (generated) code, and the customer modules assigned are called dynamically. This technique differentiates between enhancements that are only allowed to have one implementation and enhancements that can call multiple implementations in any sequence desired. Both industry-specific and country-specific enhancements may be defined.

SAP business transaction events are one type of customer enhancements provided by SAP! We can access the business transaction events using FIBF.Next we have to find the process interface for duplicate invoice check!

check this blog for details on SAP business transaction events

Business Transaction Events

http://fuller.mit.edu/user_exits/business_transaction_event.htm

FI Enhancement Technique – How-To-Guide on the Usage of Business Transaction Events (BTE)

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/207835fb-0a01-0010-34b4-fef1240b...

Creation of Events via Business Transaction Events

http://help.sap.com/saphelp_nw04/helpdata/en/3b/7f3e8be57c11d1951f0000e82dec10/content.htm

In SAP R/3 you must activate the business transaction events (BTEs) for Availability Check Using SAP R/3. To set this indicator in SAP R/3:........

http://help.sap.com/saphelp_crm40/helpdata/en/b6/de3efc6bbcdc4b948d466857a10323/content.htm

cheers!

gyanaraj

****Pls reward points if u find this helpful

Former Member
0 Kudos

Thank you very much