on 04-26-2017 7:24 PM
I make an SAPUI5 application and deploy in my abap server.
I need to acess the url http://my_gateway_system:port/sap/opu/odata/sap/ZGW_TRANSF/ztest_nameset('RUBENS') via OData.
When I copy this URL and past in my browser I get some data, but when I run my application, isn't get any data
Below is my code where I call the OData
var sServiceUrl = "http://<my_gateway_system>:<port>/sap/opu/odata/sap/ZGW_TRANSF";
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true, "username", "password");
var oJsonModel = new sap.ui.model.json.JSONModel();
oModel.read("/ztest_nameset('RUBENS')", null, null, true, function(oData, response) {
oJsonModel.setData(oData);
});
sap.ui.getCore().setModel(oJsonModel);
Hi ,
You can't access URL directly like this http://<my_gateway_system>:<port>/sap/opu/odata/sap/ZGW_TRANSF, it will give Cross origin error ..you need to use the relative paths .. if you have deployed your ui5 app in the gateway system (same where you have your service)
thanks
Viplove
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.