A 36% margin became 6% at month-end, and every posting was correct

On the day we shipped, the billing document said the margin was 36%. Three weeks later, after the close, the same sale carried a margin of 6%. Nobody made a mistake. No posting was reversed. Every document in between was correct.

This is the part of SAP that spreadsheets never prepare you for, so it is worth walking through with real numbers. Everything below comes from a small dumpling factory I built from an empty S/4HANA client and drove through one complete business month.

1. The sale looked great

A sales order for 20,000 KRW of dumplings, delivered and billed:

Step Transaction Effect
Sales order VA01 Revenue 20,000 · standard cost of goods 12,800 → expected margin 7,200 (36%)
Goods issue VL01N → PGI Cost of goods sold hits the P&L for the first time — at standard
Billing VF01 Revenue 20,000, receivable 22,000 (incl. tax)

If you stop reading the system here — and a lot of people do, because the financial statements are already complete and balanced — the product looks 36% profitable.

The catch: that 12,800 is the standard cost. A standard cost is a plan, calculated before the month began, using planned activity rates and planned overhead. At goods issue SAP has no idea what the month actually cost. It has to post something, so it posts the plan.

2. Meanwhile, reality was more expensive

Three ordinary things happened during the month, none of them dramatic:

  • A machine was capitalized mid-month (ABZON, 1,200,000). Depreciation for the period (AFAB) came out at 9,000 against a plan of 3,000.
  • Payroll was posted to the production cost center (FB01, 3,000).
  • Neither of those was in the standard cost, because the standard cost was calculated before either existed.

So the production cost center ended the month holding real expense that the plan never anticipated. The close is where that difference gets found and pushed forward — in three separate gates, in a fixed order.

3. Gate one — the cost center (KSS1 / KSII)

Actual activity rates are calculated from what the cost center really absorbed, divided by the hours it really delivered. For the labour activity type AT8020:

Activity type Planned rate Actual rate (KSII) Factor
AT8020 1,000 / H 3,000 / H

Revaluation at actual prices (CON2) then goes back to every production order that consumed those hours and tops it up — here, +6,000. The order, which had been sitting there looking perfectly on-plan, is suddenly 6,000 more expensive.

4. Gate two — the order (KKS1 / CO88)

Variance calculation compares what the order absorbed against what it delivered at standard, and settlement moves the difference out of the order and into the P&L as a price difference. In our books that lands on the variance accounts (4030 / 4060). The order closes at zero, which is the point — an order is a container, not a place where profit is allowed to hide.

5. Gate three — the material ledger (CKMLCP)

This is the step people skip, and it is the one that changes the margin. The material ledger takes the price difference that is now sitting in the P&L and allocates it along the path the material actually took. The portion belonging to the units that were sold is moved onto cost of goods sold. The portion belonging to units still in the warehouse stays in inventory, where it belongs.

Only after this does the income statement tell the truth about the sale:

  At billing After the close
Revenue 20,000 20,000
Cost of goods sold 12,800 (standard) 18,800 (standard + variance)
Margin 7,200  (36%) 1,200  (6%)

What this is actually telling you

The 36% was never a lie. It was a forecast, posted as an accounting entry because SAP needs a number at the moment of shipment and the only number available is the plan. The close is the mechanism that replaces the forecast with the fact.

Which leads to the practical points worth keeping:

  • A margin you read before the close is a plan. If someone asks “how profitable was that order?” on day three of the month, the honest answer is “at standard, 36% — ask me again after CKMLCP.”
  • The gates run in order and each one feeds the next. Cost center → order → material ledger. Run them out of order and variances strand in places nobody looks.
  • Look for the size of the gap, not just the sign. A 3× activity rate is not a rounding issue; it means the plan was built on assumptions the month did not honour. That is a planning conversation, not an accounting one.
  • Depreciation is the usual culprit in a young company — assets get capitalized after the standard cost was frozen, and nothing warns you.

None of this shows up if you only ever look at a finished system with tidy master data. It shows up when you build the company yourself and watch each posting land.

FROM THE SAME PROJECT

This margin collapse is the closing act of a business novel about SAP S/4HANA — Sarah, a junior accountant at the dumpling factory, spends a month learning why the books move the way they do. There is also a companion technical volume documenting the whole build: 238 configuration steps, 20 master records, 31 transactions with real document numbers, 12 financial statement snapshots.

See both books

Transactions referenced: VA01, VL01N, VF01, ABZON, AFAB, FB01, KSS1, KSII, CON2, KKS1, CO88, CKMLCP. All amounts are from a real S/4HANA client, re-read from the database rather than retyped from notes.

New: a free 16-page sample of the novel — the prologue, Chapter 1 and the scene where 6,700 won of raw material disappears from the balance sheet. No email required.

Comments

Popular posts from this blog

Modern ABAP Syntax Notes — Patterns and Pitfalls from Real Development

SAP S/4HANA Table Reference — Tables I Actually Query, by Topic

Production Order Variance Calculation KKS1 — Fixing KV031 and KV011, and What Lands in COSB