Symptom
Error message MM_IM_ODATA_API_MDOC027 "Provide Line-IDs when using Business Context MaterialDocumentItem" happens when using API_MATERIAL_DOCUMENT_SRV to create material document with custom fields.
Environment
SAP S/4HANA Cloud
Cause
When using custom fields, it is necessary to provide a unique value in the MaterialDocumentLine field for each material document item. Otherwise the error "Provide Line-IDs when using Business Context MaterialDocumentItem" will occur.
Resolution
Provide a unique value in property "MaterialDocumentLine" for each Material Document Item. The detailed information and sample payload can be found in the online documentation for this API.
Keywords
MM_IM_ODATA_API_MDOC027, API_MATERIAL_DOCUMENT_SRV, custom fields, materialdocumentitem, MaterialDocumentLine, Line-IDs , KBA , MM-IM-GF-2CL , Basic Functions (Public Cloud) , Problem