Skip to Content
author's profile photo Former Member
Former Member

BADI BADI_MATERIAL_REF giving problems in MM02 and MM03

i just implemented BADI BADI_MATERIAL_REF

as we had requirement to auto populate mstav and mstdv in mm01 when user selected Finished good or trading good but it is

causing problem in MM02 AND MM03 as you cannot view materials undergoing this BADI as SAP keeps giving message 'Enter a material type'

method IF_EX_MATERIAL_REFERENCE~CREATE_MATERIAL.

 if SY-TCODE = 'MM01'.
  if I_mara-mtart = 'FG' or I_mara-mtart = 'TRAD'.

  E_MARAU-MSTAV = 11.
  E_MARAU-MSTDV = SY-DATUM.


ENDIF.
ENDIF.

endmethod.

I added SY-TCODE to ensure MM02 and MM03 were not calling this...

Before implementing BADI i had tried this user exit ZXMG0U02 but it only worked when saving in MM01 and would not populate the screen with MSTAV AND MSTDV fields.

if cmara-mtart = 'FG' or cmara-mtart = 'TRAD'.

  CMARA-MSTAV = 11.
  CMARA-MSTDV = SY-DATUM.



ENDIF.

looking in MARA TABLE field MTART is not populated for these materials undergoing badi. BY adding this line in BADI

E_MARAU-Mtart = I_mara-mtart

causes endless loop of entering UOM.

Edited by: Harry Parmar on Feb 25, 2010 6:02 PM

Edited by: Harry Parmar on Feb 25, 2010 6:03 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Mar 10, 2010 at 09:46 PM

    I found the solution to my problem...it seems to be my Questions are never answered on these boards on internet...i guess they are too hard.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.