cancel
Showing results for 
Search instead for 
Did you mean: 

Purchase requisition OData V4 API | CPI

induthiru
Participant
0 Kudos

Hi,

I am trying to call the purchase requisition OData V4 API in my CPI iflow to mark PR lines as 'Deleted' in the S/4Hana cloud system and appreciate any assistance from the experts.

1. I don't see a PATCH operation in the V4 adapter (PATCH does exist in OData V2 API of PR). Does PUT work the same way as PATCH in V4? Because, when I tried I got an error in my OData monitor (Unknown HTTP error occurred in the context of Data services)

2. I am rather interested in getting the batch request done, as there could be multiple items in the PR and I want to update the deletion flag on all of them. I am having some trouble in getting the body right for the batch request. My V4 adapter config looks as below:

I have been playing around with the headers, but I would like to know how to get the headers right. The etag was fetched in a previous step of the flow by reading the PR item.

With any combination, the error in my OData monitor is: /IWCOR/CX_OD_UNSUPP_MEDIA_TYPE : The server isrefusing to process the request because theentity has an unsupported format.

View Entire Topic
daviddasilva
Active Contributor
0 Kudos

Hello,

PUT here works like this:

1) If the entry does NOT exist, then it will behave like a POST request

2) If the entry DOES exist, then it will update the fields sent in the payload

So it is similar to PATCH but not the same.

Question 2 is around batch requests. Have you tested this through Postman or some other way? The error seems to suggest that a wrong format is being used. Check what you content-type is and confirm it is a format that is supported by the API (I believe it should be similar to this: multipart/mixed;boundary=changeset).

I hope this helps and good luck!

Kind regards,

David

induthiru
Participant
0 Kudos

Hi daviddasilva : thanks for your reply on PUT/PATCH. Is this also documented somewhere?

The V4 documentation says that, to perform an UPDATE operation, an eTag needs to be used. After following that as well, I get this error.

However, I am able to update the same PR with the V2 API. So, the V4 error is still not clear to me.