Thursday, May 18, 2017

Simple BADI for Material Check

At the time of material creation we often activate Batch Management. It means different materials will have different batches. Hence, material & batch both will behave as a unique. At this point the Valuation Category needs to be activated. If we don’t activate Valuation Category then there will be no meaning to activate batch management. Because Valuation Category always ensures that the different batch will hold different price of the materials. If it is not activated in this case, then all materials need to satisfy average price of the batch. At this point the valuation will be wrong for those materials.

In the following BADI we have created a simple logic by which Valuation Category will be mandatory if Batch Management is activated at the time of creating a material; t-code MM01. The required BADI is BADI_MATERIAL_CHECK. Now we implement this step by step.

1. Go to SE18 & enter BADI name and display.


2. We need to add our custom code inside the CHECK DATA.


3. Go to SE19 & enter the BADI name and create Implementation.


4. Enter implementation name and then go to Interface.


5. Double click on CHECK DATA method.


6. It will open with the editor. Write the required code here. Then save -> check -> active.


7. Go back and click on the Active button. By this the BADI is activated.


Required Code:


  METHOD if_ex_badi_material_check~check_data.

    
IF    wmarc-xchar = 'X'
      
AND ( wmara-mtart = 'ROH' OR wmara-mtart = 'VERP' )
      
AND sy-tcode = 'MM01'.

      
IF wmbew-bwtty IS INITIAL.
        
MESSAGE 'Valuation Category is mandatory (Value = X)'
        
TYPE 'I' DISPLAY LIKE 'E'.
        
LEAVE LIST-PROCESSING.
        
LEAVE TO SCREEN sy-dynnr.
      
ENDIF.
    
ENDIF.

  ENDMETHOD.

Material Creation:

1. Now go to MM01.


2. Select the required views and enter.



3. Enter plant & s-loc, and then enter.



4. Check the Batch Management.


5. Create the Inspection Setup.




6. Now keep Valuation Category blank and then try to save the material.


7. It will give the Information (display like error) message.


8. Now enter the Valuation Category and the save the material.




9. The material has been created and we can check the Valuation Category details in the MARC table.


53 comments:

  1. Thanks for sharing a usefull good information and it is a nice blog keep sharing these type of blogs sap abap training in hyderabad

    ReplyDelete
  2. Very informative blog...SAP ABAP real Time Hands on Training in Chennai…

    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    CONTACT:8122241286

    Both Classroom/Online Training is Available.

    ReplyDelete

  3. Thank you. sir, Really I like your post on. sap videos

    ReplyDelete
  4. Thank you for Sharing Great Information. It is Very Helpful Information on. sap training videos

    ReplyDelete

  5. I get a lot of great information from this blog on. sap videos tutorials

    ReplyDelete
  6. Thank you for Sharing Great Information. It is Very Helpful Information on sap video tutorials

    ReplyDelete

  7. Thankyou for Sharing Great Information. It is Very Helpful Information on. sap videos

    ReplyDelete
  8. Thank you for information excellent blog have a great possible sap training videos

    ReplyDelete
  9. Thanks for sharing this informative blog..Your blog is really useful for me. sap video training


    ReplyDelete

  10. The information you have posted here is really useful and interesting too & here sap videos online

    ReplyDelete

  11. It was so nice article.I was really satisfied by seeing this article.sap video

    ReplyDelete
  12. Thankyou for Sharing Great Information. It is Very Helpful Information on. sap video training

    ReplyDelete
  13. Well it Was Very Good Information. Thanks for sharing this Information. sapvideos

    ReplyDelete
  14. Thankyou for Sharing Great Information. It is Very Helpful Information on. sap video

    ReplyDelete
  15. Thank you for Sharing Great Information. It is Very Helpful Information on..sap video tutorials

    ReplyDelete
  16. I get a lot of great information from this blog. sap video training

    ReplyDelete

  17. it has great information it is very useful Post. sapvideos

    ReplyDelete

  18. Well it Was Very Good Information. Thanks for sharing this Information. sap videos tutorials

    ReplyDelete
  19. it has great information it is very useful Post. sap tutorial videos

    ReplyDelete
  20. Fabulous..!!! The information you Provided is much useful..sap video

    ReplyDelete
  21. This article is really contains lot more information. sap video tutorials

    ReplyDelete

  22. Fabulous..!!! The information you Provided is much useful. sap video training

    ReplyDelete
  23. It was so nice article.I was really satisified by seeing this article sap video tutorials.

    ReplyDelete

  24. Thank you. sir, Really I like your post on sapvideos

    ReplyDelete
  25. Thanks for Nice and Informative Post on. sap tutorial videos

    ReplyDelete

  26. This article is really contains lot more information. sap videos tutorials

    ReplyDelete
  27. Fabulous..!! Thank you.The information you provided is much usful information on sap video training.

    ReplyDelete

  28. This article is really contains lot more information. sap videos

    ReplyDelete
  29. Thanks for sharing this informative blog..Your blog is really useful for me. sap videos online

    ReplyDelete
  30. Thankyou for wonderful article. It has more Information in Your Website sap training videos.

    ReplyDelete

  31. Fabulous..!!! The information you Provided is much useful..sap video tutorials

    ReplyDelete
  32. Thanks for sharing this informative blog..Your blog is really useful for me..sap video tutorials

    ReplyDelete

  33. It was so nice article.I was really satisfied by seeing this article. sap tutorial videos

    ReplyDelete

  34. It was so nice article.I was really satisfied by seeing this article. sap video

    ReplyDelete

  35. Well it Was Very Good Information. Thanks for sharing this Information. sapvideos

    ReplyDelete
  36. Thank you. It is such a wonderful post. sap video training

    ReplyDelete
  37. Thank you for giving this best information. It’s a very nice topic. sapvideos

    ReplyDelete

  38. This article is really contains lot more information about. sap video training

    ReplyDelete
  39. Thanks for the great information in your blog on It was so nice article Thank you for valuable information sap video

    ReplyDelete
  40. This article is really contains lot more information about This Topic on. sap video tutorials

    ReplyDelete
  41. Very good write-up. I definitely appreciate this website. Continue the good work!
    Hybris Training

    ReplyDelete
  42. Fabulous..!! Thank you.The information you provided is much usful information on sap video learning.

    ReplyDelete
  43. Thankyou for Sharing Great Information. It is Very Helpful Information on sap s4 hana training videos.

    ReplyDelete
  44. Thankyou for Sharing Great Information. It is Very Helpful Information on sap fiori training videos.

    ReplyDelete
  45. Thank you. It is such a wonderful post. it has great information it is very useful for sap fiori training videos.

    ReplyDelete
  46. Thankyou for wonderful article. It has more Information in Your Website sap video download.

    ReplyDelete
  47. It was Nice post and very useful information on sap video training.

    ReplyDelete

  48. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
    sas implementation services

    ReplyDelete

Note: Only a member of this blog may post a comment.