SAP BAPIObjectBAPI_MATERIAL_STOCK_REQ_LISTModuleMM_P2P

BAPI_MATERIAL_STOCK_REQ_LIST — Read-Only BAPI for Stock Requirements List Data

BAPI_MATERIAL_STOCK_REQ_LIST returns the stock and requirements situation for a material at plant or MRP area level, mirroring what transaction MD04 displays on screen: warehouse stock, purchase orders, planned orders, production orders, reservations, and sales orders as individual MRP elements with dates and running available quantities. It is read-only and changes nothing in the database.

This page covers what BAPI_MATERIAL_STOCK_REQ_LIST returns, how to interpret its output table correctly, and the timing and volume traps that show up when it is wired into an external planning or dashboard interface. It also separates functional ownership of the MD04 logic from the technical ownership of the extraction call.

Published 16 Sept 2026· 980 words

What it does

BAPI_MATERIAL_STOCK_REQ_LIST retrieves the stock/requirements situation for a material at plant or MRP area level, the same data set that transaction MD04 renders as a running list. Each line it returns corresponds to an MRP element: physical warehouse stock, open purchase orders, planned orders, production or process orders, reservations, and sales order requirements, each carrying a date and a quantity, together forming the same cumulative available-quantity picture MD04 shows the planner. It is a query, not a maintenance BAPI. Nothing it does creates, changes, or deletes a document. It exists so external planning tools, supplier portals, or reporting layers can pull the MD04 view programmatically instead of requiring a user to open the transaction and read the screen manually.

Important parameters

  • MATERIAL - the material number the stock/requirements situation is read for
  • PLANT - the plant the query is scoped to; required unless MRP area is used instead
  • MRP_AREA - the MRP area, relevant only where MRP area management is active; leaving it blank returns the plant-level view
  • MRP_ELEMENTS - the output table, one row per MRP element, carrying element type, date, quantity, and the running available quantity in the same order MD04 lists them
  • RETURN - the standard BAPI return table carrying messages, message type, message class, and number for anything that went wrong or was skipped during the read

Commit behaviour

This is a read-only BAPI. It does not post, change, or delete anything, so there is no commit to worry about. Calling BAPI_TRANSACTION_COMMIT after it has no effect because the database was never touched. Interfaces sometimes call it in the same wrapper as posting BAPIs and add a commit reflexively out of habit; it is harmless here but worth removing so the next person reading the interface code does not assume a change was made.

Return handling

RETURN must be scanned for message type before the MRP_ELEMENTS table is trusted. An empty RETURN table does not guarantee a meaningful result; it can also mean the material/plant combination has no open MRP elements at all, which is a valid business state, not an error. Conversely, a type E entry pointing at an invalid plant or a material not extended to that plant means MRP_ELEMENTS will be empty for a completely different reason, and treating both cases the same in downstream logic causes false 'no demand' conclusions that ripple into supplier communication or replenishment decisions. Interfaces that only check whether MRP_ELEMENTS has rows, and skip RETURN entirely, are the most common bug: a locked MRP data area or a temporary read failure returns zero rows with a warning in RETURN that nobody looked at, and the caller reports 'no stock, no requirements' when the truth is 'could not read'. Always pair the row count check with an explicit RETURN scan for type E or A before drawing any conclusion.

ECC vs S/4HANA

In S/4HANA the equivalent screen is the Stock/Requirements List Fiori app, built on newer CDS-based data sources rather than the classic MD04 read logic. BAPI_MATERIAL_STOCK_REQ_LIST still works in compatibility mode and continues to return the expected structure, but new integration work should first check whether a released OData or API Business Hub service covering the same stock/requirements list exists for the target release, since those are built for external consumption and tend to be better documented and supported than a classic BAPI wrapper around an MD04-era function.

Common pitfalls

  • Called in a tight loop across thousands of materials for a batch interface; there is no mass variant, so each call is a fresh read and the cumulative runtime becomes the bottleneck rather than any single call
  • MRP area left blank when MRP area management is active for the material, returning an incomplete or misleading plant-level aggregate instead of the area-specific list the planner actually works from
  • Result treated as a static extract when it is a snapshot at call time; if the interface caches it and compares against a later MD04 screen, discrepancies get reported as data errors when they are simply timing
  • Confused with BAPI_MATERIAL_AVAILABILITY, which answers an ATP question for a specific requested quantity and date, not the full running list this BAPI returns; using the wrong one produces answers that look plausible but answer a different question
  • Called during or immediately after an MRP run for the same plant, occasionally hitting temporary locks on the underlying planning tables and returning a warning instead of the expected data

Whose problem this is

Functional MM/PP owns what the stock/requirements picture for a material should look like and whether MRP area logic applies; that side should be able to reproduce the same numbers in MD04 for comparison. Development owns the extraction wrapper, the RETURN handling, and any caching or batching logic; when the interface disagrees with MD04, the first ask is a side-by-side screenshot of MD04 against the raw MRP_ELEMENTS dump for the same material, plant, and timestamp.

Related SAP objects

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

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