Symptom
Applying POST, PATCH, or PUT operations on API payload of Bill of Material are resulting with the following error messages:
-
<Property> is a read-only or restricted field.
-
<Property> is a mandatory field.
Note: <Property> can be any property for BOM Header or Item.
Environment
SAP S/4HANA Cloud Public Edition 2508
Cause
Recent updates on the Bill of Material API (API_BILL_OF_MATERIAL_SRV_0002) with regards to applying restrictions in the following scenarios:
-
Updating a read-only or restricted field.
-
Mandatory fields are missing.
-
Mandatory fields are empty.
Resolution
-
For read-only restrictions
-
Ensure that POST/PATCH/PUT operations do not include any modification for read-only fields.
For example, the following payload is no longer possible or supported as ALE indicator is always read-only for BOM Items.
{
"IsALE" : true
}
If send the above payload, the API will display the below error message:
ISALE is a read-only or restricted field.
-
Modify the payload to avoid such restrictions.
For example, modify the “true” to “false” from the above (from step 1) payload, as follow:
{
"IsALE" : false,
}
-
For mandatory restrictions
-
Ensure that PATCH/PUT operations do not include any empty field for mandatory properties.
For example, the following payload is not possible/suppported, as ISPRODUCTIONRELEVANT is mandatory for production BOMs. Therefore, this flag will not be cleared.
{
"BillOfMaterial" : "00056563",
"BillOfMaterialCategory" : "M",
"BillOfMaterialVariant" : "1",
"BillOfMaterialVersion" : "",
"BillOfMaterialItemNodeNumber" : "5",
"HeaderChangeDocument" : "",
"Material" : "AA_BDL_API_TEST01",
"Plant" : "",
"IsProductionRelevant”: false
}
If send the above payload, the API will display the below error message:
ISPRODUCTIONRELEVANT is a mandatory field.
-
Ensure that POST operation must include mandatory properties with values.
For example, the following payload is not possible/supported, as ISPRODUCTIONRELEVANT is mandatory for Production BOMs and it's not provided or is empty.
Mandatory property is empty:
{
"BillOfMaterial" : "00051314",
"BillOfMaterialCategory" : "M",
"BillOfMaterialVariant" : "1",
"BillOfMaterialVersion" : "",
"HeaderChangeDocument" : "",
"Material" : "AA_BDL_API_TEST01",
"Plant" : "0001",
"BillOfMaterialComponent" : "AA_BDL_API_COMP01",
"BillOfMaterialItemCategory" : "L",
"BillOfMaterialItemNumber" : "0100",
"BillOfMaterialItemUnit" : "EA",
"BillOfMaterialItemQuantity" : "1",
"IsProductionRelevant" : false,
…
}
OR
Mandatory property is missing:
{
"BillOfMaterial" : "00051314",
"BillOfMaterialCategory" : "M",
"BillOfMaterialVariant" : "1",
"BillOfMaterialVersion" : "",
"HeaderChangeDocument" : "",
"Material" : "AA_BDL_API_TEST01",
"Plant" : "0001",
"BillOfMaterialComponent" : "AA_BDL_API_COMP01",
"BillOfMaterialItemCategory" : "L",
"BillOfMaterialItemNumber" : "0100",
"BillOfMaterialItemUnit" : "EA",
"BillOfMaterialItemQuantity" : "1",
…
}
-
Modify the payload to avoid such restrictions.
For example, the above payloads (from step 2) should be modified, as follow:
Mandatory property is empty:
{
"BillOfMaterial" : "00051314",
"BillOfMaterialCategory" : "M",
"BillOfMaterialVariant" : "1",
"BillOfMaterialVersion" : "",
"HeaderChangeDocument" : "",
"Material" : "AA_BDL_API_TEST01",
"Plant" : "0001",
"BillOfMaterialComponent" : "AA_BDL_API_COMP01",
"BillOfMaterialItemCategory" : "L",
"BillOfMaterialItemNumber" : "0100",
"BillOfMaterialItemUnit" : "EA",
"BillOfMaterialItemQuantity" : "1",
"IsProductionRelevant" : true
}
Mandatory property is missing:
{
"BillOfMaterial" : "00051314",
"BillOfMaterialCategory" : "M",
"BillOfMaterialVariant" : "1",
"BillOfMaterialVersion" : "",
"HeaderChangeDocument" : "",
"Material" : "AA_BDL_API_TEST01",
"Plant" : "0001",
"BillOfMaterialComponent" : "AA_BDL_API_COMP01",
"BillOfMaterialItemCategory" : "L",
"BillOfMaterialItemNumber" : "0100",
"BillOfMaterialItemUnit" : "EA",
"BillOfMaterialItemQuantity" : "1",
"IsProductionRelevant" : true
}
Note: Contact SAP to disable these restrictions.
See Also
Keywords
IsProductionRelevant, Mandatory fields are missing, is a read-only or restricted field, is a mandatory field, API_BILL_OF_MATERIAL_SRV_0002, BOM, POST/PATCH/PUT , KBA , LO-MD-BOM-2CL , Bills of Material (Public Cloud) , Problem
SAP Knowledge Base Article - Public