SAP Knowledge Base Article - Public

3778784 - Error "State of the resource (entity) was already changed (If-Match)" when post goods issue for outbound delivery via API_OUTBOUND_DELIVERY_SRV - SAP S/4HANA Cloud Public Edition

Symptom

  • While posting goods issue for outbound delivery via API_OUTBOUND_DELIVERY_SRV, error "State of the resource (entity) was already changed (If-Match)" raised in response. 
  • Error code:HTTP 412 Precondition Failed.
  • The error raised when outbound delivery is already goods issue posted.
  • Request URL being used like <host>/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;V=0002/PostGoodsIssue?DeliveryDocument='80000000'.

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Identify an outbound delivery for which Post Goods Issue (PGI) has already been successfully posted.
  2. Retrieve the delivery number and the corresponding ETag (If-Match value).
  3. Obtain a valid X-CSRF token.
  4. Call the OData action PostGoodsIssue of API_OUTBOUND_DELIVERY_SRV with the X-CSRF token and If-Match value obtained from previous steps.
  5. See error "State of the resource (entity) was already changed (If-Match)" raised in response.

Cause

Incorrect API version parameter in the OData service URL:
Using an uppercase “V” (for example, “V=0002”) leads the call to resolve to an obsolete service version (“service_version” reported as “0001”), resulting in the 412 Precondition Failed response.

Resolution

Use the lowercase version parameter in the OData service URL to target the intended service version, for example:

POST <host>/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/PostGoodsIssue?DeliveryDocument='80000000'.

See Also

Help Portal: Delivery Management API (Help Portal)

Keywords

post goods issue, pgi, api_outbound_delivery_srv, odata v2, service version, lowercase v, if-match, etag, http 412, precondition failed, http 400, bad request, inconsistent response, delivery management api, postgoodsissue. , KBA , LE-SHP-API-2CL , Interfaces for Delivery Documents (API) (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions