Tips & Tricks about MM-IM*
The intention of this first posting is to offer a kind of overview about common issues faced by MM-IM consultants. The purpose of this page os to help consultants who are initially beginning in the Inventory Management component.
The following sections will explain the most common MM-IM scenarios and issues, expose possible tips, solutions, how and what to check on each case, links to SAP Notes and SAP KBAs, and important documentation.
1. Process Overview
The process supported by SAP Inventory Management functionality allows a company to meet customer needs for the availability of material.
Inventory Management within SAP gives to the customer an effective set of processes for all types of goods movement within the plant. Streamlining plant processes can help companies to compress order-to-delivery time, decrease costs, reduce inventory, and improve customer service.
The Inventory Management component deals with the following tasks:
- Management of material stocks on a quantity and value basis,
- Planning, entry, and documentation of all Goods Movements,
- Carrying out the Physical Inventory.
The stock is updated whenever a transaction is posted which implies a change in the stock. This way it is possible to obtain an overview of the current stock situation of any given material at any time.
The stocks are managed not only on a quantity basis but also by value. The system automatically updates the following data each time there is a goods movement:
- Quantity and value for Inventory Management,
- Account assignment for cost accounting,
- G/L accounts for financial accounting via automatic account determination.
Goods movements include both “external” movements (goods receipts from external procurement, goods issues for sales orders) and “internal” movements (goods receipts from production, withdrawals of material for internal purposes, stock transfers and transfer postings).
For each goods movement a material document is created which is used by the system to update quantities and values and serves as proof of goods movements.
Finally, it is possible to carry out a physical inventory of the company’s warehouse stocks in order to adjust any possible unbalance between the quantities stored in the system and the quantities really present in the warehouse (unbalances can arise as a consequence of damaged goods, stolen goods, etc).
The Inventory Management Process happens at the Plant level and its relationship with the Storage Locations within the Plant.
All relationships between the Storage Location and its Storage Types, Warehouse Number, Storage Area and Storage Position are approached by the Warehouse Management Process (LE-WM* component).
The Inventory Management Process depends on the material master data creation. However, all issues related to material master data belongs to General Logistics area (LO-MD-MM component).
2. Goods Movements Scenarios: The Movement Types
The Inventory Management process within SAP means movements inside the plant that can create a change in stock levels within the storage locations designated to that plant. The movement of stock can happen in different ways like goods receipt, goods issue, a stock transfer between plants, or an internal transfer within a plant.
For every goods movement, the SAP system can create two types of documents: a material document and an accounting document. The SAP system follows the accounting principle that for every material movement, there is a corresponding document that provides details of that movement. In addition, an accounting document is produced that describes the financial aspects of the goods movement. However, the accounting document is only relevant if the material is valuated.
The material document is produced for each movement type. It contains the date of the material movement, the material number, the quantity of the material moved, the location of the movement, the batch number if applicable, and the movement type.
Changes cannot be made to the material document after it has been posted, except when you are only changing the header and item text. If an error was made on the material movement, it has to be reversed and the movement correctly entered. This will produce a material document for the reversal and then a new material document for the correct movement.
The database tables to keep the material documents are:
MKPF | Material document header-data |
MSEG | Material document item-data |
And the Key-fields are:
MANDT | Client |
MBLNR | Material document number |
GJAHR | Fiscal year |
ZEILE | Line number (only in MSEG) |
To check material documents you can directly display via transaction MB03 or search for material documents via transaction MB51.
The same goods movement can be posted on-line using different transactions or by means of BAPIs or Idocs.
What really identifies a goods movement is the movement type: It is a three-digit code which differentiates between the various kinds of goods movements which can be entered in the system.
Movement type is a key to generate a material document which identifies a goods movement.
Characteristics of Movement Types:
- Three-digit identification key for a goods movement
- Quantity control (stock tables)
- Value control (FI document, account determination)
- Screen layout (dialog only)
- GR/GI slip print
- Checks (min. shelf life, dynamic availability, etc.
- Link to WM, QM, serial numbers
Classification of Movement Types:
1xx | GR from purchasing/production + returns |
2xx | GI for consumption |
3xx | Transfers |
4xx | Transfers for Special Stock |
5xx | GR without reference to PO or PP order |
6xx | LE-SHP movement types |
7xx | Physical inventory (MM-IM: 70x / WM: 71x) |
8xx | Brazilian Movements and Industry solution |
9xx, Xxx, Yxx, Zxx | Customer range |
The different movement types are documented in the IMG.
In any internal test system or in customer’s system you can check the documentation of the movement type going to the transaction SPRO, then “SAP Reference IMG” (or F5), and open the path:
SPRO
> IMG
>> Materials Management
>>> Inventory Management and Physical Inventory
>>>> Movement Types
>>>>> Copy, Change Movement Types
Once you are in this last activity “Copy, Change Movement Types” do not execute the transaction, but click in the “IMG activity documentation icon” instead. You will be able to see the some general information concerning the movement types and then specific information for every single movement type.
To check the movement type configuration you should execute this activity “Copy, Change Movement Types” or you could directly access transaction OMJJ.
3. Critical issue in the MM-IM component
Unfortunately, there is not a “standard” critical issue in the Inventory Management Area.
Most cases of this kind arise when customer is not able to save goods movements into the system because of the existence of error messages.
Normally customers can wait for one day to be able to post the goods movement, but the situation can be more complicated depending on the number of postings which are stopped and depending also on the date in the month: When customers are about to do the period closing and they urgently need to post the goods movement on a required date.
3.1. When no goods movements at all can be posted into the system
Most cases in which goods movements are completely stopped from being posted relate to issues with the number range or the posting period.
In errors addressing to duplicated entries (dump “SAPSQL_ARRAY_INSERT_DUPREC”) for material documents always check the current number in use in the number range interval (customizing transaction OMBT). Then check in SE16 the last number really used. This number found in SE16 cannot be higher than the current number in the number range interval. If this is the case, the current number in the customizing should be increased accordingly. Check also in SE11 the index used for the relevant table. See if any index has been set as unique. In this case, see if, according to this unique index, duplicated entries are being created (for example, a unique index is set considering only the fiscal year but not the document number: as soon as two documents are created within the same year, the system will consider that they are duplicated entries).
In Inventory Management it is only possible to post into the current and the previous period. It is not possible to post into other periods. If re-opening a previous closed period is needed, please, check the note 1085641, section “Period Closing Problems”.
3.2. When the process fails for only some certain materials in certain plants
3.2.1. Inconsistencies
The most common reason for urgent cases in this scenario is the existence of database inconsistencies.
The fact that inconsistencies exist does not justify the criticality. For example, if the customer detected an inconsistency by looking at the tables or by using the transaction MB5K, this has to be analyzed, but it is not too urgent to be considered as production down.
A critical stock inconsistency issue is justified only if:
– The inconsistency prevents further postings (error message) in urgent processes.
– The inconsistency leads to a delay in the year-end close. Monthly closing processes must not be delayed because of inconsistencies.
So, in this case, one of the following messages are raised when posting the goods movement:
M7 308 ‘Stock value and qty are unrealistic: & / &
M7 309 ‘Stock value is negative: &
M7 310 ‘Valuated stock is negative: &
M7 314 Valuated stock becomes negative: &
These messages are generated if the system finds a data inconsistency when reading the material master data (this is, the stock quantity or the stock value is already inconsistent before the goods movement). Further data about this situation can be found in the SAP KBA note 1618888. This KBA points to relevant notes which explains possible reasons for the generation of database inconsistencies as well as how to proceed in this case.
“False” inconsistencies:
If customer reports negative stocks (error ‘M7310’) although they have not been allowed in the Customizing (OMJ1), indicate the note 935755.
3.2.2. How to proceed for other error messages?
- Check with customer if there have been any recent changes in the customizing or if new user exits or BAdIs have been implemented (transaction SE95).
- Also check if there have been any recent Support Package upgrades or if customer is migrating into a new Release.
- Check if dumps, update termination errors or express documents are generated.
- Dumps can be displayed in the transaction ST22.The dump specifies the coding section (include) and the error message. Use this information to determine the proper CSN component. Often dumps in MIGO are caused by “A” messages from other modules like FI, CO, etc, if you recognize here the correct component you should forward it to the corresponding area.
Consider specially the note 386152: A dump MESSAGE_TYPE_X in SAPLMBWL / LMBWLU21 /MB_POST_GOODS_MOVEMENT occurs in MM-IM only in order to avoid the generation of inconsistencies.
The long text of the termination contains information on the actual error cause (section “error analysis”).
- Update termination errors can be seen with the transaction SM13. Double click in the lines with status “Err” for further information about the problem. If a dump has been generated, it can also be displayed from here.
- Express documents are the notification to the user of dumps or update termination errors.
- The transaction SM50 for the Process Overview can be used to see the tables that are being updated after the posting of a goods movement (useful when the material document is posted but there is a delay in the database update).
4. Transactions in Inventory Management
The Enjoy Transaction MIGO was first made available in Release 4.6A. Since then its functionality has been constantly growing to cover as many possible goods movements as possible. Here there is an overview of the tasks the functionality of MIGO offers for every Release and the old MBxx transaction that it replaces. As advised before, if a process fails using MIGO, it is always a good idea to check if the error is the same using the old transaction MBxx.
Release 4.6A:
- Goods receipt for known purchase order (transaction code MB01)
- Goods receipt for unknown purchase order (transaction code MB0A)
- Enter return delivery (transaction code MBRL)
- Release blocked stock (transaction code MBSF)
- Enter subsequent delivery (transaction code MBNL)
- Cancel material document for goods receipts (transaction code MBST)
- Display material document for goods receipts (transaction code MB03)
Release 4.6C: The following functionalities are added to the ones listed before:
- Goods receipt for order (transaction code MB31)
- Other’ goods receipts (transaction code MB1C)
- Goods issue (transaction code MB1A)
- Cancel material document for goods issues (transaction code MBST)
- Display material document for goods issues (transaction code MB03)
Release 4.70: The following new functions are made available:
- Transfer Postings and Stock Transfers (transaction code MB1B)
- Subsequent Adjustment in subcontracting (transaction code MB04)
5. Important tables in the Inventory Management Area
Document Tables:
Table | Meaning | Key fields |
MKPF | Header: Material Document | Document number (MBLNR), year (MJAHR) |
MSEG | Material Document – segments/ lines | Document number (MBLNR), year (MJAHR), line number (ZEILE) |
BSIM | Index for material to the FI-documents | Material (MATNR), Valuation Area (BWKEY)… |
CKMI1 | Material ledger index, used to document changes in MBEW for each movement |
KALNR, use mbew-kaln1 |
Valuation Tables:
Table | Meaning |
MBEW | Material Valuation |
EBEW | Sales Order Stock Valuation (from 4.0 on) |
QBEW | Project Stock Valuation (from 4.0 on) |
OBEW | Valuated Stock with Subcontractor (from 4.6 only for Japan) |
Stock Tables:
Table | Meaning |
MARC | Plant Data for Material |
MARD | Storage Location Data for Material |
MCHB | Batch Stocks |
MSSL | Total Special Stocks with Vendor O |
MSLB | Special Stocks with Vendor O |
MSKU | Special Stocks with Customer V,W |
MSSA | Total Customer Orders on Hand E |
MSKA | Sales Order Stock E |
MSSQ | Project Stock Total Q |
MSPR | Project Stock Q |
MKOL | Special Stocks from Vendor K,M |
6. Important breakpoints for debugging
Check all data before posting:
Important breakpoint when we work in productive environments and we cannot save the posting. This is the last point in which the debugging can be re-started. Breakpoint in MM07MFB9, form BUCHEN_AUSFUEHREN.The internal table XMSEG shows how the document would be posted.
Check data defaulted from other documents or master data:
Data from the Material Master: Set a breakpoint in the function module MATERIAL_READ.
Goods Issue for Reservation: Breakpoint in MM07MFR0, form RESERVIERUNG_LESEN, at call function MB_READ_RESERVATION_POS_WA. Check the internal table XRBEFU. The same function module is also called from the include LMBWLU10.
Cancellation of a Material Document: Breakpoint in MM07MFB1, form BELEG_LESEN, at call function MB_READ_MATERIAL_POSITION. Goods Receipt for Production Order: Breakpoint in MM07MPPS, form PPS_AUFTRAG_PRUEFEN, at call function CO_SF_ITEM_GOODS_RECEIPT.
For valuation data, set a breakpoint in the include LMBGBFPP (4.0: LMBGBFWR) at call function CK21_ITEM_GOODS_RECEIPT.
Goods Issue for Production Order: Breakpoint in LMBGBFWR, form WERTE_ML_INITIALISIEREN, at call function CKML_F_CKML1_PRICES_GET.
Check data in the interfaces:
Data in the accounting interface: Breakpoint in MM07MFF9, form F-BELEG_ERGAENZEN, at call function CKMV_AC_DOCUMENT_CREATE (2nd page). The internal tables XACCIT (for the accounting document item data. It will be the data in BSEG when the document gets posted), XACCHD (accounting document header data: BKPF) and XACCCR (for the values in the different currencies) can be checked here.
Data in the MB_CREATE interface (valid for all goods movements posted automatically like postings from SD – Goods issues for deliveries -, from PP – backflush; confirmation of production orders, EDI, QM, BAPIs, MIGO, etc.): Breakpoint in LMBWLU14, function module MB_CREATE_GOODS_MOVEMENT. See the data in the internal table IMSEG.
Check some other data:
Check the account determination process: Breakpoint in function module MR_ACCOUNT_ASSIGNMENT (at “SELECT SINGLE * FROM T030…”).
Check the account assignment data: Breakpoint in function module K_COBL_CHECK.
Check the movement type being posted: Breakpoint in function module MB_CONTROL_MOVETYPE_GET_SINGLE.
Check the valuation: Breakpoint in MM07MFF9, form F_SEGMENTE_GENERIEREN at call function MB_CALCULATE_VALUES.
Special program MBDEBUG: Some of these Breakpoints can be set automatically by executing the program MBDEBUG in SE38 and setting a flag in the desired point. A “stop” icon will be displayed as soon as the breakpoint is selected (i.e. activated). Exit the report going back with the green arrow (F3) and the system will stop at the breakpoints activated this way.
New NetWeaver Information at SAP.com
Very Helpfull