Skip to Content
Nov 19, 2016 at 06:12 PM

Not able to Call Odata Service


Hello Experts,

I am calling Odata service for my UI5 application. I am using below mentioned code for creating the model.

<code>var oModel = new sap.ui.model.json.JSONModel("https://<>/sap/opu/odata/SIE/MED_TEST_OSIRIS_SRV/SalesOrderSet?$format=json");
//Getting the Data and putting in list model
<code>With this code , I can call the Odata and display the results in a table.
But now when I am applying filter like this :

https://<>/sap/opu/odata/SIE/MED_TEST_OSIRIS_SRV/SalesOrderSet?$filter=Country_SP eq 'DE'<br>

I can get the results in browser's address bar but not in the code like :<br>
<code>var sUrl = "https://<>/sap/opu/odata/SIE/MED_TEST_OSIRIS_SRV/SalesOrderSet?$filter=Country_SP eq 'DE'";

var oModel = new sap.ui.model.json.JSONModel(sUrl);

what I am doing wrong ? I can filter the results in the browser with the same url :(<br>