Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Issue while consuming SAP Demo gateway Service ( Services hosted in )

Hello UI5 Gurus,

I am practicing  different SAP UI5 controls by creating sample UI5 apps.

Till now I have been using



Therefore, directly getting json data and thereby using sap.ui.model.json.JSONModel() for setting model to UI Controls.

Now am trying to  consume data from SAP Demo Gateway services using sap.ui.model.odata.ODataModel

But not able to , can anyone please highlight where I am making the mistake.

JS Bin - Collaborative JavaScript Debugging

Note: In the code I have put the password ( just replaced with ****** for the sake of posting it publicly ).




Am sharing the solution for beginners like me :

<!DOCTYPE html>



  <script src="" id="sap-ui-bootstrap"    

  data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.ui.commons,sap.ui.table"></script>

  <meta http-equiv="X-UA-Compatible" content="IE=edge" />

  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>



     var service_url = "";

     var oModel = new sap.ui.model.odata.ODataModel(service_url,true,"P1128538","**********");


  var oTable = new sap.ui.table.Table({ // create Table UI

  columns : [

   {label: "Carrier ID", template: "carrid"},  

   {label: "Connection ID", template: "connid"},

   {label: "Flight Time", template: "fldate"},  









<body class="sapUiBody">

    <div id="content"></div>



Note : The above may not work in some browsers like Firefox due to CORS issue. In that case try with other browsers like I.E or Safari.

And in the below section ,

var oModel = new sap.ui.model.odata.ODataModel(service_url,true,"P1128538","**********");

please replace ******* with your password for accessing SAP's ES4 system.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question