Sub topic 16
Reporting on journal entry data and reconciling balances to line items
This chapter assumes you know the trial balance, the Universal Journal (table ACDOCA), and the ledger concept from earlier chapters. SQL reading skills help for the optional checks.
Why reconcile
Every balance in a financial report is a sum of journal entry line items. If a report shows a balance you can't trace to line items, you can't defend it to an auditor. Reconciliation means proving that the reported number equals the sum of the underlying lines.
In S/4HANA there is one line-item table, so the check is simple. You don't need to compare separate FI, CO, and asset tables.
The reporting stack
Reports read data through layers. Apps and analytical queries sit on top of CDS views, which are database views defined in the ABAP Dictionary. The CDS views read ACDOCA.
SAP delivers released CDS views for journal entry data, such as I_JournalEntryItem. Use released views in custom reports. SAP can change the table structure in an upgrade, and the released views are the stable interface.
Reconcile a balance to line items
Take a G/L account balance shown in the trial balance. Reconcile it in three steps.
- Fix the filters: ledger, company code, fiscal year, and period range. A mismatch in any one of these is the most common cause of a difference.
- Sum the signed amounts for that account from the line items.
- Compare the sum to the report. Then open the line items to see which entries make up the balance.
The query below sums the company code currency amount (HSL) per account. The values '1010', '2025', and ledger '0L' are samples.
SELECT racct,
SUM( hsl ) AS balance
FROM acdoca
WHERE rldnr = '0L'
AND rbukrs = '1010'
AND gjahr = '2025'
AND poper <= '012'
GROUP BY racct
ORDER BY racct
INTO TABLE @DATA(lt_balances).Amounts in ACDOCA are signed. Debits are positive and credits are negative. Your sums will therefore show credit balances as negative numbers.
Check that entries balance
A second check looks for entries that don't net to zero. In a single-currency company code, each journal entry should sum to zero per ledger.
SELECT rldnr, rbukrs, gjahr, belnr,
SUM( hsl ) AS doc_balance
FROM acdoca
WHERE rbukrs = '1010'
AND gjahr = '2025'
GROUP BY rldnr, rbukrs, gjahr, belnr
HAVING SUM( hsl ) <> 0
INTO TABLE @DATA(lt_unbalanced).This query should return no rows. Any row it returns needs investigation.
Common causes of differences
| Symptom | Likely cause |
|---|---|
| Report and query differ by a fixed amount | Different ledger, for example a non-leading ledger |
| Difference only in the current period | Report includes special periods 013 to 016, or your query excludes them |
| Sign looks reversed | Report shows credits as positive, ACDOCA stores them as negative |
| Totals differ by currency | You summed HSL in company code currency, but the report uses another currency type |
Exercise
Your query on ACDOCA for account 400000 returns -85,000, and the trial balance for the same company code and year shows 85,000. Name two checks before you assume a data error.
Show answer
First, check the sign convention: ACDOCA stores credits as negative, and reports often display them as positive. Second, check that ledger, period range (including special periods), and currency type match between the query and the report.