BADI Overview
-
Upload
helder2607 -
Category
Documents
-
view
266 -
download
2
Transcript of BADI Overview
-
7/30/2019 BADI Overview
1/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 29
%XVLQHVV$GG,QV
As of release 4.6 a new enhancement technique has been established in R/3: Business Add
Ins (BAdIs). The goal of this enhancement technique is to avoid the insufficient parts of theolder techniques, customer exits and SD user exits. This unit is divided into three sections. Inthe first section we want to motivate the necessity of a new technique. The second section willdeal with creating Business Add Ins. Then, in the subsequent section we will learn how toimplement Business Add Ins. Finally, a short summary will conclude this unit.
,QWURGXFWLRQ
This section summarizes the insufficient aspects of the older enhancement techniques toexplain the need for Business Add Ins. One thing that has changed is the software delivery
chain.6RIWZDUH'HOLYHU\&KDLQV
-
7/30/2019 BADI Overview
2/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 30
'LVDGYDQWDJHVRIWKH2OG(QKDQFHPHQW7HFKQLTXHV
There were several disadvantages to the old enhancement techniques:
Customer exits can be used only by one link in the chain
User exits provide only enhancements of source code; technically, they are modifications
Also, business transaction events only enable you to enhance source code.
There is no administrative layer in either user exits or business transaction events.
Business add-ins have been developed to address these shortcomings.
$GYDQWDJHVRI%XVLQHVV$GG,QV
The main advantage of this concept is the capacity for reuse. Once implemented, a businessadd-in can be reimplemented using other links in the software chain. Further advantages are:
Administrative layer to manage business add-ins
Implementation using techniques of ABAP Objects
All enhancement types available (this will be implemented in a future release).
%XVLQHVV$GG,QV$UFKLWHFWXUH
SAP AG 1999
&25(&25(
55
6$36$3 ,6,6 3DUWQHU3DUWQHU &XVWRPHU&XVWRPHU
$GG,Q
DGDSWHU
$GG,Q
DGDSWHU
$GG,Q
DGDSWHU
$GG,Q
DGDSWHU
-
7/30/2019 BADI Overview
3/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 31
Business add-ins, unlike customer exits, take into account the changes to the software
delivery process. The top part of the graphic illustrates the typical delivery process: It no
longer merely consists of provider and user. Instead, it can now contain a whole chain of
intermediate providers. Below this is a diagram explaining how business add-ins work.
Enhancements are made possible using SAP application programs. This requires at least
one interface and an adapter class that implements it. The interface is implemented by theuser.
The main advantage of this concept is the capacity for reuse. Once implemented, a business
add-in can be reimplemented by other links in the software chain (further to the right in the
graphic). Furthermore, an implementation can also offer its own business add-ins.
&UHDWLQJD%XVLQHVV$GG,Q
Business add-ins use the interface concept of ABAP Objects. There is a new transaction SE18 to create business add-ins. You can find it in the ABAP Workbench following the path
8WLOLWLHV%XVLQHVV$GG,QV'HILQLWLRQ. Alternatively, you can start with the Object
Navigator. Here, choose :RUNEHQFK2WKHU2EMHFW . In the popup window, select the%XVLQHVV(QJLQHHULQJtab. Here you find menu items for defining and implementing businessadd-ins.
'HILQLQJ%XVLQHVV$GG,QV,QLWLDO6FUHHQ
SAP AG 1999
'HILQLWLRQQDPHBB%XVLQHVVDGGLQ
GHILQLWLRQQDPH
%XVLQHVVDGGLQ
GHILQLWLRQQDPH
'LVSOD\ &UHDWH&KDQJH&UHDWH&UHDWH
In the initial screen of Transaction SE18, enter the name of the business add-in definition andchoose &UHDWH. On the next screen, enter a short description for the business add-in
definition.
-
7/30/2019 BADI Overview
4/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 32
This next screen consists of a tabstrip. The first tab is the $WWULEXWHV tab. Here you can definewhether the Business Add-In can be single use or multiple use. Moreover, you can define afilter dependence for the business add-in. You can also define a function code for yourbusiness add-in. Using this, you can let the user display an additional menu entry in thecorresponding application. However, the most important component of a business add-in isthe ,QWHUIDFH. Using this, you can define the methods that will contain the additional source
code when a business add-in is implemented.%XVLQHVV$GG,Q'HILQLWLRQ,QWHUIDFH0HWKRGV
SAP AG 1999
6WDWLF,QVWDQFH
6WDWLF,QVWDQFH
1DPHRIJHQHUDWHG%$G,FODVV
,QWHUIDFHQDPH
3DUDPHWHUV ([FHSWLRQV
Choose the ,QWHUIDFHTab to define these methods. Doubleclick the name of the interface. Thesystem displays the Class Builder where you can define the methods that should be providedin that business add-in. To find out how to create the methods, see the Class Builderdocumentation.
Class Builder
When you activate the interface, the system generates a class ("Adapter Class") whichprocesses the implementations of the business add-in.
Advantage of the adapter class:
Multiple use of business add-ins
Adapter class analyses which implementation is passed.
Overall, a business add-in consists of the components depicted in the following graphic:
-
7/30/2019 BADI Overview
5/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 33
%XVLQHVV$GG,QV&RPSRQHQWV
SAP AG 1999
%XVLQHVVDGGLQ
QDPHVSDFH[[[
)XQFWLRQFRGH
$GG,Q
$
GG,QDGDSWHU
DGDSWHU
The following constraints apply to the definition of business add-ins:
A business add-in cannot have a function code as one of its components if you define afilter dependency.
A business add-in cannot be filter-dependent if you define a function code as one of itscomponents.
A business add-in can have only one active implementation, if you define it filter specificor if you define a function code as one of its components.
%XVLQHVV$GG,QV1DPLQJ&RQYHQWLRQV
-
7/30/2019 BADI Overview
6/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 34
%XVLQHVV$GG,Q'HILQLWLRQ1DPLQJ&RQYHQWLRQV
SAP AG 1999
l %XVLQHVV$GG,Q'HILQLWLRQDQ\QDPHDOORZHG
EDGL! 6$3QDPHUDQJH
EDGL! 3DUWQHUQDPHVSDFH
=EDGL! &XVWRPHUQDPHUDQJH
l ,QWHUIDFHDQ\QDPHDOORZHG
,)B(;BEDGL! 6$3QDPHUDQJH
,)B(;BEDGL! 3DUWQHUQDPHVSDFH
=,)B(;BEDGL! &XVWRPHUQDPHUDQJH
l 0HWKRGVDQ\QDPHVDOORZHG
l *HQHUDWHG%XVLQHVV$GGLQ&ODVV$GDSWHU&ODVVQRWWREHFKDQJHG
&/B,0BEDGL! 6$3QDPHUDQJH
&/B(;BEDGL! 3DUWQHUQDPHVSDFH
=&/B(;BEDGL! &XVWRPHUQDPHUDQJH
The naming conventions depicted in the slide apply to business add-ins: Thus, for businessadd-in definitions, you only have to take into account the corresponding name space or
customer name range.
The name of the interface is derived from the name of the business add-in using the followingrule:
The name space prefix first
IF_EX_ by default
name of the business add-in without name space prefix
The name of the interface can be changed arbitrarily. You only have to take into account thename-space rules. The methods are not Repository Objects. So their name is arbitrary, too.
The name of the generated class is fixed, and is composed as follows:
The name space prefix
CL_(;_
The name of the business add-in without name space prefix.
-
7/30/2019 BADI Overview
7/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 35
%$G,,PSOHPHQWDWLRQ1DPLQJ&RQYHQWLRQV
SAP AG 1999
l %XVLQHVVDGGLQLPSOHPHQWDWLRQDQ\QDPHDOORZHG
LPSO! 6$3QDPHUDQJH
LPSO! 3DUWQHUQDPHVSDFH
=LPSO! &XVWRPHUQDPHUDQJH
l ,QWHUIDFHQDPHGHILQHGLQ%XVLQHVVDGGLQGHILQLWLRQ
l 0HWKRGVQDPHGHILQHGLQ%XVLQHVVDGGLQGHILQLWLRQ
l ,PSOHPHQWLQJFODVVDQ\QDPHDOORZHG
&/B,0BLPSO! 6$3QDPHUDQJH
&/B,0BLPSO! 3DUWQHUQDPHVSDFH
=&/B,0BLPSO! &XVWRPHUQDPHUDQJH
The name of the business add-in implementation can be chosen freely within thecorresponding name-space or name range, respectively. The same holds for the name of the
class that is created when you implement a business add in. the system makes the followingproposal for the class:
The name space prefix
CL_,0_
The name of the implementation without name space prefix.
&UHDWLQJD)LOWHU'HSHQGHQW%XVLQHVV$GG,Q
You can create a filter dependent BAdI by marking the corresponding flag in the $WWULEXWHTab.
-
7/30/2019 BADI Overview
8/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 36
&UHDWLQJD)LOWHU'HSHQGHQW%$G,
SAP AG 1999
)LOWHUW\SH
The filter type has to be a data element defined in the ABAP Dictionary. Because a dataelement refers to a domain which itself refers to a value table or fixed single values, the
values for the filter are predefined.
The methods defined in the BAdI-Interface have an additional fixed parameter: FLT_VAL,which has the type of the data element. We will see in the implementation part how this filtervalue is used to select a specific implementation.
6DPSOH&DOOLQJD%XVLQHVV$GG,Q
This section describes an ABAP Program that provides an enhancement as a business add-in
by discussing the program flow, before providing the code itself.
-
7/30/2019 BADI Overview
9/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 37
3URJUDPIRU3URYLGLQJ$%XVLQHVV$GG,Q)ORZ
SAP AG 1999
The graphics shows the flow of an application program that provides a business add-inenhancement. First, declare a reference variable that is a reference to the business add-in
interface. The following example shall provide you with the necessary code for calling abusiness add-in method. Assume that we have created a business add-in with the name
-
7/30/2019 BADI Overview
10/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 38
,PSOHPHQWLQJD%XVLQHVV$GG,Q
Transaction SE19 is used to implement business add-ins.
,PSOHPHQWLQJ%XVLQHVV$GG,QV,QLWLDO6FUHHQ
SAP AG 1999
,PSHPHQWDWLRQQDPH
1DPHRI
LPSOHPHQWDWLRQ
1DPHRI
LPSOHPHQWDWLRQ
'LVSOD\
'HILQLWLRQQDPH
&UHDWH&KDQJH
&UHDWH&UHDWH
Enter a name for the implementation. It has to comply with name space conventions. Forexample, to create an implementation in the customer name range, named =,03/(0(17you would enter this name in the corresponding entry field and press the &UHDWHbutton. Thesystem asks you for the business add-in you want to implement. Enter the name of thebusiness add-in in the dialog box. The next screen displays some tabs. Here you can specifymore details for the implementation of the interface method.
-
7/30/2019 BADI Overview
11/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 39
,PSOHPHQWLQJ%XVLQHVV$GG,QV0HWKRGV
SAP AG 1999
,QWHUIDFHQDPH
1DPHRILPSOHPHQWLQJFODVV
When you double click the name of the interface method, the system navigates to the editorwhere you can enter your source code. Technically, the system creates a new class, the
LPSOHPHQWLQJFODVV=&/B,0B,03/(0(17, which implements the interface that has beendefined in the business add-in definition. If you wish, you can change the name of the class.Within this method you are free to do anything you can do within a class. For instance, youcould call other private methods within the class.
To be performed, the implementation has to be activated!
You can deactivate an active implementation. It will then be no longer carried out.
,PSOHPHQWLQJD)LOWHU'HSHQGHQW%XVLQHVV$GG,Q
To implement a filter-dependent business add-in, you must specify the filter value for thebusiness add-in. Therefore, you must insert specific values for the filter in the $WWULEXWHVfield.
In the following graphic, the implementation is only performed when the implementation iscalled with filter value "AA" or "LH".
-
7/30/2019 BADI Overview
12/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 40
)LOWHU'HSHQGHQW,PSOHPHQWDWLRQ
SAP AG 1999
$WWULEXWHV
6B&$55B,')LOWHUW\SH
,QWHUIDFH
9DOXHV
$$
/+
5HXVDEOH
)LOWHUVSHFLILF
-
7/30/2019 BADI Overview
13/13
ABAP Workbench Delta Guide (3.1-4.6)
SAP AG 41
0RGLILFDWLRQ$VVLVWDQW
After reviewing the following topics, you will be able to:
Explain the concept of Modification AssistantUse the Modification Browser
Understand the upgrade procedure
Explain how to do adjustments with Modification Assistant
Explain how to do adjustments without Modification Assistant
2000 SAP AG. All rights reserved.