Skip to Content

SAPUI5 - OData don't show any data

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();"/ztest_nameset('RUBENS')", null, null, true, function(oData, response) {

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 27, 2017 at 09:48 AM

    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 need to use the relative paths .. if you have deployed your ui5 app in the gateway system (same where you have your service)



    Add comment
    10|10000 characters needed characters exceeded