1. Home
  2. Modules
  3. Material ledger
  4. 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

Scenario
  1. 1 · Physical count−480 kgMalt, standard price 1.20 per kg
  2. 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. 3 · Process orders that used the malt
    • Pilsner+288.00+0.00
    • Lager+216.00+0.00
    • Amber ale+72.00+0.00
    Split by withdrawals: 12,000 / 9,000 / 3,000 kgConsumption at standard only; variances look better than reality
  4. 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.

  1. Consume at standard

    Components go to production orders, process orders or product cost collectors with movement type 261, usually by backflush at confirmation.

    COR6NCO11NMFBFMIGO
  2. Create 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.

    MI01
  3. Count and check

    Enter the count, recount what looks wrong and review the difference list. Nothing is posted to accounting yet.

    MI04MI11MI20
  4. Post 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).

    MI07
  5. Distribute 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.

    CKMDUVMAT
  6. Close the orders

    Variance calculation now includes the extra consumption; settlement passes it to the material ledger as a production variance on the product.

    KKS2KKS1CO88
  7. Close 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.

Difference

Movement chain702Z12Z61Gold: posted by CKMDUVMAT

  1. 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

  2. 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

  3. 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

  1. 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

  2. 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

  3. 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
Default distribution · 702 → Z12 → Z61
ReceiverWithdrawnShareDefault qtyValue
Order 1000123 · Pilsner12,00050.0%240.000+288.00
Order 1000124 · Lager9,00037.5%180.000+216.00
Order 1000125 · Amber ale3,00012.5%60.000+72.00
Total24,000100%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.

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.

Configuration step

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.

SettingWhat it does
Distribution activeSwitches the function on for the combination.
Default indicator 1Only with it does the Distribute differences setting appear on the Create physical inventory document screen.
Hide distributionLocks the setting, so users cannot change it on the document.
BindingDocuments 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 codeMovement typeActive
DUV261 Goods issue to orderYes
DUV262 Reversal of goods issueYes

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)

  • Z11 copy of 711

    Reverses a surplus

  • Z12 copy of 712

    Reverses 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

  • Z61 copy of 261

    Debits the orders (shortage)

  • Z62 copy of 262

    Credits 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 → Z11
  • 702 → Z12
  • 703 → Z11
  • 704 → Z12
  • 707 → Z11
  • 708 → Z12
  • 711 → Z12
  • 712 → Z11
  • 713 → Z12
  • 714 → Z11
  • 715 → Z12
  • 716 → Z11
  • 717 → Z12
  • 718 → Z11
  • Z11 → Z62
  • Z12 → Z61
  • Z61 → 262
  • Z62 → 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 typesExpected offsetWatch for
Z11 Z12GBB · INV, the same inventory differences account as MI07Different account: the difference never clears
Z61 Z62GBB · VBR, consumptionThe 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:

Distribution of Inventory DifferencesCKMDUVMAT · illustration
  • ADistribute
  • BDetails
  • CChange interval
  • DPost
Worklist: physical inventory items
PI documentItemMaterialPlant / SLocDifferenceIntervalStatus
1000004511MALT-PILSBR01 / SILO−480 KG01.10.2026 – 30.10.202630 Distribution created
1000004512HOPS-PELLETBR01 / SILO+12 KG01.10.2026 – 30.10.202610 New
Details: receivers of MALT-PILS
ReceiverProductWithdrawnDefault qtyQuantityIndicator
1000123BEER-PILS12,000240240P Order
1000124BEER-LAGER9,000180180P Order
1000125BEER-AMBER3,0006060P Order
  1. 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.

  2. Details

    For each receiver you can change the quantity, the receiver object and the distribution indicator. Save in the item overview.

  3. Change interval

    Sets which consumptions are weighed. Always look at it before the first distribution of a material.

  4. 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.

Distribution indicator
POrder: production or process order
SProduct cost collector: repetitive manufacturing
CAdjustment – material: debit the material itself
FAdjustment – product: debit the finished product
NDo 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

Status
10

Normal flow

New

The counted difference is waiting. Select the item and choose Distribute.

11

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.

12

Needs attention

New, error in interval determination

The system could not work out the interval. Set the start and end yourself with Change interval.

13

Normal flow

New, interval changed

New, with an interval you set by hand. Ready to distribute.

20

Normal flow

To be distributed

Selected for a distribution run.

30

Normal flow

Distribution created

The proposal exists. Open Details, check quantities and receivers, save, then post.

40

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.

50

Normal flow

To be posted

The distribution is saved and waiting to be posted.

55

Needs attention

Partially updated

Some receivers were posted and others were not. Read the log, fix the cause and post the rest.

60

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.

70

Done

Posted

Done. The follow-on material documents exist and the orders carry the cost.

45

Reversal

Posting reversed

The posting was reversed. Check the item before distributing it again.

57

Reversal

Posting partially reversed

Part of the posting was reversed. Check which receivers are still posted.

DP

Background

To be distributed in the background

Queued to be distributed by a background run instead of on screen.

PP

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_DOCUMENTS in SE38 (SAP Note 1756761). Its partner MLHELP_FIND_DUV_POSTING_ERRORS analyzes 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.

CKMDUVMAT messages and symptoms
Message or symptomWhat it usually meansWhere to look
CKMLDUVN006 Base quantity of standard distribution is zeroNo 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 zeroThe search found no consumption for the counted item in the interval.Change interval, storage location and batch · KBAs 2625681, 2604302
CKMLDUVN021Reported 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 documentNo 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 distributedConsumptions by movement types outside TDUVN156, by-products (531/532) or transfers (351/352).TDUVN156 · KBA 2938293
System error with a product cost collectorTDUVN156 not maintained for 261 and 262.TDUVN156 · Note 623167
The same difference posted twiceDuplicate distribution documents.MLHELP_CANCEL_DUV_DOCUMENTS · Note 1756761
Old counts flood the worklistDocuments 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.

Transactions
Distribution
CKMDUVMATDistribution of inventory differences
CKMDUVRECEnter actual activity quantities
CKMDUVACTDistribution of activity differences
Physical inventory
MI01Create physical inventory document
MI04Enter inventory count
MI20Difference list
MI07Post inventory differences
Close and analyze
CKMLCPActual costing cockpit
CKM3Material price analysis
Customizing
OMJJMovement types and follow-ons
SM30TDUVN156 and the activation table
OMWNAccount modifier per movement type
OBYCAutomatic account determination
Tables and objects
CKMLDUVNDistribution status for each physical inventory item
CKMLDUVNCOUsage differences per account assignment object
CKMLDUVACTActivity differences: records and status
TDUVN156Consumption movement types for the search
T156NReversal and follow-on movement types
ISEGPhysical inventory document items
Programs and BAdI
MLHELP_CANCEL_DUV_DOCUMENTSCancel duplicated postings
MLHELP_FIND_DUV_POSTING_ERRORSAnalyze posting errors
CKMLDUVN_CHOOSE_RECVBAdI 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.