- Home
- Modules
- Material ledger
- CKMDUVMAT
CKMDUVMAT: Distribution of Inventory Differences
How SAP takes the shortage found in a physical inventory count and charges it to the orders that consumed the material, so backflushed consumption becomes real consumption and actual costing can carry it into the cost of the product.
At a glance
- Transaction
CKMDUVMAT- Component
- CO-PC-ACT-DUV
- Since
- SAP R/3 4.7, still in S/4HANA
- Receivers
- Orders, cost collectors, material, product
- When
- Monthly, before settlement and CKMLCP
- Siblings
CKMDUVACTCKMDUVREC
In short
Most plants post component consumption at standard: confirm the order and the bill of material is backflushed. Real life is less tidy. Grain absorbs moisture, a pipe holds product, an operator adds a little more to hit the spec. The physical count finds the gap months of postings left behind.
The problem
The difference lands far from the cause
Posting the count (
MI07) books the shortage to the inventory differences account. The orders that really used the material never see it, and neither does the cost of the product.What CKMDUVMAT does
It sends the cost back to the consumers
It reads the physical inventory document, finds the orders that consumed the material since the last distribution and moves the value to them, in proportion to what each one withdrew. Stock quantity does not change.
The payoff
Real consumption, real product cost
Order variances show what was really used. With actual costing, the material ledger rolls the extra consumption up to the finished product, into inventory and cost of goods sold.
Where the money goes
A brewery counts its malt silo and finds 480 kg missing
- 1 · Physical count−480 kgMalt, standard price 1.20 per kg
- 2 · MI07 posts the difference576.00 → 0.00576.00Booked to inventory differences, then cleared by CKMDUVMATStays on the inventory differences account, an expense of the period
- 3 · Process orders that used the malt
- Pilsner+288.00+0.00
- Lager+216.00+0.00
- Amber ale+72.00+0.00
- 4 · Actual cost of the beer+576.00−576.00In inventory and cost of goods sold after settlement and CKMLCPUnderstated: the product never carries the malt it used
With CKMDUVMAT the shortage follows the beer: the orders show their real malt usage and the material ledger rolls it into actual cost.Without CKMDUVMAT the shortage is a period expense with no link to any product, and the actual cost of the beer is too low.
The process, end to end
Seven steps across logistics and controlling. CKMDUVMAT is step five, and its timing decides whether the cost reaches the product this period.
Consume at standard
Components go to production orders, process orders or product cost collectors with movement type 261, usually by backflush at confirmation.
COR6NCO11NMFBFMIGOCreate the physical inventory document, flagged for distribution
The Distribute differences indicator only appears when distribution is active for the plant and storage location. Without it, CKMDUVMAT will never see the document.
MI01Count and check
Enter the count, recount what looks wrong and review the difference list. Nothing is posted to accounting yet.
MI04MI11MI20Post the difference
Movement type 702 for a shortage or 701 for a surplus in unrestricted stock. The offset goes to the inventory differences account (transaction key GBB, account modifier INV).
MI07Distribute and post
Select the physical inventory document, let the system propose the split, adjust it if you know better and post. Two follow-on movements move the value from the inventory differences account to the orders.
CKMDUVMATClose the orders
Variance calculation now includes the extra consumption; settlement passes it to the material ledger as a production variance on the product.
KKS2KKS1CO88Close the material ledger
Multilevel price determination rolls the differences up to the finished product. Check the result in the material price analysis.
CKMLCPCKM3
SAP recommends distributing at least once a month, before the period is closed. You can run it any time after the difference is posted; the earlier, the less chance an order is already settled.
What gets posted
CKMDUVMAT does not touch stock. It posts a reversal of the physical inventory movement and a goods issue to the orders: the quantities cancel, the value moves.
Movement chain702Z12Z61Gold: posted by CKMDUVMAT
Count posted
MI07 · 702- Dr
- Inventory differences (GBB · INV)
- 576.00
- Cr
- Raw material stock (BSX)
- 576.00
The shortage hits the period as an expense.
Stock −480 kg
Reversal
CKMDUVMAT · Z12- Dr
- Raw material stock (BSX)
- 576.00
- Cr
- Inventory differences (GBB · INV)
- 576.00
Copy of 712: the expense is taken back out.
Stock +480 kg
Charge to orders
CKMDUVMAT · Z61- Dr
- Consumption on the orders (GBB · VBR)
- 576.00
- Cr
- Raw material stock (BSX)
- 576.00
Copy of 261: 288.00 / 216.00 / 72.00 to the three orders.
Stock −480 kg
- Net: inventory differences0.00
- Net: orders+576.00
- Net: stock−480 kg
Movement chain701Z11Z62Gold: posted by CKMDUVMAT
Count posted
MI07 · 701- Dr
- Raw material stock (BSX)
- 576.00
- Cr
- Inventory differences (GBB · INV)
- 576.00
The surplus is a gain of the period.
Stock +480 kg
Reversal
CKMDUVMAT · Z11- Dr
- Inventory differences (GBB · INV)
- 576.00
- Cr
- Raw material stock (BSX)
- 576.00
Copy of 711: the gain is taken back out.
Stock −480 kg
Credit to orders
CKMDUVMAT · Z62- Dr
- Raw material stock (BSX)
- 576.00
- Cr
- Consumption on the orders (GBB · VBR)
- 576.00
Copy of 262: the orders used less than the backflush said.
Stock +480 kg
- Net: inventory differences0.00
- Net: orders−576.00
- Net: stock+480 kg
Accounts follow standard account determination: copies of 711 and 712 keep the inventory differences account (GBB, modifier INV), copies of 261 and 262 keep the consumption account (GBB, modifier VBR). Check yours in OMWN and OBYC. Z11, Z12, Z61 and Z62 are the names SAP Help uses as examples.
Try the proposal yourself
The default split is simple: each order gets the difference times its share of the withdrawals in the distribution interval. Change the numbers and watch the proposal move.
- Difference
- 480 kg short
- Price per kg
- 1.20
- Order 1000123 · Pilsner
- 12,000 kg withdrawn
- Order 1000124 · Lager
- 9,000 kg withdrawn
- Order 1000125 · Amber ale
- 3,000 kg withdrawn
| Receiver | Withdrawn | Share | Default qty | Value |
|---|---|---|---|---|
| Order 1000123 · Pilsner | 12,000 | 50.0% | 240.000 | +288.00 |
| Order 1000124 · Lager | 9,000 | 37.5% | 180.000 | +216.00 |
| Order 1000125 · Amber ale | 3,000 | 12.5% | 60.000 | +72.00 |
| Total | 24,000 | 100% | 480.000 | +576.00 |
Shortage: CKMDUVMAT posts Z12 to clear the inventory differences account and Z61 to debit the orders. Pilsner withdrew the most, so it carries the largest share.
No consumption in the interval
With nothing withdrawn there is nothing to weigh the split. In SAP this is message CKMLDUVN006, “Base quantity of standard distribution is zero”. Check the interval and the movement types in table TDUVN156.
Configuration, step by step
Six steps make it work, a seventh fine-tunes it. Only the first is per plant; the movement types are set once for the client.
Step 1 of 7 · Per plant and storage location
Activate distribution of consumption differences
SPRO › Controlling › Product Cost Controlling › Actual Costing/Material Ledger › Actual Costing › Activate Distribution of Consumption Differences
Make one entry for each plant, storage location and special stock where orders consume the material. This is what lets a physical inventory document be selected for distribution.
| Setting | What it does |
|---|---|
| Distribution active | Switches the function on for the combination. |
| Default indicator 1 | Only with it does the Distribute differences setting appear on the Create physical inventory document screen. |
| Hide distribution | Locks the setting, so users cannot change it on the document. |
| Binding | Documents created in the background, by Warehouse Management or a BAPI, become relevant automatically. |
Activate it where production consumes, such as the silo or the line-side store, not across every storage location of the plant.
Step 2 of 7 · Client-wide
Tell it which consumptions count
SM30 › table TDUVN156
The receiver search only looks at material documents with the movement types listed here. Standard needs two entries:
| Function code | Movement type | Active |
|---|---|---|
DUV | 261 Goods issue to order | Yes |
DUV | 262 Reversal of goods issue | Yes |
If your orders consume with your own copies of 261, add them too, or those orders will never be found. SAP Note 623167 is the usual reference when this table causes errors.
Step 3 of 7 · Client-wide
Movement types that undo the inventory posting
OMJJ › Copy, Change Movement Types (Materials Management › Inventory Management and Physical Inventory › Movement Types)
Z11copy of 711Reverses a surplus
Z12copy of 712Reverses a shortage
Copy with all dependent entries. Why 711 and 712? Movement types 701 and 702 have no standard reversal, and copying 711 and 712 keeps the inventory differences account logic, so the account goes back to exactly zero.
Step 4 of 7 · Client-wide
Movement types that charge the orders
OMJJ › Copy, Change Movement Types
Z61copy of 261Debits the orders (shortage)
Z62copy of 262Credits the orders (surplus)
On all four new movement types, Z11, Z12, Z61 and Z62, set reference movement type 999 for Warehouse Management. The posting moves value, not goods, so WM must ignore it.
Step 5 of 7 · Client-wide
Chain them as follow-on movement types
OMJJ › select the movement type › Reversal/follow-on movement types (table T156N)
Every physical inventory movement type gets a reversing follow-on; the reversals then lead to the order postings, with function code DUV.
701 → Z11702 → Z12703 → Z11704 → Z12707 → Z11708 → Z12711 → Z12712 → Z11713 → Z12714 → Z11715 → Z12716 → Z11717 → Z12718 → Z11Z11 → Z62Z12 → Z61Z61 → 262Z62 → 261
The pattern: an increase is followed by a decrease and the other way round. Gold pairs are the order postings, maintained with function code DUV. The list follows SAP Help.
Step 6 of 7 · Check before you test
Account determination
OMWN (movement type → account modifier) and OBYC (transaction key GBB → G/L account)
| Movement types | Expected offset | Watch for |
|---|---|---|
Z11 Z12 | GBB · INV, the same inventory differences account as MI07 | Different account: the difference never clears |
Z61 Z62 | GBB · VBR, consumption | The account must be a cost element, or the order cannot receive it |
Then run one material end to end in a test client: count, post, distribute, settle the order and check the material ledger.
Step 7 of 7 · Optional
Change how receivers are found
BAdI CKMLDUVN_CHOOSE_RECV · Receiver Search for Revaluation of Consumption
By default the system looks for material documents with the same material, plant, storage location, stock type, batch and movement type as the counted item. The BAdI lets you drop a criterion or replace it.
Counted here, consumed there
The silo is counted, but orders draw from a staging location after a transfer. Replace the storage location in the search.
Difference in quality inspection
Orders never issue from QI stock. Ignore the stock type so all consumers are found.
Using the transaction
One screen does it all: a worklist of counted items on top, the receivers of the selected item below. A sketch of a run:
- ADistribute
- BDetails
- CChange interval
- DPost
| PI document | Item | Material | Plant / SLoc | Difference | Interval | Status |
|---|---|---|---|---|---|---|
| 100000451 | 1 | MALT-PILS | BR01 / SILO | −480 KG | 01.10.2026 – 30.10.2026 | 30 Distribution created |
| 100000451 | 2 | HOPS-PELLET | BR01 / SILO | +12 KG | 01.10.2026 – 30.10.2026 | 10 New |
| Receiver | Product | Withdrawn | Default qty | Quantity | Indicator |
|---|---|---|---|---|---|
| 1000123 | BEER-PILS | 12,000 | 240 | 240 | P Order |
| 1000124 | BEER-LAGER | 9,000 | 180 | 180 | P Order |
| 1000125 | BEER-AMBER | 3,000 | 60 | 60 | P Order |
Distribute
Select by physical inventory document, material or plant. Tick “include posted documents” to see history. Distribute builds the proposal; status moves from 10 to 30.
Details
For each receiver you can change the quantity, the receiver object and the distribution indicator. Save in the item overview.
Change interval
Sets which consumptions are weighed. Always look at it before the first distribution of a material.
Post
Enter the posting date of the distribution, a date in the period you are closing, and post. Status 70 means done.
The distribution interval
Which consumptions are weighed
The interval starts where the last distribution of the material ended and ends on the date the current difference was posted. With no earlier distribution, it starts on the first day of the current fiscal year.
P | Order: production or process order |
S | Product cost collector: repetitive manufacturing |
C | Adjustment – material: debit the material itself |
F | Adjustment – product: debit the finished product |
N | Do not distribute: leave this item out |
Status codes, decoded
Every counted item carries a two-character status. The happy path is short; the rest tell you what to fix. Select a status:
Happy path1020305070
Normal flow
New
The counted difference is waiting. Select the item and choose Distribute.
Needs attention
New, previous intervals changed
New, but an earlier interval of the same material was changed. Check where this interval starts before you distribute.
Needs attention
New, error in interval determination
The system could not work out the interval. Set the start and end yourself with Change interval.
Normal flow
New, interval changed
New, with an interval you set by hand. Ready to distribute.
Normal flow
To be distributed
Selected for a distribution run.
Normal flow
Distribution created
The proposal exists. Open Details, check quantities and receivers, save, then post.
Needs attention
Errors in distribution run
The run failed for this item. Read the log: the usual causes are no consumption in the interval or consumption movement types missing from TDUVN156.
Normal flow
To be posted
The distribution is saved and waiting to be posted.
Needs attention
Partially updated
Some receivers were posted and others were not. Read the log, fix the cause and post the rest.
Needs attention
Posting error
The goods movements were not posted. Typical causes: closed posting period, closed order, account determination. Read the log; report MLHELP_FIND_DUV_POSTING_ERRORS helps analyze it.
Done
Posted
Done. The follow-on material documents exist and the orders carry the cost.
Reversal
Posting reversed
The posting was reversed. Check the item before distributing it again.
Reversal
Posting partially reversed
Part of the posting was reversed. Check which receivers are still posted.
Background
To be distributed in the background
Queued to be distributed by a background run instead of on screen.
Background
To be posted in the background
Queued to be posted by a background run instead of on screen.
Tips few people know
Collected from SAP documentation, knowledge base articles and years of month-end closings.
- Pitfall
The first run looks back to January
A material never distributed before gets an interval from the first day of the fiscal year. After go-live, set it with Change interval, or the difference is spread over months of orders, some long closed.
- Little known
Clean the worklist without posting
Old counts from before you used the function keep showing up. Give them indicator N, Do not distribute, or restrict the selection to the physical inventory documents of the period.
- Little known
The receiver need not be an order
Besides orders (P) it posts to product cost collectors (S) and can adjust the material (C) or the finished product (F). Repetitive manufacturing plants use it too.
- Practical
The proposal is only a proposal
Know which order had the spill? Overwrite the quantities in Details before posting. The total still has to be the difference.
- Rescue
Posted twice? There is a report
Run
MLHELP_CANCEL_DUV_DOCUMENTSin SE38 (SAP Note 1756761). Its partnerMLHELP_FIND_DUV_POSTING_ERRORSanalyzes postings that failed. - Pitfall
Counted in one place, consumed in another
The search matches the storage location, stock type and batch of the counted item. If orders issue from a staging location, nobody is found. The BAdI CKMLDUVN_CHOOSE_RECV fixes it.
- Timing
The order of the close matters
CKMDUVMAT, then variance calculation and settlement, then CKMLCP. Distribute after settlement and the cost waits on the order; orders with status closed cannot receive it at all.
- Little known
Nobody has to remember the flag
With default indicator 1 set as binding, physical inventory documents created in the background by Warehouse Management or a BAPI become relevant for distribution on their own.
- Volume
Hundreds of items? Look for the background run
Two statuses, DP and PP, are for items queued to be distributed or posted in the background. Before working through hundreds of items one by one on screen, check where that option sits in your release.
- Analysis
See it in the material ledger
In the material price analysis (CKM3) the distribution postings show among other receipts and consumption, with their movement types under the original document.
- Sibling
The same trick for machine hours
Enter real hours per cost center and activity type in CKMDUVREC, from time sheets or meters, and spread the difference with CKMDUVACT. In CKMDUVREC a row is saved only when Item OK is ticked.
- Caution
Embedded EWM: test first
CKMDUVMAT works from Inventory Management physical inventory documents. When the count is done in EWM, check what reaches Inventory Management before you rely on it; SAP Community still has the question open.
HistoryThe function arrived with SAP R/3 4.7. Before it, differences went to cost object hierarchy nodes and were spread to orders only at period close, by target costs. DUV needs no hierarchy, runs any time and lets you change the split.
Troubleshooting
The messages consultants search for most, what they usually mean and where SAP explains them.
| Message or symptom | What it usually means | Where to look |
|---|---|---|
CKMLDUVN006 Base quantity of standard distribution is zero | No net consumption to weigh the split: nothing issued in the interval, or issues and reversals cancel out. | Interval, TDUVN156 · KBA 2516990 |
CKMLDUVN200 / CKMLDUVN202 No material documents found · quantity to be distributed is zero | The search found no consumption for the counted item in the interval. | Change interval, storage location and batch · KBAs 2625681, 2604302 |
CKMLDUVN021 | Reported on SAP S/4HANA 1709 with follow-on movement type settings and catch weight management. | T156N · KBA 2618039 |
M7 001 Check table entry does not exist (with F5 727) | A customizing entry the posting needs is missing. | Z movement types · KBA 2298776 |
| Blank result for a physical inventory document | No material or product cost collector is proposed and no message appears. | Distribute differences set? Distribution active for the storage location? · KBA 3788954 |
| Some movements never distributed | Consumptions by movement types outside TDUVN156, by-products (531/532) or transfers (351/352). | TDUVN156 · KBA 2938293 |
| System error with a product cost collector | TDUVN156 not maintained for 261 and 262. | TDUVN156 · Note 623167 |
| The same difference posted twice | Duplicate distribution documents. | MLHELP_CANCEL_DUV_DOCUMENTS · Note 1756761 |
| Old counts flood the worklist | Documents from before the function was used are still status New. | Indicator N, or select by physical inventory document |
Transactions and tables
Everything you need around a distribution run. Query the tables quickly with SE16H.
| Distribution | |
|---|---|
CKMDUVMAT | Distribution of inventory differences |
CKMDUVREC | Enter actual activity quantities |
CKMDUVACT | Distribution of activity differences |
| Physical inventory | |
MI01 | Create physical inventory document |
MI04 | Enter inventory count |
MI20 | Difference list |
MI07 | Post inventory differences |
| Close and analyze | |
CKMLCP | Actual costing cockpit |
CKM3 | Material price analysis |
| Customizing | |
OMJJ | Movement types and follow-ons |
SM30 | TDUVN156 and the activation table |
OMWN | Account modifier per movement type |
OBYC | Automatic account determination |
CKMLDUVN | Distribution status for each physical inventory item |
CKMLDUVNCO | Usage differences per account assignment object |
CKMLDUVACT | Activity differences: records and status |
TDUVN156 | Consumption movement types for the search |
T156N | Reversal and follow-on movement types |
ISEG | Physical inventory document items |
| Programs and BAdI | |
|---|---|
MLHELP_CANCEL_DUV_DOCUMENTS | Cancel duplicated postings |
MLHELP_FIND_DUV_POSTING_ERRORS | Analyze posting errors |
CKMLDUVN_CHOOSE_RECV | BAdI for the receiver search |
Frequently asked questions
Does CKMDUVMAT change the stock quantity?
No. Its two follow-on movements cancel each other in quantity. Stock stays as counted; only the value moves from the inventory differences account to the orders.
Can it post to a cost center?
No. The receivers are orders, product cost collectors, the material and the finished product. A cost center is where the difference already sits without distribution.
What happens with a surplus?
The same, in reverse: 701 is followed by Z11 and Z62, and the orders are credited. They consumed less than the backflush said.
Do I need actual costing?
The function belongs to Actual Costing/Material Ledger and is designed so the differences flow into multilevel actual costing. The postings themselves are goods movements to orders, so order variance analysis benefits as well.
How often should we run it?
SAP recommends at least once a month, before closing the period. Count as often as you like; the shorter the interval, the closer the split follows reality.
How do I undo a distribution?
SAP Help says to generate the distribution again with reversed settings; the status then shows 45 or 57. For postings made twice by mistake, use MLHELP_CANCEL_DUV_DOCUMENTS.
Is there a version for labor and machine time?
Yes. Record the real activity quantities in CKMDUVREC and distribute the difference to the orders with CKMDUVACT, in the same way.
Related pages
References
- Distributing consumption differencesSAP Help Portal
- Capture usage variances and assign them to your ordersJanet Salmon, SAPinsider (2006)
- Actual Costing with the Material Ledger in SAP ERPSAP PRESS, chapter on DUV
- CKMDUVMAT: cancel duplicated postingsSAP Community
- How the default quantity is calculatedSAP Community
- KBAs 2516990, 2625681, 2604302, 2618039, 2298776, 3788954, 2938293SAP for Me (login required)