SAP BAPIObjectBAPI_AR_ACC_GETOPENITEMSModuleFI_FICO

BAPI_AR_ACC_GETOPENITEMS — BAPI for reading customer open items

BAPI_AR_ACC_GETOPENITEMS is a read-only BAPI that returns the open items for a customer account in a given company code, mirroring what FBL5N displays. It takes a customer number, company code and key date, and returns a table of open items plus a RETURN table. It changes nothing and needs no commit.

This page covers BAPI_AR_ACC_GETOPENITEMS, the read-only BAPI used to pull a customer's open accounts receivable items programmatically, equivalent to the customer line item display transaction. It focuses on the parameters that actually matter, how the key date silently changes the result set, and the RETURN-handling mistakes that cause interfaces to report false negatives.

Published 16 Sept 2026· 1,009 words

What it does

The BAPI reads open items posted against a customer account in Financial Accounting, the same data set shown by the customer line item display transaction (FBL5N) when filtered to open items. It does not post, change, or clear anything. It is used to build custom AR aging reports, feed collections and credit management tools, drive dunning-adjacent checks outside standard dunning, or expose customer balance data to external systems such as a customer portal or a factoring interface. Because it is read-only, it is a common building block in integration scenarios where an external system needs a live snapshot of what a customer still owes as of a particular date, without granting that system direct table access to BSID or cluster tables.

Important parameters

The interface is narrow and most of the value is in getting the key date and flags right rather than in the number of fields.

  • CUSTOMERNUMBER - the customer account number the open items are read for
  • COMPANYCODE - restricts the selection to open items posted in this company code
  • KEYDATE - the date as of which open status is evaluated; items cleared on or before this date are excluded
  • NOTEDITEMS - flag controlling whether noted items such as down payment requests and statistical postings are included in the result
  • OPENATKEYDATE - flag controlling whether an item cleared after the key date is still treated as open as of that date
  • RETURN - the standard return table carrying messages, including authorization failures and invalid selection errors

Commit behaviour

This BAPI performs no database change, so there is nothing to commit. Calling BAPI_TRANSACTION_COMMIT afterward is harmless but pointless; it has no effect on the result already returned. Forgetting a commit causes no error and no data loss, because none was ever at risk. The behaviour that actually matters is the opposite of the usual BAPI concern: developers sometimes wrap this call in the same commit-and-rollback logic used for posting BAPIs out of habit, which adds unnecessary LUW overhead in a report or interface program that is only reading data and never should touch the update task.

Return handling

RETURN follows the standard BAPIRET2 structure with TYPE, ID, NUMBER and MESSAGE fields, and it must be checked even though the call is read-only. An empty result table does not by itself mean the customer has no open items; it can equally mean the customer number does not exist, the customer is not extended to the given company code, or the calling user lacks authorization for that company code, and in all of these cases RETURN carries an error or warning message that the caller ignored. The recurring interface bug is treating 'no rows returned' as a business fact rather than checking RETURN first for a type E or A entry. A second, quieter bug is ignoring warning-level entries in RETURN that indicate the key date was defaulted or that noted items were silently excluded, which then produces an aging total that reconciles against nothing in the general ledger. Any consumer of this BAPI should inspect RETURN before trusting an empty item table as a zero balance.

ECC vs S/4HANA

The BAPI remains callable on S/4HANA and continues to return correct results because the read is served against the same open-item logic sitting on top of the universal journal. There is no formal replacement or deprecation notice attached to it, so existing custom code built on it keeps working after migration. For new development, released Fiori-based line item apps and OData or CDS-based reporting services are generally the preferred route where they exist, since they align better with S/4HANA's reporting model, but this BAPI is not blocked and is still a reasonable choice for point-to-point integrations that only need a customer's open item list.

Common pitfalls

Most incidents involving this BAPI trace back to the key date and to flag defaults rather than to the BAPI itself misbehaving.

  • Empty item table misread as a zero balance when the real cause is the customer not being extended to the requested company code or sales area
  • KEYDATE left blank or defaulted differently than expected, so a nightly batch run crossing midnight returns a different open-item set than the same call made an hour earlier
  • NOTEDITEMS flag left at its default causing down payment requests or statistical items to appear in a result feeding an aging report, inflating totals that never appear in the general ledger
  • Large customer accounts with a high volume of open items returned in a single call with no pagination, causing memory pressure in the calling program
  • Parameters swapped with the AP sibling BAPI during copy-paste development, sending a vendor number into CUSTOMERNUMBER or vice versa, which fails silently with an authorization or not-found message rather than a syntax error

Whose problem this is

Functional (FI-AR) owns discrepancies between what this BAPI returns and what the business expects to see, since most causes are master data or key-date related rather than code defects. Developers should hand over the exact CUSTOMERNUMBER, COMPANYCODE, KEYDATE and flag values used, together with the full RETURN table, so functional can reproduce the same selection in the line item display transaction.

Related SAP objects

Reviewed pages this object connects to in the ERPClimb knowledge graph.

Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-ar-acc-getopenitemsERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.