cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

$batch process to delete single or multiple Vendor from BusinessPartner number

Rohan_Chauhan
Explorer
0 Kudos
985

Hey.

Here I try to delete a Vendor from BusinessPartner number - '101127'. I am using the $batch process to delete the Vendor but don't know it throw error as - Batch request payload is invalid.

Please help me to resolve this. here I attach a screenshot for the reference.

Rohan_Chauhan_0-1731935511921.png

Please tell me the step by step process that what changes I have to make to correct this.
Thanks in advance.


OData  SAP S/4HANA Cloud ABAP Environment  

 

Accepted Solutions (0)

Answers (1)

Answers (1)

catano
Active Participant
0 Kudos

Hi @Rohan_Chauhan ,

Could you try Content-Type application/http for the changeset and application/json for the DELETE request:

--batch
Content-Type: multipart/mixed; boundary=changeset_1

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

DELETE A_BusinessPartner(BusinessPartner='101127') HTTP/1.1
Content-Type: application/json

--changeset_1--
--batch--

and for the request itself use batch as the boundary:

Content-Type: multipart/mixed; boundary=batch
Accept: application/json
X-CSRF-Token: <your_token>

You can read more on formatting batch request here.

Best,
Peter 

Rohan_Chauhan
Explorer
0 Kudos

Hi Peter.

I tried this method but this will throw other error as - Response has no data.
Status - 202

 

Thanks 

Rohan Chauhan

catano
Active Participant
0 Kudos

Hi @Rohan_Chauhan ,

Could you please check if the records are deleted - despite the response message?
HTTP 202 is a successful response, you can read about HTTP responses here.

Regards,
Peter