Skip to Content
0
May 14, 2020 at 08:34 AM

Updating Header and Item fields at the same time - OData - Batch

632 Views

Hi Experts,

We are trying to update header and item fields of an outbound delivery at the same time using Postman.

First of all, we use the GET method to retrieve the token and etag.

https://xxxxxxxx-api.s4hana.ondemand.com/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('80001139')?$expand=to_DeliveryDocumentItem&$select=OverallGoodsMovementStatus,YY1_SD_RE_DLH,to_DeliveryDocumentItem/YY1_SD_SB_DLI

On the second place, we use the POST Method to update fields at header and item level.

https://myxxxxxx-api.s4hana.ondemand.com/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/$batch

Body:

--batch_mybatch

Content-Type: multipart/mixed; boundary=changeset_mychangeset1

--changeset_mychangeset1

Content-Type: application/http

Content-Transfer-Encoding: binary

PATCH A_OutbDeliveryHeader(DeliveryDocument='{{80001139}}') HTTP/1.1

Content-Type: application/json

Accept: application/json

If-Match: {{etag}}

{

"YY1_SD_RE_DLH": true

}

--changeset_mychangeset1

Content-Type: application/http

Content-Transfer-Encoding: binary

PATCH A_OutbDeliveryItem(DeliveryDocument='{{80001139}}',DeliveryDocumentItem='10') HTTP/1.1

Content-Type: application/json

Accept: application/json

If-Match: {{etag}}

{

"YY1_SD_SB_DLI": "TEST"

}

--changeset_mychangeset1--

--batch_mybatch--

We are getting the following error:

Do you have information regarding this error?

Thank you very much in advance for your comments,

Best regards,

Jorge.

Attachments

32093-image.png (39.1 kB)
32094-image.png (3.7 kB)
32095-image.png (44.3 kB)