Classical BADI Part 3

 

  • In this portion we will see the third way to find a classical BADI and then we will implement it based on a real life scenario.

Let’s take a requirement.

  • While creating a material through MM01



    • I want if basic unit of measure is each then material group must be 00ROH.




Finding the Classical BADI

  • Step 1 :- Go to MM01 transaction code.

  • Step 2 :- Click on System → status.

  • Step 3 :- Copy the program name.

  • Step 4 :- Then go to SE38 transaction code and select the attributes radio button and pass the name of the program and click on display button.

  • Step 5 :- Copy the name of the package.

  • Step 6 :- Go to SE84 transaction code → Enhancements → Business Add-Ins → Definitions.



  • Step 7 :- Pass the package name and click on execute button.



    • It will show us all the BADI present in that particular package.
    • For our requirement the suitable BADI is BADI_MATERIAL_CHECK.

Implementing BADI for the given requirement :-

  • Step 1 :- Go to SE19 transaction code.



  • Step 2 :- Click on create button and give a name for your BADI implementation.



  • Step 3 :- Click on OK button and give a short description for the BADI implementation.



  • Step 4 :- Go to interface tab and you will see a implementing class will appear automatically.



  • Step 5 :- Double click on the implementing class → double click on method check material → It will take you to the source code.



  • Step 6 :- Now we will write the logic in this given method.



  • Step 7 :- Always activate the written code and also activate the BADI in which you are writing the logic.


Testing the BADI implementation :-

  • Step 1 :- Go to MM01 transaction code and create a material.



  • Step 2 :- Press enter and pass the below details.



  • Step 3 :- Click on save button.



    • We have got this message that we have implemented inside the class that for basic unit of measure EA our material group cannot be 00ROH.

Important Note :-

  • Always de activate the BADI after practicing it.
  • Just go to SE19 transaction code and open the created BADI in change mode and click on deactivate button to deactivate the BADI.

Comments

Popular posts from this blog

Understanding Different Types of SAP Function Modules: Normal, RFC, and Update

Unlocking SAP ABAP Secrets: Interactive Classical Reports with GET CURSOR, At User Command, and a Comparison of HIDE Statements

Mastering ABAP: A Step-by-Step Guide to Function Modules and Groups for Modularized Programming