Sei sulla pagina 1di 7

6/6/2019 Classic BADI with Multiple Use (Multiple Implementation) without Filter – SAPCODES

SAPCODES

ABAP OO-ABAP ENHANCEMENTS RFC & BAPI ALE-IDOC USEFUL PROGRAMS WEBDYNPRO

FPM WORKFLOW HANA ODATA-UI5 BASIS JOBS POSTS

CLASSIC BADI WITH MULTIPLE USE (MULTIPLE IMPLEMENTATION) WITHOUT FILTER


 November 20, 2015  Leave a comment
Search … 

 Scenario: Creation of Classic BADI definition with multiple use and creation of
BADI implementations and calling the BADI implementations from program.
RECENT POSTS
Step1. Go to TCODE- SE18.
UI5 App Table with
JSON Data Model-2
UI5 App Table with
JSON Data Model
UI5 APP- Simple Form
with JSON Data Model
Prepaid & Postpaid
Payment Group in Hybris
Step2. Provide the BADI name and go to the menu Utilities and Click on Create
Billing
Classic BADI .
CI Partner Settlement
CRM – Partner Product
Settlement Rule
CRM
Standard/Revenue Sharing
Product
CRM Product Hierarchy
& Category

Enter your email address


Step3. Provide a short description. In the properties section, the system
automatically generates a BADI Class based on the BADI name. In the TYPE
Follow
section, select multiple use option which indicates that this BADI can be used
for multiple implementations . Click on the Interface tab.

BLOG STATS

1,141,795 hits

RECENT COMMENTS

UI5 App Table


with J… on UI5
App Table with
JSON Data M…
Phani on oData
service which
consumes R…

https://sapcodes.com/2015/11/20/classic-badi-with-multiple-use-multiple-implementation-without-filter-condition/ 1/8
6/6/2019 Classic BADI with Multiple Use (Multiple Implementation) without Filter – SAPCODES

Step4. The system also generate a Interface based on the BADI name.Now Anonymous on
double click on the interface name ‘ZIF_EX_BADI_DEFN_DEMO2’. Using Standard
Text in Adobe
F…

This site is maintained by


Siva Prasad . This site
sapcodes.com is not
a liated with SAP SE.

Step5. It navigates to SE24 transaction. Now in the ‘METHODS’ tab, provide a


method name as ‘SHOW_MESSAGE’, select the level and provide the
description and activate the interface. At last Click on the BACK button.

Step6. Creating a BADI Implementation. Go to TCODE – SE19. Under the


CREATE Implementation Section, Select the Radio button classic badi and
provide the BADI definition name created above and click on the Create Impl.
button and it ‘ll show a popup screen . Provide the Implementation name as
‘ZBADI_DEF2_IMPL1’ and click on the continue button.

Step7. Provide a implementation short text and click on the Interface Tab.

https://sapcodes.com/2015/11/20/classic-badi-with-multiple-use-multiple-implementation-without-filter-condition/ 2/8
6/6/2019 Classic BADI with Multiple Use (Multiple Implementation) without Filter – SAPCODES

Step8. For this implementation the system automatically creates a


Implementing Class which implements the method ‘SHOW_MESSAGE’ of the
interface associated with BADI definition.

Now double click on the method ‘SHOW_MESSAGE’ to implement the method.

Step9. Provide some statement here and then click on the activate button and at
last click on the back button.

Step10. Activate the implementation. Now up to this point we created a BADI


implementation successfully.

https://sapcodes.com/2015/11/20/classic-badi-with-multiple-use-multiple-implementation-without-filter-condition/ 3/8
6/6/2019 Classic BADI with Multiple Use (Multiple Implementation) without Filter – SAPCODES

Step11. Go to TCODE-SE19 and create a second implementation. Under the


CREATE Implementation Section, Select the Radio button classic badi and
provide the BADI definition name created above and click on the Create Impl.
button and it ‘ll show a popup screen . Provide the Implementation name as
‘ZBADI_DEF2_IMPL2’ and click on the continue button.

Step12. Provide a implementation short text and click on the Interface Tab.

Step13. For this implementation the system automatically creates a


Implementing Class which implements the method ‘SHOW_MESSAGE’ of the
interface associated with BADI definition.

https://sapcodes.com/2015/11/20/classic-badi-with-multiple-use-multiple-implementation-without-filter-condition/ 4/8
6/6/2019 Classic BADI with Multiple Use (Multiple Implementation) without Filter – SAPCODES

Now double click on the method ‘SHOW_MESSAGE’ to implement the method.

Step14. Provide some statement here and then click on the activate button and
at last click on the back button.

Step15. Activate the implementation. Now up to this point we created BADI


implementation successfully.

Step16. Calling the BADI implementation form the program . Go to TCODE –


SE38 and create a report program.

Step17. Create a reference variable referring to the Interface name associated


with the BADI definition.Then call the static method GET_INSTANCE of the
class CL_EXITHANDLER.
https://sapcodes.com/2015/11/20/classic-badi-with-multiple-use-multiple-implementation-without-filter-condition/ 5/8
6/6/2019 Classic BADI with Multiple Use (Multiple Implementation) without Filter – SAPCODES

Pass the BADI definition name and it ll return the object of the active
implementing class to the reference variable. Activate the program and run it.

Step18. The output is shown as below. Here as the BADI is a multiple use badi
all the active implementations are called.

Information: In case of multiple use BADI, what is the sequence in which


implementations are called?

Ans: Go to the BADI definition and select multiple use and press F1 button for
help. It shows that the run time sequence of active implementations are
unpredictable. That means there is no particular sequence how the active
implementations are called.

https://sapcodes.com/2015/11/20/classic-badi-with-multiple-use-multiple-implementation-without-filter-condition/ 6/8
6/6/2019 Classic BADI with Multiple Use (Multiple Implementation) without Filter – SAPCODES

Advertisements

REPORT THIS AD

REPORT THIS AD

Rate this:

            2 Votes

https://sapcodes.com/2015/11/20/classic-badi-with-multiple-use-multiple-implementation-without-filter-condition/ 7/8

Potrebbero piacerti anche