Sub topic 12
Invoice verification and the three-way match
This chapter assumes you know the purchase order (PO) and goods receipt (GR) steps from earlier chapters. It also assumes you can read a simple debit and credit posting. Here you will learn how a supplier invoice is checked against the PO and the GR, which documents and postings result, and the errors that most often block an invoice.
What invoice verification does
Invoice verification is the step where the company records a supplier's invoice and checks it against what was ordered and received. In SAP S/4HANA this is Logistics Invoice Verification (MM-IV). It creates an invoice document in Materials Management and an accounting document in Financial Accounting. The accounting document posts the liability to the supplier.
The check is called the three-way match. The system compares three things:
- Purchase order: the agreed quantity and price.
- Goods receipt: the quantity actually delivered and posted.
- Invoice: the quantity and amount the supplier is billing.
If the three agree within the allowed tolerances, the invoice posts and is released for payment. If they do not, the system either rejects the posting or posts it with a payment block.
Where the match is controlled
The match is not always three-way. Settings on the PO item decide what the system checks.
- Invoice receipt indicator (INVOICE_RECEIPT, "IR"): the item expects an invoice. Without it, you cannot post an invoice against the item.
- GR-based invoice verification indicator (GRBASEDIV): the system matches the invoice against each goods receipt, not only against the PO total. This is the strict form of the match. It is often set from the supplier master or the info record.
- Goods receipt indicator (GR_IND): the item expects a goods receipt. Without it, there is no GR to match against, so the check is effectively two-way (PO and invoice).
Service items usually match against service entry sheets instead of goods receipts. The idea is the same.
The invoice posting
Take an item with 10 pieces at a net price of 100.00 each. The GR was posted for 10 pieces and the invoice arrives for 10 pieces at 100.00. Tax is ignored here to keep the entries short.
Goods receipt, posted earlier:
| Account | Debit | Credit |
|---|---|---|
| Inventory (or consumption) | 1,000.00 | |
| GR/IR clearing | 1,000.00 |
Invoice receipt:
| Account | Debit | Credit |
|---|---|---|
| GR/IR clearing | 1,000.00 | |
| Supplier (accounts payable) | 1,000.00 |
After the invoice, the GR/IR account for this item is zero. The supplier account holds an open credit item of 1,000.00, which the payment run clears later. Output tax is a separate topic, but a real invoice also posts input tax to a tax account.
Posting an invoice in S/4HANA
The main Fiori app is Create Supplier Invoice (F0859). The classic transaction MIRO is still available. Both create the same documents.
A typical flow:
- Open the app and enter the invoice date, posting date, reference (the supplier's invoice number), and the gross amount.
- Enter the PO number. The system proposes the items that are open for invoicing, with quantities taken from the goods receipts.
- Check the proposed quantities and amounts. Adjust them to match the paper or e-invoice.
- Confirm that the balance (the difference between the entered gross amount and the sum of the items) is zero.
- Simulate the posting to see the accounting lines, then post.
The result is an invoice document number (a MM-IV document) tied to a fiscal year. The system also creates the accounting document. Both are stored in the PO history (table EKBE), where the invoice appears with movement type indicator VGABE 2.
Reading the PO history
You can see the match results in the PO history. This is the query from the topic's first code example. It lists goods receipts (VGABE 1) and invoice receipts (VGABE 2) per item.
SELECT ebeln, ebelp, vgabe, belnr, buzei, menge
FROM ekbe
WHERE ebeln = @lv_ebeln
ORDER BY ebelp, belnr
INTO TABLE @DATA(lt_history).
LOOP AT lt_history INTO DATA(ls_hist).
" VGABE 1 = goods receipt, 2 = invoice receipt
WRITE: / ls_hist-ebelp, ls_hist-vgabe, ls_hist-belnr, ls_hist-menge.
ENDLOOP.For one item, add up the VGABE 1 quantities and the VGABE 2 quantities. If both sums are equal, the item is fully invoiced against what was received. If the GR sum is larger, goods are received but not invoiced. If the invoice sum is larger, you were billed for more than you received.
The query returns each history row in the order of the item and the document number. Use lv_ebeln as a real PO number that exists in your system.
Common errors and how to read them
| Situation | What it usually means | What to do |
|---|---|---|
| The PO item does not appear in the proposal | No goods receipt yet on a GR-based item, or the item is already fully invoiced | Post the goods receipt first, or check the PO history |
| Balance is not zero | The entered gross amount does not equal the item total plus tax and any extra lines | Re-check the tax code, freight, and the amounts |
| Message about a price or quantity variance | The invoice differs from the PO or GR beyond the tolerance | Correct the entry, or post it with a block (see the next chapter) |
| Wrong tax code | The tax code on the invoice differs from the one proposed from the PO | Change the tax code before posting |
| Duplicate invoice message | The same reference, date, and amount were already posted for this supplier | Check for an existing document before overriding |
| Posting period is closed | The posting date falls in a closed period | Use an open period, as the company's rules allow |
Variances and what the system does with them
When the invoice does not match exactly, the system looks at the size of the difference.
- Within tolerance: the invoice posts, and the small difference is posted to a separate account, such as a price difference account.
- Outside tolerance: the system blocks the item for payment, or stops the posting with an error. Which one depends on the tolerance key and on whether the error is configured as a warning or an error.
Tolerances and blocking are the subject of the next chapter. For now, keep one point in mind. A blocked invoice is already posted and already creates a liability. It only cannot be paid until someone releases it.
Credit memos and reversals
A supplier credit memo reduces the amount you owe. In the app, you post it as a credit memo type, with reference to the PO or the original invoice. It reverses the invoice posting for the quantity and value you enter.
To undo a wrong invoice, use the cancel function, not a manual correction. Cancelling creates a reversal document and restores the invoiced quantity on the PO item. This keeps the PO history consistent.
Summary of the key points
- The three-way match compares PO, goods receipt, and invoice.
- The GR-based indicator makes the match strict, per goods receipt.
- A matched invoice clears the GR/IR account and creates the supplier liability.
- The PO history (EKBE) shows goods receipts as VGABE 1 and invoices as VGABE 2.
- A blocked invoice is still posted. It only cannot be paid.
Exercise
A PO item for 10 pieces at 100.00 each has a goods receipt for 6 pieces. The supplier invoices all 10 pieces. The item is set for GR-based invoice verification. What does the system propose for the invoice quantity, and what happens to the GR/IR account if you post only the proposed quantity?
Show answer
The system proposes 6 pieces, because on a GR-based item it only offers quantities that have been received. Posting 6 pieces debits GR/IR by 600.00 and credits the supplier by 600.00, which clears the GR/IR balance for those 6 pieces. The remaining 4 pieces cannot be invoiced until their goods receipt is posted.
Exercise
You run the PO history query and find, for one item, VGABE 1 quantities that sum to 20 and VGABE 2 quantities that sum to 25. What does this tell you, and which process step would you check?
Show answer
You were invoiced for 5 more pieces than were received. Check whether a goods receipt is missing or was reversed, and check whether the supplier over-billed. The invoice may have been posted with a block or within tolerance, so look at the invoice document and the blocking reason.