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
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.
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.
Short quick summary to catch the reader's attention and of course the search engine