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

oData read with Huge Filters in sap ui5

prasad
Participant
0 Kudos
1,749

Hi Team,

Need some inputs on handling a scenario in which a certain oData calls returns around 3k records and need to process these 3k records to form a filter to pass to another oData .

right now when this filter array is passed to another oData call the call was failing since filter array was very huge

below is the code snippet to form filters from first odata call

var oFilter = []; 
var oFilterORTotal = [];
if (oData1.results.length > 0) {
oData1.results.forEach(function (oItem) {
oFilter.push(
new sap.ui.model.Filter({
filters: [
new sap.ui.model.Filter("field1", sap.ui.model.FilterOperator.EQ, oItem.field1),
new sap.ui.model.Filter("field2", sap.ui.model.FilterOperator.EQ, oItem.field2),
new sap.ui.model.Filter("field3", sap.ui.model.FilterOperator.EQ, oItem.field3),
new sap.ui.model.Filter("field4", sap.ui.model.FilterOperator.NE, "X")
],
and: true
})
);
});
}
var oTotalFiltersData = new sap.ui.model.Filter({filters: oFilter});
oFilterORTotal.push(oTotalFiltersData);
	oData2.read(url, {
			filters: oFilterORTotal,
			urlParameters: {},
			success: function (oData) {
			},
			error: function (error) {
			}
		});

in the above code snippet the oFilterORTotal array length is above 3k and oData call is failing.

is there any way to handle this scenario in a more effective way to pass the second oData call.

Regards

Prasad

Accepted Solutions (0)

Answers (0)