cancel
Showing results for 
Search instead for 
Did you mean: 

MGAME during pricing

Former Member
0 Kudos

I am trying to see how KOMP-MGAME structure field gets filled during pricing? can anyone plz guide me as to how this field gets its value (during update pricing).

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Christian thanx.. I will check it out and let you know

christian_wohlfahrt
Active Contributor
0 Kudos

Hi SSG!

E.g. in a purchase order pricing, function module

ME_FILL_KOMP_PO is responsible. Following code might help you:


*- Mengen richtig fuellen  (filling amoung correctly)-----*
  IF i_ekko-bstyp EQ bstyp-best.
    e_komp-mglme = i_ekpo-menge.
  ELSE.
    IF i_ekko-bstyp EQ bstyp-kont AND i_ekpo-abmng GT 0.
      e_komp-mglme = i_ekpo-abmng.
    ELSE.
      e_komp-mglme = i_ekpo-ktmng.
    ENDIF.
  ENDIF.
  IF NOT i_preisfindungsmenge IS INITIAL.
    e_komp-mglme = i_preisfindungsmenge.
  ENDIF.
  IF e_komp-mglme EQ 0.  "falls keine Menge gesetzt --> auf 1 setzen
"if nothing found -> set default 1 
    e_komp-mglme = 1000.  "z.B. bestellte Banf nochmal bestellt
"e.g. re-ordering a purchase requisition
  ENDIF.
*- Menge umrechnen bei abweichender Preiseinheit (convert amount in case of different order price unit)---*
  IF i_ekpo-meins NE i_ekpo-bprme.
    IF i_ekpo-bpumn NE 0.
      refe1 = e_komp-mglme * i_ekpo-bpumz / i_ekpo-bpumn.
      IF refe1 LE maxmenge.
        e_komp-mgame = refe1.
      ELSE.
        e_komp-mgame = maxmenge.
      ENDIF.
    ENDIF.
    e_komp-umvkz = i_ekpo-bpumz.
    e_komp-umvkn = i_ekpo-bpumn.
    e_komp-vrkme = i_ekpo-bprme.
  ELSE.
    e_komp-mgame = e_komp-mglme.
    e_komp-vrkme = i_ekpo-meins.
  ENDIF.

In sales some coding in WV_KOMP_FILL_V is relevant to your question.

But for a detailed explanation, an example has to be checked (debugged!).

Regards,

Christian