title: Changing average price in Material Master (MM02) programmatically
body: <p>I want to programmatically change the moving/average price(s) of materials for the following special case:</p>
  
  <pre><code>VPRSV = 'S'  (Standard price)
  MLMAA = 'X'  (Material Ledger activated)
  MLAST = '3'  (Material Price Determination = '3' (Single-/Multilevel))
  period = current
  </code></pre>
  
  <p>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.</p>
  
  <p>I am searching for the function module equivalent of changing the moving average price using <code>MM02</code>, not <code>MR21</code>.</p>
  
  <p>Maybe <code>BAPI_MATVAL_PRICE_CHANGE</code> is what I'm searching for? </p>
  
  <p>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? </p>
  
  <p>And I'm not sure whether this function module is the equivalent of <code>MM02</code> or <code>MR21</code>.</p>