0
我有一個OData的模型,我需要進行批量讀取請求 的模型ctreated如下UI5 OData服務與一批GET與過濾器
this.oModel = new sap.ui.model.odata.ODataModel(sURI,{
json : true,
user : "<username>",
password : "<password>",
useBatch : true
});
過濾器和批次要求如下創建
var allfilters = [new sap.ui.model.Filter({
path:'filter1',
operator : sap.ui.model.FilterOperator.EQ,
value1 : this.filter1value
}),
new sap.ui.model.Filter({
path:'DateField',
operator : sap.ui.model.FilterOperator.EQ,
value1 : 'SCHED'
}),
new sap.ui.model.Filter({
path:'StartDate',
operator : sap.ui.model.FilterOperator.EQ,
value1 : oDateFormat.format(this.startDate.toDate())
}),
new sap.ui.model.Filter({
path:'EndDate',
operator : sap.ui.model.FilterOperator.EQ,
value1 : oDateFormat.format(this.endDate.toDate())
})];
var batchrequest = this.oModel.createBatchOperation('/ReadEntitySet','GET',{
filters : allfilters
});
this.oModel.addBatchReadOperations([batchrequest]);
this.oModel.submitBatch(this._gotData.bind(this),function(err){
console.log(err);
});
當我們調試ABAP代碼時,我們沒有得到過濾器。