cancel
Showing results for 
Search instead for 
Did you mean: 

OData Service - Using a filter on a Dependent Entity Set

Former Member
0 Kudos

Hello All,

I have an issue facing me which I am trying to resolve with respect to OData.

I tried searching the existing forums, however I have read mixed replies.

So I have 2 entities - SalesOrder and SalesPos.

These 2 entities are connected with a Navigation SalesNav and cardinality 1:M

I would like to be able to get all SalesOrder header info and SalesPos Items info for all Sales Orders where

- The Customer number is 10 or 20

- The Item number is 30 or 40

And I am using here the expand functionality.

So, initially since I am a novice in OData, I felt the URI should look like....

http://blahblahblah.blah.de:7000/sap/opu/odata/SALESINFO?$filter=Order eq '10' or '20'&$expand=SalesNav&$filter=Item eq '30' or '40'

However, I checked up the OData Conventions, and then I learnt the Properties of the dependent entity are to be addressed in a different way. My URI should actually be

http://blahblahblah.blah.de:7000/sap/opu/odata/SALESINFO?$filter=Order eq '10' or '20'&$expand=SalesNav&$filter=SalesNav/Item eq '30' or '40'.

I need to use the Qualified field name.


However, when I tried with this URI .. I get an error message that "Left hand side of the expression has a false cardinality".

I tried debugging .and noticed while evaluating the Filter expression, if we use a Qualified Filter, the system expects the Cardinality to be 1:1.

I found that a little weird.. but nevertheless I trid I tried it out. I changed the cardinality to 1:1 and surprisingly it worked.

So I was able to use filters on both Entity Sets.

So now my Question:

a) Does the current version of SAP Netweaver Gateway simply not support the $filter expression on the second Entity Set in a Navigation ? If the answer is no... then I would wonder why it supports it with the Cardinality 1:1.

b) Is there some workaround.. some way we can transfer Search conditions for the second Entity Set ?

Thanks for your inputs.

Regards

Shadab.

Accepted Solutions (0)

Answers (2)

Answers (2)

ramnath_vivek
Explorer
0 Kudos

Hi All,

Was there any solution for this issue, I'm struck by the same, it would be nice if I get any help.

Regards,

Ramnath

0 Kudos

Hi Shadab,

Did u get any clue on how to use filter in both parent and dependent entity..

Am also having the same issue.. your input will be highly useful.

Thanks

Anand

0 Kudos

Hello Anand,

Did you able to solve this issue?