Classic BADI Part 2
- In the previous part we saw, how we can find our classic BADI through debugging.
- In this part we will see how we can find the classic BADI for our requirement other than using debugging.
Requirement :-
-
Let’s take a requirement other than what we have used in the previous part.
-
Our requirement is that during creating of the material from MM01 transaction code, if basic unit of measure is EA (each) then material group should not be 00ROH.
Finding Classical BADI :-
-
Step 1 :- Copy the Program name of MM01 transaction code.
-
Step 2 :- Go to SE38 transaction code and select the attributes tab radio button and pass the program name and click on display button.
-
Step 3 :- Now go to SE18 transaction code → Select the BADI Name radio button and click on F4 help → Click on New Selection and pass the package name.
-
Step 4 :- Click on OK button.
-
It will show us the list of all the BADI available for the given package.
-
Since, we have to perform some checks on the material data therefore we will use 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
Post a Comment