I want to programmatically change the moving/average price(s) of materials for the following special case:
VPRSV = 'S' (Standard price)
MLMAA = 'X' (Material Ledger activated)
MLAST = '3' (Material Price Determination = '3' (Single-/Multilevel))
period = current
It has to work when there is already a material document for the given material in the current period. All other special cases that I need are solved.
I am searching for the function module equivalent of changing the moving average price using MM02
, not MR21
.
Maybe BAPI_MATVAL_PRICE_CHANGE
is what I'm searching for?
What confuses me is that I cannot find a parameter that determines that I want to change the moving average price and not the standard price. Did I miss a parameter? If not, does it change the standard price or moving average price?
And I'm not sure whether this function module is the equivalent of MM02
or MR21
.