Symptom
When sending a PATCH request to the API API_SERVICE_ORDER_SRV, to update a service item information, e.g. the quantity, the description of the item is cleared out.
Environment
SAP S/4HANA Cloud Public Edition.
Reproducing the Issue
- Enter the request URL: https://<host>/sap/opu/odata/sap/API_SERVICE_ORDER_SRV/A_ServiceOrderItem(ServiceOrder='{ServiceOrder}',ServiceOrderItem='{ServiceOrderItem}')
- Set the method 'PATCH'.
- Enter the following content in the body of the request:
{
"Product": "TG11",
"Quantity": "1",
"ServiceOrderItemCategory": "SEW4",
"ParentServiceOrderItem": "10"
}
Cause
The product is included in the payload, so this clears out the product description field.
The system understands that a new product is being entered, so the 'old' product is being replaced by the 'new' product. Since the description is related to the 'old' product, and no description is entered for the 'new' product, the field is left blank.
Resolution
Don't include the product on the payload if it's not being changed.
No field is mandatory on a 'PATCH' request, so only insert on the payload the ones that are going to be changed.
If the product is changed, a new description must also be included.
See Also
Keywords
API_SERVICE_ORDER_SRV, ServiceOrderItemDescription, product description, item description, item text, PATCH, UPDATE, service order item , KBA , CRM-S4-SRV-SVO-2CL , S4CRM: Service Order (Public Cloud) , Problem