BAPI_MATERIAL_AVAILABILITY — BAPI for material ATP availability checks
BAPI_MATERIAL_AVAILABILITY runs an ATP-style availability check for a material at a plant, mirroring the logic behind transaction CO09. It is a read-only check: it does not reserve stock, create a requirement, or change any table. Callers use it to get an availability quantity or date before deciding whether to create an order, and it depends entirely on the checking rule and scope of check assigned in customizing.
This page covers BAPI_MATERIAL_AVAILABILITY, the remote-enabled check that reproduces the CO09 availability overview for a material and plant. It focuses on why the returned quantity often disagrees with what a user sees on screen, how to read RETURN correctly, and where the S/4HANA advanced ATP redesign changes the picture.
Published 16 Sept 2026· 1,134 words
What it does
BAPI_MATERIAL_AVAILABILITY checks whether a requested quantity of a material can be confirmed at a given plant on a given date, using the same ATP logic that sits behind the CO09 availability overview screen. It does not post anything and does not touch the material master or stock tables; it evaluates the current stock and requirements situation according to the checking group and checking rule that apply, and returns a confirmed quantity or date. It is typically called from custom order-entry logic, interfaces that need a pre-check before creating a sales order or production order, or batch jobs that screen a list of materials for shortages before triggering procurement. The result reflects a point-in-time snapshot; it is not a reservation and gives no guarantee the same quantity will still be available a moment later.
Important parameters
The interface is deliberately narrow compared to posting BAPIs, since it only reads and evaluates data rather than creating anything.
- MATERIAL - the material number to check; must exist and be extended to the plant passed in
- PLANT - the plant against which the ATP situation is evaluated
- UNIT - unit of measure for the requested quantity; if left blank the base unit of measure is assumed, which can silently distort the result if the caller intended a different unit
- CHECKRULE - the ATP checking rule controlling which stock and requirement categories are included in the calculation; this is where most result discrepancies originate
- REQUIREMENT_DATE - the date the caller wants the material available by; omitting it defaults to a check as of today, which is rarely what an interface actually wants
- RETURN - the standard return structure carrying messages and, critically, the error/success indication for the whole call
Commit behaviour
This BAPI is a pure check function; it does not write anything to the database and therefore requires no BAPI_TRANSACTION_COMMIT afterward. Calling COMMIT after it is harmless but pointless, and its presence in an interface is usually a sign the developer copy-pasted a posting-BAPI pattern without checking whether it applied here. The absence of a commit is not itself a bug to chase; if a defect looks like it stems from a missing commit around this call, the real cause is almost always somewhere else in the same program, typically a posting BAPI called immediately before or after it in the same LUW.
Return handling
RETURN follows the usual convention: check every line for TYPE E or A before trusting the availability result, not just whether the table is empty. The trap specific to this BAPI is different from posting BAPIs: a technically successful call with an empty RETURN can still report zero available quantity, which is a valid business result, not a failure. Interfaces that treat 'no error messages' as 'material is available' will wrongly confirm orders when the correct read of the output is that nothing was confirmable on the requested date. The reverse mistake also happens: a warning about the checking rule or scope of check gets swallowed because the caller only filters on TYPE E, and the resulting availability figure is quietly based on a fallback checking rule the caller never intended. Always inspect the availability quantity and date fields together with RETURN, not RETURN in isolation, and log the checking rule that was actually applied, since customizing can substitute a default rule when the one passed in does not exist for the plant.
ECC vs S/4HANA
On S/4HANA, classic ATP as evaluated by this BAPI still runs and can still be called, but SAP's direction for availability checking has moved to advanced Available to Promise, which uses a different calculation engine and different released interfaces once activated for a material or check control combination. Where advanced ATP is switched on, results from this classic BAPI can diverge from what aATP-driven transactions and Fiori apps show, because the two engines do not share the same logic. For new S/4 builds using advanced ATP, the recommended approach is to use the ATP-specific released APIs rather than this BAPI; where advanced ATP is not active, the classic call remains valid.
Common pitfalls
Most failures trace back to a mismatch between what the BAPI was told to check and what the business user sees on the CO09 screen.
- Checking rule passed by the interface does not match the checking group assigned to the material, so the BAPI evaluates a different scope of check than the one used by sales or production order creation, giving a confirmed quantity that later order creation contradicts
- Storage location or batch restrictions applied manually on the CO09 screen are not replicated by the BAPI call, so plant-level availability looks fine while the specific storage location the order will actually draw from is empty
- Requirement date left blank defaults to the current date, so an interface intending to check availability for a future delivery date gets an answer for today instead and confirms quantities that will not exist by the real requirement date
- Calling the BAPI once per line item in a loop for a large sales order creates a heavy sequence of ATP evaluations; mass processes should batch or throttle this rather than hammer it item by item
- Result is treated as a soft reservation; between the check and the actual order creation another process consumes the same stock, so the confirmed quantity from the BAPI no longer holds by the time the order posts
Whose problem this is
This sits mostly with MM or SD/PP functional consultants, since the result depends entirely on checking group, checking rule, and scope of check customizing rather than on the interface code. Development owns correct parameter passing and correct interpretation of RETURN. When a result looks wrong, functional needs to reproduce the same check manually in CO09 with the same date and rule before assuming the BAPI is broken.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-material-availabilityERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.