cancel
Showing results for 
Search instead for 
Did you mean: 

Calling an Odata service inside an existing ODATA Service

former_member192895
Participant
0 Kudos

Hi Experts,

I have a requirement where I need to call one OData service as an input to other OData service in a single API call from third party application.

I tried to include existing Odata service into other & setup an Association between them using common property but the o/p is not what I am expecting.

Challenge - Second OData service is built up on Dynamic Entity Set creation concept.

https://blogs.sap.com/2018/02/11/create-dynamic-entity-model-in-sap-gateway/

I have implemented Expanded entity set method for this. Any help would be appreciated.

Thanks

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Pooja,

I would need some clarifications about your scenario

  1. Since you wrote "I tried to include existing Odata service into other & setup an Association between them using common property" I assume you want to call the second OData service within the same system?
  2. What NetWeaver release is your system based on from which you want to call the dynamic OData service? 740, 750, 751, S/4 1709, S/4 1809 or S/4 1909?

Accepted Solutions (0)

Answers (3)

Answers (3)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Hi Pooja,

background of my comment was, if you would be able to apply the coding that I posted here

https://blogs.sap.com/2020/04/28/how-to-use-the-odata-client-proxy-in-sap-s-4-hana-1909/

The code uses a custom developed V4 MPC class so my assumption is that it should also work if you would reuse the structure that has been used in your dynamic OData service.

So you would have two options.

Develop two OData V4 services as suggested by akos.grabecz or using the OData Client proxy in a V2 service implementation.

Best regards,

Andre

former_member192895
Participant
0 Kudos

Thanks Andre.

Let me try the above options shared.

grabz
Employee
Employee

Hi Pooja,

This is only possible with V4 services and both of your services have to be in the same service group. You can check the relevant Gateway product doc on Help Portal here: Cross-Service References

Thanks and regards,
Ákos

former_member192895
Participant
0 Kudos

Hi Andre,

Basically we are designing it for on-prem releases starting 740 and onwards.

Yes, Both the services are on the same system & want to be called one after the other.

Our requirement is to do a POST operation which will in return generate a unique key that needs to be passed as an input in GET call, a different OData service, in the same system.

Challenging part - we need to read that unique key for creating a dynamic entity structure based on that value.

As we can not read any input parameter in MPC_EXT class of an OData service so we are stuck :(.

rajeevgoswami1
Participant
0 Kudos

As a workaround you can pass input parameter to MPC as "custom http header". check this blog:link

-Rajeev Goswami