Skip to end of metadata
Go to start of metadata

Applies to:

SAP ECC 6.0 (Release 700, SP 12).


This article explains how to Change the Price of materials as in MR21 using function modules.

Author(s) :  Rahul Babukuttan

Company:     Applexus Technologies (P) Ltd.

Created on:    28 November 2011

Author(s) Bio

Rahul Babukuttan, Applexus Technologies (P) Ltd.
B.Tech Computer Science Graduate, working as SAP Technology Consultant.

Table of Contents


The transaction MR21 is used to change the price of a material.

Price change

Go to transaction MR21. We need to enter posting date, Company code and plant.

We need to enter Material, valuation type(if applicable) and new price and new price unit for the material.

On Save, the price change document will be posted. 

Price change using function modules

Here we are using 3 function modules to change the price.



1. Here it is assumed that the material is a valid, which is existing in the MARA table.
2. The material entered should be available within the plant entered i.e. a valid entry in the MARC table for   the material and plant.
3. There exist and entry in the table T001k for the given plant and company code.
4. The fiscal year and the period can be calculated from the posting date by using the function module FI_PERIOD_DETERMINE.
5. The valuation type given to the material should be correct. If there exists a valuation type and we leave the field as incorrect the function module will throw an error.

Price Change Overview

Before using the function module PRICES_PROPOSE, we need to build an internal table T_MATPR which contains the material and validation type (if applicable).

If we want to add multiple material items we can do that too.

The function module will propose the price of the document. ie, if we look into the table T_MATPR, it will automatically fill with the new price with the current price. The internal table T_MATPR is having a deep structure. We can change the new price and new price unit by looping the table T_MATPR.

Here the field XERROR should be cleared for the materials if there is any change in the new price, ie, if the new price and the current price is different. The document is posted successfully only if there is minimum one material with field XERROR equal to space.

After the PRICES_CHANGE function module we call the function module PRICES_POST.


After executing these function module, if success, it will show a status message saying the Price change document 'doc no' posted.

Related Content

Useful Information

Short quick summary to catch the reader's attention and of course the search engine


  1. Former Member



    If we set Price control V how above step works & In which level system updates the price.

    Thank you


    1. Hi, the comment that follows, this is what you need


  2. En este post, hacen el cambio de precio para el material con precio estándar. Pero si requieren hacerlo para precio variable deben considerar las siguientes campos en la estructura de la tabla t_matpr-cr

    wa_matpr_cr-newpvprs   = lv_valor.              "Precio Variable 

    wa_matpr_cr-manpae_v  = ABAP_TRUE.   "Indicador: Precio sustituido manualmente (para precio variable)

    Del resto sigue igual como indica  Rahul Babukuttan en este post