ERPClimb logoERPClimb
SAP enhancementObjectMB_CHECK_LINE_BADIModuleMM_P2P

New to SAP MM / P2P? Start with the module overview

MB_CHECK_LINE_BADI — MB_CHECK_LINE_BADI for Goods Movement Validation

Quick answer

MB_CHECK_LINE_BADI is suited to validating goods movement line items before material document posting. It is useful when a project needs to stop MIGO or related postings based on item data without putting error handling into material-document update logic.

SAP consultant reference for MB_CHECK_LINE_BADI: purpose, trigger/context, troubleshooting checks, safe implementation guidance and common production pitfalls.

Published 17 Nov 2026· 588 words

What it extends

MB_CHECK_LINE_BADI is suited to validating goods movement line items before material document posting. It gives a project a controlled way to stop MIGO or related postings based on item data, without putting error handling into material-document update logic where it would be harder to control and test.

When consultants use it

It is used when a custom rule must block a specific receipt or issue line based on material, plant, quantity or reference data, while leaving unrelated lines on the same document unaffected. Start from the exact business process and transaction or API path, since enhancement behavior can differ by posting origin, release and execution phase, and a filter written against the wrong document category can silently never fire.

How to implement and debug it

Check the enhancement definition, active implementations, calling transaction, document status, filter values and a known-good comparison before writing or moving logic.

For the recurring incident where MIGO rejects one receipt item although other lines on the same purchase order pass, check implementation filters and the precise point at which the line-check enhancement runs, since a blanket SELECT or a global error condition can block unrelated receipt items that never should have failed.

Reproduce with the exact purchase order, item, material, movement type and plant, compare the enhancement's input parameters against a passing item, and avoid a SELECT inside the item loop when reference data can be prefetched once. Validate the posting, cancellation and batch-managed flows separately with functional MM sign-off.

Clean core

MB_CHECK_LINE_BADI is a classic BAdI, not a released key-user extensibility option, so S/4HANA Cloud public edition has no equivalent in-app path for this exact check; it remains available on-premise and in private cloud.

Clean-core practice is to keep the implementation limited to the validation decision itself -- reading reference data and returning a message -- and to push any broader business logic to a released API or BTP side-by-side extension, so the classic BAdI stays a thin, easily auditable gatekeeper rather than a place where core business rules quietly accumulate over successive projects.

ECC vs S/4HANA

S/4HANA retains the same goods-movement line-check extension point, and MM teams increasingly pair it with released APIs for the data lookups the check depends on, rather than reading custom or cross-module tables directly from inside the BAdI, which keeps the validation portable across releases.

Common pitfalls

Prefer the narrowest supported extension rather than a broad global check, avoid update-task error messages, direct database changes and duplicate business logic spread across multiple implementations. For performance, compare a one-line receipt against a high-item-count document with ST05 and record call counts for each validation, ensure any user message names the actual material and item rather than a generic text, and confirm a plant-specific validation cannot accidentally reject other plants because the implementation assumed an uninitialized global field.

Whose problem this is

The ABAP developer owns method timing and the validation's defensive coding; the MM functional owner defines which material, plant and quantity conditions genuinely require the goods movement to be blocked.

Related SAP objects

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

Lessons and topics

Source: ERPClimb — https://erpclimb.com/sap-enhancements/mb-check-line-badiERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.