cancel
Showing results for 
Search instead for 
Did you mean: 

CAP UI5 $filter on expanded properties / navigations (oData V2)

Igorios
Explorer

Hello dear community,

we are developing a CAP application with a Freestyle UI5 on top. It is an extensions of SAP SuccessFactors.

Currently we are facing a wall because oData V2 can not filter $expand. Unfortunately we have an oData V2 API...

For this reason the filter in the SmartTable does not work for certain fields.

It would have to apply to the $expand of the $expand entity so to speak. i.e. no filter on the root level but on the third level.

Request from the Browser is working - but when we root it to the CAP service the response is ok. After binding it to UI5 Smart Table - the data is "kind of destoryed" and not useable.

example: JobApplication?$expand=cust2ndScreen&$filter=cust2ndScreen/id eq '123456'

We could make a workaround: using lists instead of smart table cell but the root problem is not solved then. The cell contains a list which has a path to the navigation property. The list contains the binding for the navigation property collection.

Does anyone have experience with how this can be implemented?

An important key point for the SuccessFactors extension developers: Picklists

Many thanks and best regards

Igor

Igorios
Explorer
0 Kudos

This is how the navigation looks like. The problem is really with one to many association. The business case is filtering on "label" of the PicklistLabel with referes to the "PicklistOption". PicklistOption has an identifier "optionId" which is the same on the PicklistLabel-level.

Thank you!

Igorios
Explorer
0 Kudos

Do you think the way to go is to include Cloud SDK into our project?

https://stackoverflow.com/questions/60271701/sap-cloud-sdk-for-javascript-filter-on-expanded-entitie...

--> seems like the author uses the snipped inside the java class event handler ?

https://developers.sap.com/tutorials/cloudsdk-integrate-cap.html

View Entire Topic
sachinkalpetta
Explorer
0 Kudos

Hi Igor,

I am not sure why it doesn't work with smart table if the same request works in the browser. I believe it should.

One alternate approach we generally take in some complex scenarios with many tables and dynamic or predefined filter is to create a view with required joins in one flat structure. Then expose the view as a service and bind the smarttable with this view. With CAP this is quick and simple.

Thanks,

Sachin Srambickal

GergoPerlaki
Explorer
0 Kudos

Hello Sachin,

thank you for your answer. I'm also involved in this topic. We are not using any HANA DB tables, views currently. We are trying to consume a remote, external service in CAP, and having projections on the remote entities.

Thanks,

Gergő