Sub topic 14
Incoming payments and clearing open items
This chapter assumes you know how billing creates a receivable in accounting. It also assumes you can read a simple debit/credit entry and a basic SELECT statement. Here the cycle closes: the customer pays, the bank receives cash, and accounting matches the payment against the invoice. That matching step is called clearing.
What happens at payment
Billing posts a debit to the customer account, the receivable. That line is an open item. An open item is a line on an account that is managed item by item, and it stays open until something offsets it. A payment is the offsetting event.
The incoming payment entry is:
| Line | Account | Debit | Credit |
|---|---|---|---|
| 1 | Bank (or bank clearing) account | 1,000.00 | |
| 2 | Customer reconciliation account (customer line) | 1,000.00 |
Clearing links the credit line to the open invoice line. The system gives both lines the same clearing document number and clearing date. Both lines are now cleared items. The customer's balance is unchanged by clearing itself, because the receivable was already reduced by the credit. Clearing only changes the status of the lines.
The payment is an accounting event only. It creates no sales order, delivery or billing document. The SD document flow ends at billing and the accounting document. You find the payment by following the customer line item, not the SD flow.
Ways a payment reaches the system
- Manual posting. An accountant posts the payment in the classic transaction F-28 or in the Fiori app Post Incoming Payments. The user enters the bank account, amount and customer, then selects the open items to clear.
- Electronic bank statement. The bank sends a statement file. The system posts the bank line and uses posting rules to find the customer and invoice, for example from the reference text. Lines it cannot match go to a worklist for manual handling.
- Lockbox. A bank in some countries sends check data in a lockbox file. The system posts and clears it in batch.
- Direct debit. The company collects from the customer through the payment program. The same clearing result follows.
All four end with a payment document and a clearing document, which are often the same document number.
Clearing scenarios
The amount paid rarely equals the invoice exactly. Choose the treatment by the cause of the difference.
| Situation | Treatment | Result |
|---|---|---|
| Payment equals invoice | Full clearing | Both lines cleared. |
| Payment is less, and the customer short-paid for a known reason | Residual item | The original invoice line is cleared. A new open item for the difference is created and refers to the invoice. |
| Payment is less, and the reason is not yet known | Partial payment | The invoice stays open. The payment is posted as a separate open item with a reference to the invoice. |
| Payment has no known invoice | Payment on account | A credit stays open on the customer account until it is assigned. |
| Customer pays early within terms | Cash discount | The discount is posted to a discount expense account during clearing. |
Cash discount
Payment terms can offer a discount for fast payment, for example 2% within 10 days. If the customer pays 980.00 on a 1,000.00 invoice within the period, clearing posts:
- Debit bank 980.00
- Debit cash discount expense 20.00
- Credit customer 1,000.00
The expense account comes from account determination, as covered in the accounting integration chapter. The discount percentage and the baseline date come from the payment terms copied onto the invoice.
Residual item or partial payment
The choice affects reporting. A residual item closes the invoice and carries on the difference as a new item, which is right when you know the shortfall is a dispute or a deduction. A partial payment keeps the invoice open, which is right when you expect the customer to pay the rest.
Verifying open and cleared items in the tables
In S/4HANA the customer line items are stored in the Universal Journal table ACDOCA. The older tables BSID (open customer items) and BSAD (cleared customer items) still exist, but they are compatibility views over ACDOCA. The clearing information sits in the fields AUGBL (clearing document) and AUGDT (clearing date). KOART = 'D' marks customer lines.
The first query lists open customer items. An item is open when AUGBL is empty.
DATA(lv_kunnr) = CONV kunnr( '0000100001' ).
SELECT rbukrs, gjahr, belnr, docln, budat, hsl, rhcur
FROM acdoca
WHERE rldnr = '0L'
AND koart = 'D'
AND kunnr = @lv_kunnr
AND augbl = ''
INTO TABLE @DATA(lt_open).The second query shows what a clearing document cleared. The document number below is an example.
DATA(lv_augbl) = CONV augbl( '1400000123' ).
SELECT rbukrs, gjahr, belnr, docln, koart, kunnr, racct, hsl, augdt, augbl
FROM acdoca
WHERE rldnr = '0L'
AND augbl = @lv_augbl
INTO TABLE @DATA(lt_cleared).Run the second query and you see the invoice line and the payment line, both with the same AUGBL and AUGDT. Amounts in HSL follow the sign convention of the ledger: debits are positive and credits are negative. For a fully cleared set of lines in one currency, the amounts add up to zero.
Common errors
- Payment posted but invoice still open. The payment went to the account but was never assigned. Look for an open credit on the customer account, which is a payment on account, and assign it to the invoice.
- Wrong customer. If the payer is a different business partner than the sold-to party, the line lands on the wrong account. Check the payer function on the order, and the alternative payer or head office setup.
- Cash discount posted to the wrong account. The discount expense account is set in account determination for the chart of accounts. A missing entry stops the posting or sends the amount to an unexpected account.
- Clearing in the wrong period. The clearing date follows the posting date entered by the user. Posting the payment into a closed period fails, and a posting date from an older period changes period reporting.
- Need to undo. First reset the clearing (transaction FBRA), which reopens the lines. Then reverse the payment document if it was wrong (FB08).
Exercise
A customer owes invoice 90001234 for 1,000.00 and pays 950.00 with no explanation. Your team expects the missing 50.00 to arrive next week. Which treatment do you use, and what happens to the invoice line?
Show answer
Post a partial payment. The invoice line stays open at 1,000.00, and the 950.00 payment is posted as a separate open item that refers to the invoice. When the customer pays the remaining 50.00, you clear all three lines together. A residual item would clear the invoice now and leave a 50.00 item, which is wrong here because the shortfall is not a confirmed deduction.
Exercise
You run a query on ACDOCA for one customer with koart = 'D' and augbl = ''. What does the result show, and how would you find the payment that cleared a specific invoice?
Show answer
The query returns the customer's open items, the lines that no clearing document has cleared. To find the payment that cleared an invoice, select the invoice line and read its AUGBL value, then query ACDOCA again with that clearing document number to see all lines cleared together, including the payment.