Sub topic 11
Accounting entries and the GR/IR account
This chapter assumes you can post a purchase order and a goods receipt, and that you know debit and credit. It also assumes you know what a general ledger account is. Here you will see which accounting documents each procure-to-pay step creates, how the system picks the accounts, and why the GR/IR clearing account sits between the goods receipt and the invoice.
Why a clearing account is needed
The goods and the invoice rarely arrive together. The goods receipt (GR) happens when the delivery arrives. The invoice receipt (IR) happens when the supplier's bill arrives, days or weeks later. The books must stay correct in between.
At goods receipt, the company owns the goods and owes the supplier. The invoice has not been posted, so the supplier account cannot be credited yet. The system credits a temporary liability account instead: the GR/IR clearing account (goods receipt / invoice receipt). When the invoice is posted, the system debits that account and credits the supplier.
If every GR has a matching IR, the GR/IR balance is zero. A leftover balance means goods without an invoice (credit balance) or an invoice without goods (debit balance).
The standard postings for a stock material
Take a purchase order for 10 units at 100.00 each, with 19% input tax on the invoice.
| Step | Movement or document | Debit | Credit |
|---|---|---|---|
| Goods receipt | Movement type 101 | Inventory 1,000.00 | GR/IR clearing 1,000.00 |
| Invoice receipt | Logistics invoice verification | GR/IR clearing 1,000.00 and input tax 190.00 | Supplier (payables) 1,190.00 |
| Payment | Payment run in accounts payable | Supplier (payables) 1,190.00 | Bank 1,190.00 |
Each step creates its own documents:
- The goods receipt creates a material document and an accounting document.
- The invoice receipt creates an invoice document and an accounting document.
- The payment creates a payment document.
In S/4HANA, material documents are stored in table MATDOC. The accounting lines of all these documents end up in the Universal Journal, table ACDOCA.
How the system finds the accounts
You do not enter accounts during the goods receipt. The system determines them automatically. This is automatic account determination, configured in transaction OBYC.
The lookup works like this:
- The posting carries a transaction key, a code for the kind of line being posted.
- The system reads the valuation class of the material, set in the Accounting view of the material master.
- It reads the chart of accounts of the company code, and the valuation grouping code if one is used.
- It returns the G/L account stored for that combination.
The transaction keys you meet most in procure-to-pay are:
| Key | Meaning | Typical use |
|---|---|---|
| BSX | Inventory posting | Debit at goods receipt for stock material |
| WRX | GR/IR clearing | Credit at GR, debit at IR |
| GBB | Offsetting entry for inventory posting | Consumption or expense when goods go to an account assignment |
| PRD | Price differences | Variance between standard price and purchase price |
| UMB | Gains and losses from revaluation | Price differences when stock is lower than the invoiced quantity (moving average price) |
| KDM | Exchange rate differences | Gains or losses on foreign currency invoices |
Input tax is not set up in OBYC. It comes from the tax code on the invoice.
Consumables and account assignment
A purchase order item with an account assignment category, for example cost center, is not stock. At goods receipt the system debits an expense account, taken from the item's account assignment, and credits GR/IR. No inventory line is created. The invoice then clears GR/IR as before.
When the prices differ
The valuation price control in the material master decides what happens when the purchase price differs from the stock price.
With standard price, stock is always booked at the standard price. Say the standard price is 95.00 and the PO price is 100.00. At goods receipt:
| Account | Debit | Credit |
|---|---|---|
| Inventory | 950.00 | |
| Price differences (PRD) | 50.00 | |
| GR/IR clearing | 1,000.00 |
The credit to GR/IR uses the PO price, because that is what you expect to be invoiced. If the invoice is later for 1,000.00, GR/IR clears exactly. If the invoice differs from the PO, the difference is posted at invoice receipt, to PRD for standard price materials.
With moving average price, the purchase price flows into stock value and changes the average. An invoice difference is posted to the stock account if enough stock remains. If the goods have already been consumed, part of the difference goes to a price difference account (UMB or PRD).
Reading the postings
Use the document flow or the PO history (EKBE) to find the accounting document number. Then you can read its lines. This ABAP SQL reads the Universal Journal lines for one purchase order and prints the debit/credit indicator, account, and amount:
PARAMETERS p_ebeln TYPE ebeln OBLIGATORY.
SELECT rbukrs, gjahr, belnr, docln, racct, drcrk, hsl
FROM acdoca
WHERE rldnr = '0L'
AND ebeln = @p_ebeln
ORDER BY gjahr, belnr, docln
INTO TABLE @DATA(lt_lines).
LOOP AT lt_lines INTO DATA(ls_line).
" DRCRK: S = debit, H = credit
WRITE: / ls_line-rbukrs, ls_line-belnr, ls_line-racct,
ls_line-drcrk, ls_line-hsl.
ENDLOOP.Ledger 0L is the leading ledger. Sum the lines for the GR/IR account. If the sum is not zero, the order still has an open receipt or an open invoice.
Common errors
- "Account determination: account not found" or a similar message at goods receipt. The OBYC entry is missing for that transaction key and valuation class. Ask finance to maintain it. Do not change the material's valuation class to get around it.
- GR/IR balance never reaches zero. The usual causes are partial deliveries, partial invoicing, or a delivery marked complete too early. Check the PO history for each item.
- Wrong valuation class on the material. The goods receipt posts to the wrong inventory account. Changing the class later needs a controlled revaluation, because existing stock is already posted.
- Foreign currency invoices create unexpected differences. The goods receipt used one exchange rate and the invoice another. The gap goes to the KDM account.
Exercise
A material uses standard price 80.00. A purchase order for 5 units at 90.00 is received. What are the goods receipt postings, and which account takes the 50.00 difference?
Show answer
Debit Inventory 400.00 (5 x 80.00 standard price). Debit Price differences (PRD) 50.00 (5 x 10.00). Credit GR/IR clearing 450.00 (5 x 90.00, the PO price). The 50.00 difference goes to the PRD account.
Exercise
A PO item has account assignment category K (cost center). At goods receipt, which account is debited, and is there an inventory posting?
Show answer
The expense (consumption) account derived from the item's account assignment is debited, and GR/IR clearing is credited. There is no inventory posting because the item is not stock.