Skip to Content
0
May 11, 2022 at 01:36 PM

SAP UI5 table search multiple values with OR condition

631 Views Last edit May 12, 2022 at 12:49 AM 2 rev

Hi Experts,

Currently I have an UI table and if I try filtering the table values from my search input using the below code it works fine with AND condition.

Please let me know how to make it work with OR condition .

Thanks ,

Vinodkumar.

var Supplier = this.getView().byId('IDINSupplier').getSelectedItems();
			var Supplierlen = Supplier.length;
			var obj2 = '';
			for (var i = 0; i < Supplierlen; i++) {
				var value = Supplier[i].mProperties.key;
				var oFilter = new sap.ui.model.Filter("SupplierName", sap.ui.model.FilterOperator.EQ, value);
				aFilters.push(oFilter);
			};
			var Parts = this.getView().byId('IDINPart').getSelectedItems();
			var Partslen = Parts.length;
			var obj2 = '';
			for (var i = 0; i < Partslen; i++) {
				var value = Parts[i].mProperties.key;
				var oFilter = new sap.ui.model.Filter("Parts7", sap.ui.model.FilterOperator.EQ, value);
				aFilters.push(oFilter);
			};
           oTable.filter(aFilters, "Application");

Attachments

or-condition.png (3.6 kB)