I’ll address all three aspects of your material recognition problem systematically.
Material Existence vs Recognition Issue:
The core problem is that materials physically exist in S/4HANA tables (you can see them) but the IDoc processor cannot recognize them due to context mismatch. S/4HANA’s material master uses a different internal key structure than ECC. While ECC used MATNR as the primary key, S/4HANA introduced material GUID (MATERIAL_GUID) as the internal identifier. Your IDoc is sending the external material number, but S/4HANA’s validation logic is failing to resolve it to the internal GUID because the material master data wasn’t properly activated after initial creation.
IDoc MATMAS Segment Error Root Cause:
The MATMAS segment triggers enhanced validation in S/4HANA that didn’t exist in ECC. Specifically:
- Material master completeness checks are stricter
- Cross-plant material validation requires all plants to be defined
- Material-to-product hierarchy mapping must be complete
- UoM (Unit of Measure) conversions must be defined for all relevant UoMs
Your error occurs because the IDoc processor runs these validations before attempting the material lookup. If any validation fails, you get the “Material not found” error even though the material record exists. Check table MARA field LVORM (deletion flag) and MSTAE (cross-plant status) - materials marked for deletion or with restrictive status won’t be recognized by IDoc processing.
Legacy Data Mapping Resolution:
Your legacy mapping issues stem from three specific changes:
- Material Number Format: Run this check in both systems:
SELECT MATNR, LENGTH(MATNR) as LEN
FROM MARA
WHERE MATNR = '100234567'
S/4HANA requires consistent 18-character format with proper zero-padding.
- Field Mapping Changes: Several MATMAS fields were deprecated or renamed. Critical ones:
- MEINS (base UoM) validation is now mandatory
- MATKL (material group) must exist in T023
- MTART (material type) mapping changed for configurable materials
- Activation Status: Materials migrated to S/4HANA must be explicitly activated. Run program RSMMAT00 to activate materials in batch mode before IDoc processing.
Complete Solution Approach:
Before re-running IDoc migration:
-- Verify material activation status
SELECT MATNR, ERSDA, LAEDA, LVORM, MSTAE
FROM MARA
WHERE MATNR IN (SELECT MATERIAL FROM your_idoc_error_log)
Then execute material activation:
- Transaction MM50 or program RSMMAT00
- Select all materials from your migration scope
- Run activation with test mode first
For IDoc reprocessing:
- Use BD87 to reprocess failed IDocs after activation
- Modify IDoc partner profile (WE20) to include material GUID resolution
- Add custom function module to pre-validate materials before IDoc processing
Long-term Fix:
Switch from direct IDoc migration to LTMC approach. LTMC handles:
- Automatic material number format conversion
- Field mapping transformation using migration objects
- Validation and activation in a single step
- Better error reporting with field-level details
Create LTMC migration object for MATERIAL_MASTER, map your source fields, and use the built-in validation rules. This eliminates the IDoc recognition issues entirely because LTMC uses the same APIs as S/4HANA’s native material creation transactions.
SAP Notes to review: 2267140 (material master migration), 2384398 (IDoc processing in S/4HANA), 2514474 (material activation issues).