Let me provide a comprehensive solution addressing all three focus areas:
Material Master Attribute Alignment:
First, ensure your material master lifecycle states are properly synchronized across all systems. Execute transaction MM03 and verify that fields MSTAE (cross-plant material status) and MMSTA (plant-specific status) are consistent. The BOM sync reads from both, and mismatches cause failures. Implement a pre-sync validation check:
SELECT mara~matnr mara~lvorm marc~mmsta
INTO TABLE lt_validation
FROM mara INNER JOIN marc
WHERE mara~matnr IN s_matnr
AND (mara~lvorm <> '' OR marc~mmsta IN ('98','99')).
This identifies materials with deletion flags or obsolete statuses before sync runs.
BOM Synchronization Logic:
The core issue is the timing window between material master updates and BOM sync execution. Modify your sync job configuration in transaction CMOD (Project: SAPLCSDI or similar) to implement these changes:
- Add a 5-minute buffer after material master commits using function module ‘ENQUEUE_WAIT’
- Implement lifecycle state caching to avoid reading inconsistent intermediate states
- Configure the sync to process BOMs in dependency order (leaf components first, then parent assemblies)
In your BOM sync configuration (transaction CS20), set these parameters:
- Check indicator: ‘Lifecycle validation’ = Warning only (not Error)
- Processing mode: ‘Sequential with dependency resolution’
- Retry logic: 3 attempts with 2-minute intervals
Lifecycle Management Process Impact:
To prevent future issues, implement an event-driven architecture:
- Create a change document object for material master lifecycle changes (transaction SCDO)
- Implement BAdI ‘BADI_MATERIAL_CHECK’ to trigger sync events only after successful commits
- Use workflow event linkage (transaction SWETYPV) to connect material master changes to BOM sync jobs
The workflow should follow this sequence:
- Change master approval (status → Released)
- Material master update with commit work
- Wait for database commit confirmation (check table CDHDR for change document creation)
- Trigger BOM sync via event ‘MATERIAL_CHANGED’
- Monitor via custom Z-table with fields: MATNR, CHANGE_TIMESTAMP, SYNC_TIMESTAMP, STATUS
Critical Configuration Steps:
- Transaction SPRO → Logistics General → Material Master → Basic Settings → Material Statuses → Define lifecycle transition rules (allow Released→Obsolete transitions with warning)
- Transaction SE37 → Function module ‘CSAP_MAT_BOM_MAINTAIN’ → Add custom wrapper to include lifecycle validation
- Create monitoring report using transaction SM36 to schedule hourly validation checks
Validation Query:
SELECT b.matnr, b.stlnr, m.mstae, c.timestamp
FROM mast b
JOIN mara m ON b.matnr = m.matnr
JOIN cdhdr c ON m.matnr = c.objectid
WHERE c.change_ind = 'U'
AND c.udate >= sy-datum - 1
ORDER BY c.udate DESC;
This solution addresses the material master alignment, fixes the synchronization logic timing issues, and minimizes lifecycle management process disruptions. The event-driven approach eliminates the 3-5 day delays you’re experiencing. Test thoroughly in your development environment first, especially the lifecycle transition rules, as they impact compliance processes.
This draft is based on general SAP PLM knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.