Know Which MRP Type Not To Use

Jimbo's picture

Plant StockAccording to SAP's support portal, the "central role of MRP is to monitor stocks and in particular, to automatically create procurement proposals for purchasing and production (planned orders, purchase requisitions or delivery schedules)." This makes perfect sense, but doesn't explain when SAP will reject an MRP view by throwing a "Specify a valid MRP procedure" error.

It goes without saying that the MARC-DISMM value is a required field when extending a Material Master to a MRP view, but not clear is when SAP will reject an MRP Type that describes consumption planning. Knowing when this error will be thrown enables a Data Migration professional to produce meaningful validation reports that allow for the mapping (or the system configuration) to be corrected instead of allowing the plant extension records to fail.
Specify a valid MRP procedure

The way that SAP knows whether a Material Type is expected to experience consumption in a particular plant is with the T134M table's MENGU field. When it is ticked (the value is "X"), the MRP Type can be one that is consumption-based, but when it is not, the system expects no MRP view or a MRP Type that has no planning defined like ND.
T134M MENGU field

Plant StockA simple snippet of code can prevent this error from interrupting a Material Master plant extension load. Start by declaring a variable in the GLOBAL_DATA that can be used to interrogate the T134M and MARA tables.

data: lT134M like T134M, lMARA like MARA.

Next, ensure that any MRP View extension has an appropriate MRP Type. While it is easy enough to declare an MRP type that expects no consumption planning, most SAP implementations use ND for that.

if sMARC-DISMM ne 'ND'. 
  "*** Following code assumes MATNR previously validated. ****
  select * from MARA into lMARA where MATNR like sMARC-MATNR.
    select single * from T134M into lT134M
     where BWKEY = sMARC-WERKS
       and MTART = lMARA-MTART
       and MENGU = 'X'. 
    if sy-subrc ne 0. "No Quantity Updating.
      write: / sMARC-MATNR, sMARC-WERKS, sMARC-DISMM, 
       'No consumption planning for this material type in this plant.'.
      skip_transaction.
    endif. 
  endselect.
endif.

Additionally, watch out for Material stock transfers (movements) into plants where no Quantity Updating is expected. This will likely fail.

This T134M also has a field WERTU that tells SAP when stock of a particular Material Type is valuated. That is a great way to know in advance when a material should have Accounting and Costing views in a particular plant.

Dilbert Inventory

Programming Language: 
ABAP