cancel
Showing results for 
Search instead for 
Did you mean: 

Return a collection by calling RFC with parameter

Former Member
0 Kudos

Greetings,

I have a very basic question about building OData service in SEGW.

If I have an RFC function on my back end:

  • Input: EQUNR (single field)
  • Output: table with multiple insurance entries

How can I build an OData service in such a way that it receives an input parameter and returns a collection, based on table returned in the RFC?

According to what I have found - there is no such a way to do it...

I would want to call someting like /sap/opu/odata/sap/ZEQUIPMENT_SRV/InsuranceSet('170000002836')

And receive a collection of items.

Please help!

Thanks,

Ivan

Accepted Solutions (1)

Accepted Solutions (1)

aakash_neelaperumal2
Active Participant
0 Kudos

Ivan,


The url you had used will invoke GET entity. Please use below url which will invoke GET Entityset which will return multiple rows of data.

/sap/opu/odata/sap/ZEQUIPMENT_SRV/InsuranceSet?$filter=EQUNR eq '170000002836'


Remember its eq and not =

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Ivan,

The URL which you are referring is READ operation which will take Key parameters as input and return only single record as part of response ( not the collection ),

In your case you need to implement Get_Entity_Set / QUERY operation so that you can send input as part of filter parameter and get all those multiple records as part of GW response.

Have a look at the below under QUERY operation ->

Regards,

Ashwin