Sunteți pe pagina 1din 5

The Requirement is to put a inIormation message while creating a material iI Material Group

is A05 and Division is: 02.


(Why can`t we use Iield exit ?? : As it needs two inIormation Ior the material and user wants
inIormation message while saving the material. we can`t use Iield exit Ior this).
Step 1:
How to Iind appropriate BADI Ior this requirement??
Put the break- point into Class CLEXITHANDLER`s GETINSTANCE method.
Go to transaction code MM01 , create a material and try to save it. it stops at many location
with diIIerent values oI EXITNAME. (AIter checking into Se18 we got the
BADI_MATERIAL_CHECK which can be use Ior our requirement.
O It has a method CHECK_DATA which is called beIore saving the material.
O It also has WMARA table as input data (Material Group and Division comes in
MARA table).

Step 2:
Go to Transaction code SE18.
Open BADI : BADI_MATERIAL_CHECK.
Go to menu option Implementation a Create.

Step 3:
Give the implementation name as ZMM_MAT_CHECK.

Step 4:
Double click on the method CHECKDATA.II you notice the input parameters we have
many data related to batch , material and storage location etc..
or our requirement we need material group and devision Which exist in WMARA.Put the
below code inside the method then activate the class and method.
iI WMARA-MATKL eq A05' and WMARA-SPART eq 02'.
message Material creation Ior this Group should be avoided Ior animal products!!` TYPE I`.
endiI.
This code is just checks the material group and division.

Step 5:
Go back and Activate the implementation.

Step 6:
So now it`s the time to Disco !!!!!!!Upsssss Sorry it`s the time to test this BADI.
or this go to transaction MM01 and try to create a material.
(iI you are conIused use material name as CH004 ,
Industry sector as Animal Health and
Material Type as Beverages )
Click on the ENTER Button and Irom the view select BASIC DATA 1.

S-ar putea să vă placă și