MRP Live BAdI enhancements not working after upgrade - customization lost after S/4HANA migration

We upgraded our production system to S/4HANA 1809 last week and our custom MRP Live BAdI enhancements stopped working completely. We had implemented custom logic in the MRP_CL_MRP_LIVE enhancement spot to adjust safety stock calculations based on seasonal demand patterns.

After the upgrade, the BAdI is being called but our custom code isn’t executing. The interface seems to have changed:

METHOD if_mrp_live_badi~adjust_planning_result.
  " This method signature no longer matches
  ls_result-safety_stock = calculate_seasonal_stock( ).
ENDMETHOD.

Production planning is now using default safety stock values, causing potential stockouts. Has anyone dealt with MRP Live BAdI interface changes in 1809? Do we need to migrate to a different enhancement spot or reimplement using a new approach?

Here’s the complete migration approach based on our successful 1809 upgrade:

1. Enhancement Spot Compatibility: The old MRP_CL_MRP_LIVE enhancement spot is obsolete. You must migrate to the new MRP_S4_PLANNING_BADI enhancement spot. Create a new BAdI implementation using transaction SE19 or SE18.

2. Interface Changes - New Method Structure:

METHOD if_mrp_s4_planning_badi~adjust_planning_data.
  LOOP AT ct_material_planning ASSIGNING FIELD-SYMBOL(<fs_plan>).
    <fs_plan>-safety_stock = calculate_seasonal_stock(
      iv_material = <fs_plan>-material
      iv_plant = <fs_plan>-plant ).
  ENDLOOP.
ENDMETHOD.

3. Custom Logic Migration Strategy:

  • Extract your core calculation logic (seasonal_stock algorithm) into a separate method - this code can be reused
  • Rewrite the data access layer to work with CT_MATERIAL_PLANNING table instead of flat parameters
  • The new structure provides IT_PLANNING_CONTEXT for accessing additional planning run data
  • Map old parameter names to new structure fields (MATNR → MATERIAL, WERKS → PLANT, etc.)

4. Key Technical Changes:

  • Input parameters changed from single material to batch processing table
  • Return values now modify CT_MATERIAL_PLANNING directly instead of separate exporting parameters
  • Access to planning context expanded through IT_PLANNING_CONTEXT structure
  • Filter criteria must be configured in SPRO (not just code-based filters)

5. Activation Steps:

  • Implement new BAdI class inheriting from IF_MRP_S4_PLANNING_BADI
  • Activate BAdI implementation in SE19
  • Configure in SPRO: Production Planning → MRP → MRP Live → Business Add-Ins → Activate BAdI for Planning Data Adjustment
  • Set filter values for plants/material types in customizing tables
  • Assign implementation to enhancement spot MRP_S4_PLANNING_BADI

6. Testing Checklist:

  • Test with single material MRP run (MD02)
  • Test with collective MRP run (MD01) for multiple materials
  • Verify safety stock values in MD04 stock/requirements list
  • Check planning run logs for BAdI execution confirmation
  • Validate seasonal calculation results match expected values
  • Test filter logic works correctly for different plant/material combinations
  • Performance test with high-volume planning runs

7. Common Pitfalls:

  • Forgetting SPRO activation (BAdI won’t execute even if code is correct)
  • Not updating filter values in customizing (BAdI executes but skips materials)
  • Incorrect field mappings between old and new structures
  • Not handling batch processing logic (new interface processes multiple materials per call)

8. Rollback Plan:

  • Document current safety stock values before testing
  • Keep old enhancement spot code archived for reference
  • Test in sandbox for minimum 2 weeks before production deployment
  • Have manual safety stock adjustment procedure ready as contingency

The migration typically takes 3-5 days for development plus 1-2 weeks testing. Budget additional time if you have complex custom logic beyond basic safety stock adjustments. The new interface is actually more powerful once migrated - you get better performance with batch processing and more planning context data available.


This draft is based on general SAP S/4HANA knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

Check SAP Note 2630622 - it documents the MRP Live BAdI interface changes in 1809. The method signatures were completely redesigned. Your old implementation won’t work because the parameter structure changed from flat to nested tables. You’ll need to adapt your code to use the new IF_MRP_LIVE_BADI interface definition.

We hit this exact issue in our 1809 upgrade. The enhancement spot MRP_CL_MRP_LIVE was deprecated and replaced with MRP_S4_PLANNING_BADI. The interface now uses different importing/exporting parameters with changed data structures. Your custom logic needs complete reimplementation - it’s not just a signature change, the entire context data structure is different. SAP moved to a more flexible framework but broke backward compatibility. Budget time for redevelopment and thorough testing in your sandbox first.

Thanks for the SAP Note reference. I reviewed it and you’re right - major interface changes. The new structure uses nested internal tables for material data instead of the flat structure we had before. Is there any migration tool or do we need to manually recode everything? Our seasonal calculation logic is complex with about 200 lines of code.

Tested this on our S/4HANA 1809 system — migrating from MRP_CL_MRP_LIVE to MRP_S4_PLANNING_BADI via SE19 restored all custom planning BAdI logic immediately.

No automated migration tool exists for this. You need manual recoding. However, your business logic for seasonal calculations can mostly stay the same - it’s the data access layer that needs rework. The new interface provides better access to planning run context and material master data through structured tables. Focus on adapting your data extraction from the new CT_MATERIAL_PLANNING table structure, then plug in your existing calculation routines. Test thoroughly with various material types.

One gotcha we discovered: the new BAdI has different activation logic. Even after reimplementing the code, you need to activate it through customizing in SPRO under Production Planning → MRP Live → BAdI Activation. The old enhancement spot was auto-active, but the new one requires explicit configuration. Also verify your filter values are correctly set for the plant/material combinations you’re targeting.

Adding to Anna’s point about testing - make sure you test the BAdI timing. In 1809, the MRP Live BAdI execution sequence changed relative to other planning steps. Your safety stock adjustments might now execute at a different point in the planning run, potentially affecting dependent calculations. We had to adjust our logic because it was now running before ATP check instead of after.