Obsceneness Prevention using Material Status (MARC-MMSTA)
Introduction and Purpose of the Topic:
Generally every business keeps focus on continuous product development and keeps changing and improvising the product specifications and features. How ever, for the existing customers, who are using the earlier version of the product, companies are compelled support, service spares requirement. In terms of inventory management, this means that a material, which used to be procured / manufactured with a nominal control on inventory, face a risk of obsolescence over a period of time. This calls for a very cautious inventory management. Hence, when we have to support such situation, Sourcing and inventory managers like to monitor the procurement strictly against a confirmed requirement, rather than procuring to stock
In most of the cases Business often procures the materials for stock and Some times due to business difficulties the procured stock will not get utilized either for production internally or for a external sale, there by piling of the stock .If the procured stock is of chemical in nature, after its Shelf life gets expires and which requires a quality check for deciding over its further utilization either for a scrap or for extension of its shelf life. In both the cases the valuable time of the Business users will get wasted at the same the money.
In some of the cases some materials which belong to the material types other than the material type UNBW will be with a standard cost zero with a notation to the users these materials need to be procured for consumption/for account assignment. However users often create Pos with out account assignment..
If users are restricted to procure the material for stock rather for a purpose?
The forth going paragraphs will depict how this can be achieved.
How to Achieve the Purpose:
In SAP the Material Types Non stock materials (UNBW) and Non Valuated Materials (NLAG) will ask for a account assignment category during the creation of PO there by the Buyer to enter the same and during its Goods Receipt system posts the documents against the consumption account.
The same functionality has been utilized for the purpose to see that the costs are posted against the account assignment and no stocks are visible at MMBE there by causing problems at a later date.
Process of Achieving the Purpose:
Using these particular scenario users 1.Will be restricted to create the PO with account assignment for the materials in question, there by reducing the inventory related issues at a later date.
Let us now see how this particular purpose is achieved through the settings in SAP.
- Creation of a Material status.
- Insertion of the code in the function module MEX_PSTYP_KNTTP.
This piece of code will check for the new material status in the material master for the material which is being created for a PO and if the material status in the material is the new material status created , gives a error message for the user saying that ‘Account assignment Category is mandatory for the item’. And which will not allow saving the PO unless the Account Assignment category details are provided.
1.Creation of the material status.
At SPRO—Logistics General—Material Master—Settings for key fields—Define Material Status
Here a new material status will be created with no controlling functions .The following is the screen shot for the same.
2.Insertion Of the code in the function Module MEX_PSTYP_KNTTP
At SE37 for the above function module, the following code will be added at the relevant place. The below code only provides a guide line for the logic .
select single * from marc into wa_marc
where matnr = im_matnr and
werks = im_werks.
if sy-subrc = 0.
IF wa_marc-mmsta = ’09’.
MESSAGE E062(ME) with im_MATNR.
Result of the Code:
The above code during its execution while creation of the Purchase Order will check for the material status in the material and if it equals with the newly created material status defined for this purpose, it will initiates the error message to stop further creation of the PO and ‘save’ rather issue a Error Message ‘E062’ which is ‘Account Assignment Category is Mandatory for the material.
Users will need to enter the Account Assignment Category details for creating the PO.
Basically the above process will restrict the users to create the Pos only with account assignment category to those materials which have been assigned with the material status and acts as a controlling and preventive mechanism for procurement of materials there by reducing the inventories and their costs and time.
This is a modification. Would't it be better to do the same check in an exit or BADi?
That is correct. The same check may be done in function exit EXIT_SAPMM06E_013
Strange recommendation. After making such a modification may refuse SAP company operating support system.
You might want to change the word 'obsceneness' in the title too. Look up 'obsolete' and then look up 'obscene'.