Hi Experts!
I call an OData service but my filter is not working. I´ll filter to a certain contractID which is "00010000010000248". My filter will be ignored I get in the JSON response all contracts. When I change oDataModel.read("/LoanContractSet", null, filter, true); to oDataModel.read("/LoanContractSet('00010000010000248')", null, filter, true); it´s working, but I can´t do it like this because the user will enter the loan contract id during start of the app. What can I do?
//Odata URL
var sUrl = "/sap/opu/odata/BAO/LM_ENTIRE_SRV/";
// Create and set domain model to the component
var filter = new sap.ui.model.Filter("LoanContractSet", sap.ui.model.FilterOperator.EQ, "00010000010000248");
var oDataModel = new sap.ui.model.odata.v2.ODataModel(sUrl, {
json: true,
loadMetadataAsync: true
});
oDataModel.read("/LoanContractSet", null, filter, true);
this.getView().setModel(oDataModel);
Thanks for your help!
Matthias