0

I'm working on an SAP integration where one transaction requires multiple GETs, PATCHes and POSTs. Also there is a requirement to pass etag between the calls. I'm trying $batch but don't know how to pass etag between calls because one modification to the entity changes the etag. This is what I tried.

Content-Type: multipart/mixed;boundary=changeset_01

GET A_OutbDeliveryHeader(DeliveryDocument='0000000001') HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C1

--changeset_01
Content-Type: application/http
Content-Transfer-Encoding: binary

PATCH A_OutbDeliveryItem(DeliveryDocument='0000000001',DeliveryDocumentItem='10') HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C2
If-Match: xxxxx

{
  "ActualDeliveryQuantity": "2.000"
}


--changeset_01
Content-Type: application/http
Content-Transfer-Encoding: binary

PATCH A_OutbDeliveryHeader(DeliveryDocument='0000000001') HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C3
If-Match: xxxxx

{
  "ActualGoodsMovementDate": "2023-03-14T13:33:10",
  "ActualGoodsMovementTime": "PT13H33M10S"
}


GET A_OutbDeliveryHeader(DeliveryDocument='0000000001') HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C4


--changeset_01
Content-Type: application/http
Content-Transfer-Encoding: binary

POST PostGoodsIssue?DeliveryDocument='0000000001' HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C5
If-Match: xxxxx


--changeset_01--


--batch_01--
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
Jijo Joseph
  • 127
  • 6
  • Your tags are invalid. SAP is a company, HANA is a database software. Which framework do you use for etag generation? – Sandra Rossi Mar 24 '23 at 07:08
  • This API call happens from Azure. We're calling the API endpoints shared to us by SAP. I'm not sure how the implementation internally is. We're only supposed to call ODATA API. When there are multiple modifications happen to the same object the etag changes. So the subsequent calls should have the updated etag passed otherwise it throws pre-condition failed. – Jijo Joseph Mar 24 '23 at 07:45
  • 1
    Changing to tag S/4HANA which is the most frequently-used SAP software based on HANA database, and tag SAP Gateway which is the technology brick for OData. – Sandra Rossi Mar 25 '23 at 08:17

0 Answers0