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
- Identify an outbound delivery for which Post Goods Issue (PGI) has already been successfully posted.
- Retrieve the delivery number and the corresponding ETag (If-Match value).
- Obtain a valid X-CSRF token.
- Call the OData action PostGoodsIssue of API_OUTBOUND_DELIVERY_SRV with the X-CSRF token and If-Match value obtained from previous steps.
- 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
SAP Knowledge Base Article - Public