SAP Knowledge Base Article - Public

3472024 - Response code of API Sales Order (A2X, OData V2) is success but an error is expected - S/4HANA Cloud

Symptom

Business requirement is to update a field via the PATCH method using API Sales Order (A2X, OData V2)  but due to system restrictions it is not possible to do so. Response code is success (204) but an error is expected.

Environment

SAP S/4HANA Cloud

Cause

Standard system behaviour.

Resolution

Every field is treated similarly. When the field is not changeable, an error is raised, and the next field will be processed. Consequently, when a PATCH request is successful, it does not necessarily depend on whether any field was changed or not. Every single field is treated individually and needs to be checked in the HTTP response's header sap-message structure. (Or by GET request after the PATCH). This is the model and behavior of this API in PATCH requests.

Please refer to Help Portal Documentation under Messages about more information regarding Help - Sales Order (A2X, OData V2).

See Also

Help - Sales Order (A2X, OData V2)

Keywords

api, odata, v2, a2x, sales order, update, patch, error, field, response, code, request, payload, 204, success, method, restriction, http, sap-message, header , KBA , SD-SLS-API-2CL , API (Public Cloud) , How To

Product

SAP S/4HANA Cloud Public Edition all versions ; SAP S/4HANA Cloud all versions