cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Define SelectionVariant with multiple property filters with and as operator

former_member849728
Discoverer
1,560

My annotation is defined as below

 <Annotation Term="com.sap.vocabularies.UI.v1.SelectionVariant" Qualifier="Open_Orders_By_Product_Category">
<Record>
<PropertyValue Property="SelectOptions">
<Collection>
<Record>
<PropertyValue Property="PropertyName" PropertyPath="Product"></PropertyValue>
<PropertyValue Property="Ranges">
<Collection>
<Record>
<PropertyValue Property="Sign" EnumMember="com.sap.vocabularies.UI.v1.SelectionRangeSignType/I"></PropertyValue>
<PropertyValue Property="Option" EnumMember="com.sap.vocabularies.UI.v1.SelectionRangeOptionType/EQ"></PropertyValue>
<PropertyValue Property="Low" String="Fuel Injector"></PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
<Record>
<PropertyValue Property="PropertyName" PropertyPath="Product"></PropertyValue>
<PropertyValue Property="Ranges">
<Collection>
<Record>
<PropertyValue Property="Sign" EnumMember="com.sap.vocabularies.UI.v1.SelectionRangeSignType/E"></PropertyValue>
<PropertyValue Property="Option" EnumMember="com.sap.vocabularies.UI.v1.SelectionRangeOptionType/NE"></PropertyValue>
<PropertyValue Property="Low" String="Oxygen Sensor"></PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Collection>

This is sending the query as $filter=Product eq Fuel Injector or Product ne Oxygen Sensor

But i want it to be and, how can i achieve this?

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

Hi,

Did you already found a solution for this?

I'm having the same question. It looks like the UI annotations defined in Metadata-extension CDS is not working with multiple filter values if NE is used. It is working correctly with EQ:
First selection variant (ZAP02000) is working, second (Others) is not:

{

qualifier: 'ZAP02000',

text: 'GIPOD Feedback',

filter: 'Chkl_Step_Id EQ "ZAP02000" OR Chkl_Step_Id EQ "ZAP02050"' //["ZAP02000","ZAP02050"]'

},

{

qualifier: 'Others',

text: 'Others',

filter: 'Chkl_Step_Id NE "ZA000100" AND AND Chkl_Step_Id NE "ZA000200" AND Chkl_Step_Id NE "ZA000400"

AND Chkl_Step_Id NE "ZA000450" AND Chkl_Step_Id NE "ZA000550" AND Chkl_Step_Id EQ "ZA000650"

AND Chkl_Step_Id NE "ZA000700" AND Chkl_Step_Id NE "ZA000800" AND Chkl_Step_Id EQ "ZAP00250"

AND Chkl_Step_Id NE "ZAP00450" AND Chkl_Step_Id NE "ZAP00500" AND Chkl_Step_Id EQ "ZAP00600"

AND Chkl_Step_Id NE "ZAP00650" AND Chkl_Step_Id NE "ZAP00750" AND Chkl_Step_Id EQ "ZAP00800"

AND Chkl_Step_Id NE "ZAP00850" AND Chkl_Step_Id NE "ZAP00900" AND Chkl_Step_Id EQ "ZAP02000"

AND Chkl_Step_Id NE "ZAP02050"'

}

AlexNecula30
Active Contributor
0 Likes

Hello,

I don't think this is supported.

However, you shouldn't need it since using "Product eq Fuel Injector" means it will not retrieve the values equal to Oxygen Sensor.

Alex

former_member849728
Discoverer
0 Likes

actually we have a use case something like

city eq bangalore and product ne oxygen sensor and product ne fuler Injector

in this case

the query is going like city eq bangalore or product ne oxygen sensor or product ne fuler Injector

which is bringing incorrect results, so we want to pass and