Symptom
When posting goods receipts via API_MATERIAL_DOCUMENT_SRV and the 'CreatedByUser' field is passed, the posting fails with error 'Field 'CreatedByUser' cannot be set for this operation on header level' (MM_IM_ODATA_API_MDOC/001)
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Post a Goods Receipt via API_MATERIAL_DOCUMENT_SRV.
- In the header of the payload pass a value in the field 'CreatedByUser'.
- Posting fails with error 'Field CreatedByUser cannot be set for this operation on header level'
Cause
The 'CreatedByUser' field is not a supported field within the API, up to and including Cloud version CE2308.
Resolution
Until release CE2402, these are the listed header and item forbidden fields.
The following fields are not yet supported at the Header Level:
'CreatedByUser'
'CreationDate'
'CreationTime'
'MaterialDocument'
'MaterialDocumentYear'
'InventoryTransactionType'
The following fields are not yet supported at the Item Level:
'MaterialDocument'
'MaterialDocumentYear'
'MaterialDocumentItem'
'InventoryStockType'
'ControllingArea'
'FiscalYear'
'FiscalYearPeriod'
'FiscalYearVariant'
'IssuingOrReceivingStockType'
'IssgOrRcvgSpclStockInd'
'GoodsMovementIsCancelled'
'QuantityInBaseUnit'
'MaterialBaseUnit'
'CompanyCodeCurrency'
'IsAutomaticallyCreated'
'ReversedMaterialDocumentYear'
'ReversedMaterialDocument'
'ReversedMaterialDocumentItem'
'SlsPrcAmtInclVATInCoCodeCrcy'
'SpecialStockIdfgWBSElement'
'InventoryValuationType'
'AccountAssignmentCategory'
'FunctionalArea'
'HierarchyNodeLevel'
See Also
API Create Material Document : here it lists the fields which are relevant for the Create or Post.
Keywords
API_MATERIAL_DOCUMENT_SRV, CL_API_MATERIAL_DOCUME_DPC_EXT, LS_HEADER_FORBIDDEN, forbidden field, MM_IM_ODATA_API_MDOC001, MM_IM_ODATA_API_MDOC/002, Blocked Stock SE24, check_forbidden_item_fields. API_MATERIAL_DOCUMENT_SRV/resource/A_MaterialDocumentHeader' , KBA , MM-IM-GF-BAPI , BAPIs for Goods Movements , MM-IM-GF-BAPI-2CL , BAPIs for Goods Movements (Public Cloud) , Problem