BAPI_CUSTOMER_GETLIST — BAPI_CUSTOMER_GETLIST customer master lookup
BAPI_CUSTOMER_GETLIST is a read-only BAPI that returns a list of customer master records matching selection criteria such as number range, name, city, postal code or search term. It mirrors the customer search behind XD03 or the business partner search, not a full master data read, and returns basic address data only, not company code or sales area segments.
This page covers BAPI_CUSTOMER_GETLIST, the selection BAPI used to find customers matching address or name criteria without reading a specific customer number. It focuses on the row limit trap, the difference between an empty result and an error, and why the returned data is thinner than most callers expect.
Published 16 Sept 2026· 987 words
What it does
BAPI_CUSTOMER_GETLIST searches the customer master by criteria rather than by a known customer number. It acts on the general data and address segments of the customer object, the same data a user would search against on the customer search help or the classic XD03 matchcode. It does not return company code data (reconciliation account, payment terms) or sales area data (pricing, delivering plant, customer group). Interfaces call it when they need to resolve a customer from partial information, for example matching an incoming EDI partner by name and postal code, or building a picklist for an integration scenario where the exact customer number is not yet known. It is a finder, not a full master data extract, and every downstream step that needs commercial data has to follow up with a separate read.
Important parameters
The interface is selection-in, list-out, with no update capability. Key parameters, described where the exact field structure is not something to state with certainty:
- Selection criteria (import) - a set of range fields for customer number, name, city, postal code, country and region, plus a search term field; used to narrow the customer master search the way the matchcode search screen does.
- MAXROWS - caps the number of rows the call returns; a broad selection combined with a low MAXROWS silently truncates the result set rather than raising an error.
- CUSTOMERLIST (export, table) - one row per matching customer with basic identifying and address data: customer number, name, city, postal code, country, region.
- RETURN (export, table) - standard BAPI return structure carrying messages about the selection itself, for example an invalid range or an authorization restriction; it is not populated just because the result set is empty.
Commit behaviour
There is nothing to commit. BAPI_CUSTOMER_GETLIST only reads; it does not open a database LUW that needs BAPI_TRANSACTION_COMMIT, and calling commit after it is a harmless no-op. The risk on this BAPI is not a missing commit, it is a caller assuming the read reflects the very latest state of a customer changed moments earlier in a parallel session and not yet committed there, which produces a stale or missing row rather than a locking error.
Return handling
RETURN is a table, and on a clean search with matches it is typically empty even though CUSTOMERLIST is full of rows. That is the first trap: a caller who checks RETURN for content and treats empty as failure will incorrectly abort a perfectly successful zero-match search, because a legitimate no-match result also leaves RETURN empty. The correct read is to check RETURN for entries of type E or A first, and only then interpret an empty CUSTOMERLIST as a genuine no-match rather than an error. The second trap is MAXROWS truncation: when the row cap is hit, the call does not raise a warning in RETURN, it simply stops filling CUSTOMERLIST, so a caller who assumes the returned list is complete builds downstream processing on a partial customer population without any signal that data was cut off. Interfaces that page through large customer master files by calling this BAPI repeatedly with an incrementing range need to detect the truncation themselves by comparing returned row count against MAXROWS, since the BAPI will not tell them.
ECC vs S/4HANA
On S/4HANA the customer master is a business partner with customer role, and customer-vendor integration keeps the classic customer tables populated for compatibility. BAPI_CUSTOMER_GETLIST still runs and still returns results, but new integration builds are steered toward business partner search capabilities, including the business partner API service, rather than this legacy BAPI. It remains acceptable for maintaining existing ECC-era interfaces; it is not the recommended starting point for a new build.
Common pitfalls
Most incidents trace back to treating the returned list as more complete or more detailed than it actually is.
- MAXROWS silently truncates the result; a batch job built around this call assumes it has the full customer population and misses records with no error raised.
- Authorization filtering means two users running the identical selection get different row counts, which looks like a data inconsistency but is an authorization difference.
- CUSTOMERLIST carries address data only; interfaces that need reconciliation account, payment terms or sales area attributes have to follow up with a full customer read, and skipping that step causes downstream postings to fail for missing commercial data.
- Selection criteria behave differently across fields, some support wildcard patterns and others expect exact or range matches, and assuming uniform wildcard behaviour produces unexpected empty or oversized result sets.
- Performance degrades sharply on broad selections against a large customer master with no number range narrowing, causing RFC timeouts that get misdiagnosed as a network issue rather than a selection design problem.
Whose problem this is
This sits with the interface developer first, since the failure modes are almost entirely about how the caller reads RETURN and handles MAXROWS, not about the master data itself. Functional gets pulled in only when the search genuinely returns the wrong customers, in which case they need the exact selection criteria used and a screenshot of the equivalent manual search for comparison.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-customer-getlistERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.