cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member849728
Discoverer
975

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?

View Entire Topic
0 Kudos

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"'

}