cancel
Showing results for 
Search instead for 
Did you mean: 

API_SALES_ORDER retuning empty values for sales order items during POST operation

abdul_hakim
Active Contributor

Hello Experts

We are using SAP standard API https://api.sap.com/api/OP_API_SALES_ORDER_SRV_0001/path/post_A_SalesOrder

for Sales order creation. While making POST call to create Sales order along with Sales order items the Sales order is getting created successfully along with items. However in the response Payload the items section is returned as blank and we expect the line items details that got created. Please let me know how to get the line items data as well in the response Payload during POST call.

Current response received for items:

    "to_Item" : {
      "results" : [

 

      ]

}

Regards,

Abdul Hakim

Ryan-Crosby
Active Contributor
0 Kudos
That is normal for a POST operation. If you want to retrieve the results after the POST, then you would follow it with a GET operation.
Ryan-Crosby
Active Contributor
0 Kudos
$batch can be used to initiate a GET request after the POST.
abdul_hakim
Active Contributor
0 Kudos
Hi All, We have received response from SAP Support. This is the current API Design and there is no bug in the Standard API. Regards, Abdul Hakim

Accepted Solutions (1)

Accepted Solutions (1)

abdul_hakim
Active Contributor
0 Kudos

Hi All, We have received response from SAP Support. This is the current API Design and there is no bug in the Standard API. Regards, Abdul Hakim

Answers (2)

Answers (2)

abdul_hakim
Active Contributor
0 Kudos

Hi

Thanks for the response. Our sender system is expecting the item data as well as part of the response payload after successful POST operation and they do not want to perform another GET call. Please let me know if this is possible in this particular API.

 

Regards,

Abdul Hakim

Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Abdul,

 

have you checked afterward on the database if the sales order was created with the items?

If yes then it might be that the creation happens asynchronously. Otherwise, which I am guessing right now a bit more, you did not create the items on the salesorder. You have not done a deep insert and therefore the items are empty.

 

Best,

Edrilan Berisha

SAP S/4HANA Cloud Financials Development

abdul_hakim
Active Contributor
0 Kudos
Hello Edrilan Berisha,
abdul_hakim
Active Contributor
Hello Edrilan Berisha, Thanks for the response. I have passed both header and item as part of payload and the API has created both header and item sucessfully. I have verified the same in database tables, VBAK, VBAP. The problem that we are seeing is in the response Payload the items is blank. Our sender system is expecting the item data as well in the response payload. Please let me know if it is possible the get the same in the response payload. I have also reported this issue to SAP. Any insight would be very much help for us. We do not want to go in the direction of custom API for this requirement. Regards, Abdul Hakim