cancel
Showing results for 
Search instead for 
Did you mean: 

Consume external OData as Batch Request

petergilberg
Participant
0 Kudos

Dear ABAPers,

is there any way to bundle outgoing OData calls in a batch request (e.g. calling a non-SAP OData API from an ABAP report)? I could do this using the HTTP Client class and building up a batch body as string and send it via POST request, but this doesn't feel very nice 🙂

I did some research and couldn't find anything pointing that way (also looking at client proxies).

Many thanks in advance for some hints or confirmation, that there's no build-in functionality!

P.S.: Not talking about implementing a gateway OData with change sets.

Tomas_Buryanek
Active Contributor
0 Kudos
What do you mean by "batch request" ? And how would you call SAP OData API? I am trying to understand what you are trying to do (or where is the problem) 🙂

Accepted Solutions (1)

Accepted Solutions (1)

Tomas_Buryanek
Active Contributor

Thanks for clarification about "batch". I have checked this resource explaining OData Batch processing. Is it what you want?

If yes, then it seems it should be doable with ABAP - HTTP requests, using cl_http_client. But I did not tried it myself.
Only tricky part seems to be working with Multipart content type in request + response. But ABAP HTTP request has method "ADD_MULTIPART". For HTTP Multipart response I see "NUM_MULTIPARTS" (Returns the number of multi-part segments of this entity) + "GET_MULTIPART" method (Returns the specified multipart segment of this entity).

petergilberg
Participant
Yes, that's what I'm trying to achieve. Before doing these code-pull ups 🙂 I wanted to make sure, there isn't a nicer/easier way. Thanks for your feedback Tomas!

Answers (1)

Answers (1)

petergilberg
Participant

Hi @Tomas_Buryanek - thanks for your quick response.

I want to put together several OData operations into one HTTP request. That's why I thought of the OData batch, as it's only one POST request containing multiple Odata requests. As written, it would work to put this together "manually" and parse the result, but maybe there's a much nice way in the ABAP framework.