cancel
Showing results for 
Search instead for 
Did you mean: 

When using SEGW / Mapping GetEntitySet to function call , is $filter implemented automatically?

Former Member
0 Kudos

Hey everyone

Im trying to understand if im missing out on something or just misunderstanding things.

i've created an entity, and a function.

calling this entity using standard key filter works (i.e /FlightSet(0001), but when using /FlightSet?$filter=carried eq '0001' I simply get all the entities in the collection, no error or anything.

I've marked the key as "filterable" in the collection.

i've also taken a look at the class generated by the transaction, it doesnt seem as if the method contains code that is supposed to filter the results, it simply reads the keys and announces errors.

i have no problem implementing this manually, but i dont know if its a correct behavior.

thanks.

Eli

Accepted Solutions (1)

Accepted Solutions (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Yes it is correct behavior. you need to put the code to implement $filter operation.

/FlightSet(0001) - This is not filter. it calls the get_entity method with 0001 as key passed.


whereas /FlightSet?$filter=carried eq '0001' will call get_entityset method where you need to implement the logic for filter value passed.


You can refer my blog for more information.


Regards,

Chandra

dirk_roeckmann
Participant
0 Kudos

Hi,

yes the query method should be mapped for the $filter to work correctly. In addition every column of the entityset which will be used for filtering should be mapped to a range table in the data source (function module). The mapping recognizes ranges and displays them with a specialized icon ([])

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Eli,

If you wish to use $filter, I would not recommend mapping to a function module as you have to write the code anyway. If you are going to need to write code, do a code based implementation in the first place, it's quicker and you'll have more control over the service.

Regards

Ron.

Former Member
0 Kudos

Hi

i want to fetch the data from below url but its give me.In domain name there is a Slash('\') how to resolve this kindly help.


Exception during error handling occured!

http://192.168.59.227:8080/gateway/odata/sap/EmployeeDataList;v=1/Employee?$filter=DomainAndUsername...\maheshware\reddy'

Below link is working fine.

http://192.168.59.227:8080/gateway/odata/sap/EmployeeDataList;v=1/Employee?$filter=FullName+eq+'Mahe... Reddy'


Regards

   Ali