cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to use $filter with complex $expand Entities

Former Member
0 Kudos

Hi there

I have the following $expand query with filter option:

/sap/opu/odata/sap/ZMYSERVICE_SRV/entitySet('ABC')?$format=json&$expand=parent/child1/childOfChild&$filter=parent/child1/childOfChild/propertyOfchildOfChild eq 4

I tried to use the filter with parent/propertyOfParent, which was working. Is it possible to use $filter with nested ($expand) structures like my example?

thanks for your reply

Sandro

Accepted Solutions (0)

Answers (2)

Answers (2)

SB9
Active Participant
0 Kudos

You can only filter on the properties of parent - In your case entity('ABC'). You cannot filter on 'child1' or 'child of child1'.

I am not sure if this is limitation or the way oDATA  is supposed to work. But I tried it before and it did not work for me.

Former Member
0 Kudos

Filtering on $filter=child/Element should work.

SB9
Active Participant
0 Kudos

what is the version of your netweaver gateway and odata ?

Former Member
0 Kudos

I use Odata Version 2.0 and Gateway SP09

AshwinDutt
Active Contributor
0 Kudos

Hello Sandro,

You are using Keys and also filters to pass inputs along with expand which i don't think its supported.

Either use Keys with expand or filters with expand.

Regards,

Ashwin

Former Member
0 Kudos

Hi

I would filter on sub entities of an entity with a specific key.  and it is possible with one child entity.