BAPI_ACC_DOCUMENT_CHECK — BAPI_ACC_DOCUMENT_CHECK Validation Without Posting
BAPI_ACC_DOCUMENT_CHECK validates an accounting document exactly as BAPI_ACC_DOCUMENT_POST would, using the same interface structures, but writes nothing to the database. It returns the same style of RETURN table so a calling program can catch errors before committing to a real posting call, without generating a document number or requiring a commit.
This page covers BAPI_ACC_DOCUMENT_CHECK, the dry-run counterpart to BAPI_ACC_DOCUMENT_POST used to validate account assignments, tax, and currency data before an actual posting attempt. It focuses on how the RETURN table must be parsed line by line and why a clean check result does not guarantee a clean subsequent post.
Published 16 Sept 2026· 1,047 words
What it does
BAPI_ACC_DOCUMENT_CHECK acts on the same generic accounting document object as BAPI_ACC_DOCUMENT_POST, covering general ledger, customer, vendor and tax line items in one call. It mirrors the validation logic that runs behind FB01, FB60, FB70 and similar posting transactions: account existence, company code assignment, currency and amount consistency, tax code determination, and cost object validity. The difference is that it stops short of the actual database update. No document number is drawn from the number range, no accounting document table entry is created, and no financial period is touched. It exists specifically for interface scenarios where an external system needs to know whether a document would be accepted before committing the business transaction that produces it, for example a billing or procurement system deciding whether to proceed with a downstream posting.
Important parameters
- DOCUMENTHEADER - company code, document date, posting date, document type and header text, the same structure used by BAPI_ACC_DOCUMENT_POST.
- CUSTOMERCPD - one-time customer address data when the transaction involves a CPD account.
- ACCOUNTGL - general ledger line items: G/L account, amount, cost center, profit center, and other assignment fields.
- ACCOUNTRECEIVABLE - customer line items including customer number, payment terms and dunning data.
- ACCOUNTPAYABLE - vendor line items including vendor number and payment block indicators.
- ACCOUNTTAX - tax line items with tax code, tax jurisdiction and tax amount.
- CURRENCYAMOUNT - amounts in document currency, local currency and, where relevant, a second local currency.
- CRITERIA - optional selection criteria used in some check scenarios to narrow validation scope.
- EXTENSION1 - customer-defined structure passed through to enhancement points for custom field validation.
- RETURN - table of BAPIRET2-style messages describing every problem found, the only reliable indicator of success or failure.
Commit behaviour
There is nothing to commit. Because the function performs validation only, it never calls an update task and never writes to the database, so a caller does not need to follow it with BAPI_TRANSACTION_COMMIT. Calling COMMIT after this BAPI is harmless but pointless, since there is no pending work in the update queue. The risk runs the other way: some interface developers assume that because BAPI_ACC_DOCUMENT_POST needs a commit, this one does too, and add unnecessary commit logic that occasionally masks an unrelated LUW from an earlier call in the same session. The safer mental model is that this BAPI has no side effects at all beyond the RETURN table it hands back.
Return handling
RETURN can contain multiple lines and mixes severities: S and I for informational confirmations, W for warnings the actual posting will still accept, E and A for conditions that will cause BAPI_ACC_DOCUMENT_POST to reject the same data. The recurring interface bug is checking only the first line, or checking sy-subrc after the RFC call instead of inspecting the table, and treating an empty first row as success while a real error sits in row three. A second common mistake is treating any non-empty RETURN as failure, which causes documents to be rejected on nothing worse than an informational message about a rounding adjustment. The correct pattern loops the full table, tests TYPE against E and A specifically, and surfaces MESSAGE together with FIELD and ROW so the calling process can point at the exact line item that failed, rather than showing a generic 'posting check failed' message to the business user.
ECC vs S/4HANA
BAPI_ACC_DOCUMENT_CHECK still works unchanged on S/4HANA and continues to be RFC-enabled, since it sits on the same generic accounting interface as its posting counterpart. SAP's longer-term direction for journal entry integration is a set of released OData and SOAP services under the API Business Hub rather than classic BAPIs, and new interfaces are generally steered toward those services where a suitable one exists. Existing custom or third-party interfaces built on this BAPI are not broken by the move to S/4HANA and do not need to be migrated purely for that reason.
Common pitfalls
- A clean check result is treated as a guarantee that the subsequent BAPI_ACC_DOCUMENT_POST will succeed, when in fact a number range gap, a newly closed posting period, or a changed exchange rate between the two calls can still cause the real post to fail.
- Middleware or PI/PO interfaces that only read the first RETURN line silently drop later error messages, so a rejected document reaches the business user with no explanation.
- Tax jurisdiction determination that depends on plant or delivery data not passed into the check structures produces a false pass, because the check has less context than the full posting transaction actually used downstream.
- Calling the check repeatedly in a tight loop without clearing internal tables between calls causes RETURN entries from a previous iteration to bleed into the next, producing error counts that do not match the input volume.
- Custom validation added through the extension structure is skipped in the check call but enforced in the post call, so testing against check alone gives a false sense of interface readiness.
Whose problem this is
Functional consultants own the business rules being validated: account determination, tax code assignment, cost object rules. Developers own the RFC call itself and how RETURN is parsed and surfaced. When a check passes but the real posting fails, the evidence needed is the exact input structures sent to both calls side by side, since a mismatch there almost always explains the discrepancy rather than a defect in the BAPI itself.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-acc-document-checkERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.