Sub topic 8
How purchasing, sales, and inventory postings reach the general ledger
This chapter assumes you know the Universal Journal (table ACDOCA), the difference between a company code and a ledger, and basic debit and credit logic. You should also know the purchase-to-pay and order-to-cash steps at business level. Here you will trace how a logistics event becomes a journal entry, and where that link breaks.
The integration principle
Logistics documents such as a goods receipt, a delivery, or a billing document are not journal entries. When the event is relevant to valuation or revenue, the system creates an accounting document in the same database transaction. Both documents are saved together or neither is. This is why a period-end close does not need a "transfer to FI" step for logistics.
The accounting document records its source in three fields:
AWTYPis the reference transaction. Common values areMKPF(material document),RMRP(logistics invoice verification), andVBRK(billing document).AWORGis the reference organizational unit, for example the material document year.AWREFis the reference document number.
These fields let you navigate from a line item back to its source, and they make reconciliation queries possible.
Automatic account determination
Users do not enter G/L accounts for logistics postings. The system derives them from configuration.
For inventory and procurement postings (MM), the lookup works in this order:
- The movement type (for example 101 for goods receipt) sets which transaction/event keys are used.
- The transaction/event key names the posting role.
BSXis the inventory posting,WRXis GR/IR clearing,GBBis offsetting entries for inventory posting such as consumption, andPRDis price differences. - The valuation class of the material, together with the chart of accounts, selects the G/L account.
- An account modifier separates cases that share a key, such as different consumption types under
GBB.
For sales (SD), revenue account determination (condition technique, transaction VKOA) picks accounts from the chart of accounts, a customer account assignment group, a material account assignment group, and an account key. Account key ERL is revenue and ERS is sales deductions. Customer and vendor lines go to the reconciliation account stored in the business partner's company code data.
Standard posting patterns
| Event | Movement or document | Debit | Credit |
|---|---|---|---|
| Goods receipt for purchase order | Movement type 101 | Inventory (`BSX`) | GR/IR clearing (`WRX`) |
| Invoice receipt | MIRO, reference `RMRP` | GR/IR clearing (`WRX`) | Vendor reconciliation account |
| Goods issue for delivery | Movement type 601 | Cost of goods sold (`GBB`) | Inventory (`BSX`) |
| Customer billing | Billing document, reference `VBRK` | Customer reconciliation account | Revenue (`ERL`), output tax |
The goods receipt and the invoice receipt are separate postings, and that is deliberate. The GR/IR account holds goods received but not yet invoiced. A balance that stays after both steps are done signals a missing invoice, a missing receipt, or a price difference that was not cleared.
Valuation and the material ledger
In S/4HANA the material ledger is always active. Each material posting also updates quantities and values per material, so inventory can be valued with actual costing. Standard price materials post price differences to a price difference account (PRD) when the invoice price differs from the standard. Moving average price materials post a difference into inventory if stock still covers the quantity. If stock has already been consumed, the system posts part of the difference to a price difference account, so the stock value stays consistent.
Because the Universal Journal is the single store, these value postings carry controlling objects. A goods issue to a cost center, for example, writes the cost center in the same ACDOCA line as the G/L account. No reconciliation ledger is needed between FI and CO.
Checking logistics postings in ACDOCA
The report below lists inventory-related lines that originated from material documents, grouped by G/L account. Company code 1010, year 2025, and ledger 0L are sample values. For production reporting, prefer released CDS views.
REPORT zr2r_mm_postings.
START-OF-SELECTION.
SELECT racct,
SUM( hsl ) AS amount
FROM acdoca
WHERE rldnr = '0L'
AND rbukrs = '1010'
AND gjahr = '2025'
AND awtyp = 'MKPF'
GROUP BY racct
ORDER BY racct
INTO TABLE @DATA(lt_mm_totals).
LOOP AT lt_mm_totals INTO DATA(ls_total).
WRITE: / ls_total-racct, ls_total-amount.
ENDLOOP.Debit amounts are positive and credits are negative in HSL. Inventory accounts should therefore show a net positive balance and GR/IR a net negative one. If you cannot explain a total, group by AWREF to find the material documents behind it.
Common errors
- Missing account determination. Posting fails with a message such as "Account cannot be determined". The cause is usually a new valuation class or movement type with no entry for the key in question. Check the configuration of automatic postings and add the combination. Do not work around it by posting manually.
- Wrong valuation class on the material. The posting succeeds but lands on the wrong account. Correcting the material master changes only future postings. Existing postings need a reclassification.
- Closed posting period. Logistics posting dates must fall in an open period for both MM and the company code. A goods receipt that fails here can leave a delivery waiting. The fix is to open the period or use a valid posting date (see the previous chapter on period control).
- Stale GR/IR balances. Receipts without invoices, or the reverse, accumulate across periods. Review them with the GR/IR clearing and maintenance apps, and use the period-end accrual run for goods received but not invoiced.
- Billing blocked by accounting. A billing document can be created with a posting block if account determination or the period fails. Releasing it to accounting later posts with the billing date, which may land in a different period than you expect.
Exercise
A goods receipt (movement type 101) of 1,000 USD is posted for a purchase order, and the vendor invoice arrives later at 1,050 USD for a standard price material. Which accounts are posted at each step, and what is the net effect on the GR/IR account?
Show answer
The goods receipt debits inventory (BSX) 1,000 and credits GR/IR clearing (WRX) 1,000. The invoice receipt debits GR/IR 1,000, debits the price difference account (PRD) 50, and credits the vendor reconciliation account 1,050. GR/IR nets to zero after both steps. A price difference of 50 remains in the P&L as a price variance.
Exercise
Modify the ACDOCA query so that it returns only billing document lines and reports the total per G/L account.
Show answer
Change the awtyp condition to 'VBRK'. Revenue accounts will show negative totals because credits are negative in HSL, and the customer reconciliation account will show a positive total.