2024 Sep 08 12:58 AM - edited 2024 Sep 08 1:00 AM
I am trying to update the sales order schedule lines once the sales order is created using API_SALES_ORDER_SRV using $batch.
i am getting 500 Internal server error. in SAP S4 HANA 2023. any one faced similar issue please help.
how to get the sales order number created in the first post call to do patch in the same changeset using Content-ID?.
Thanks.
I've tested the S/4HANA Public Cloud API_SALES_ORDER_SRV with https://github.com/gregorwolf/bookshop-demo/blob/main/tests/s4hana/API_SALES_ORDER_SRV.http#L35 and it seems to me that you don't need a Content-ID but can add the to_ScheduleLine just directly below the to_Item.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Sandra_Rossi for your response and time.
Sorry for the delayed response.
Below is the Error log .
Resource not found for the segment 'A_SalesOrderScheduleLine'.
I searched many note i found very few regarding $batch, i could not get any thread/note that explains how to get sales order number which is created by a post call of $batch and pass it to the next patch/post call in the same changeset of the batch call.
I could see content-id can be used for this but i could not get any sample how to update related entity.
also I could read some threads, content-id has some restriction in V2 ODATA. V4 has more capability. It will be nice if i can get some help here.
below is the payload for reference.
--batch
Content-Type: multipart/mixed; boundary=changeset
--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary
POST A_SalesOrder HTTP/1.1
Content-Type: application/json
Content-ID: X10
{
"SalesOrderType": "ZOR1",
"SalesOrganization": "1281",
"DistributionChannel": "20",
"OrganizationDivision": "30",
"SoldToParty": "9000012",
"PurchaseOrderByCustomer":"ABCXYZ-12345678",
"RequestedDeliveryDate":"2024-09-04T00:00:00",
"ShippingCondition":"02",
"PurchaseOrderByShipToParty":"ABC43746213-801QO00000FHZVPYA5",
"to_Item": [
{
"SalesOrderItem": "00010",
"SalesOrderItemText":"MAT TEXT",
"Material": "ABCA045R753_2",
"RequestedQuantity": "12"
}
],
"to_Partner": [
{
"Customer":"9000022",
"PartnerFunction":"SH"
}
]
}
--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary
PATCH $X10/A_SalesOrderScheduleLine HTTP/1.1
Content-Type: application/json
{
"SalesOrderItem":"10",
"ScheduleLine":"1",
"RequestedDeliveryDate": "2024-09-18T00:00:00"
}
--changeset--
--batch--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.