Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 845

How can i solve this Error "uncaught (in promise)" while Retrieving odata using sapui5

$
0
0

Hi,

 

      I am trying to do SAPUI5 / Fiori application development using Eclipse.

 

      I am going to retrieve my odata which I have created using HANA XS database.

 

Step by step of My Application :


  1. First create SAPUI5 application in eclipse.

      Go to file->new->others->choose “Application Project” under that SAPUI5 Application Development.


   2. And, given project name as “Hanaxs_Odata” and choosed library  as “sap.ui.m” , and check if the “Create an Initial View” checked or not. Not means check that. and click->Next”

 

    3. Give the name of the view as “view1” , Development paradigm choose “XML” and click ->Finish

 

   4. Then   in view1.view.xml :

           Add the below code

<!-- create table in SAPUI5 --><Table id="idProductTable" inset="false" mode="SingleSelectLeft"
items="{
path: '/Products'
}"><headerToolbar><Toolbar><Title text="Employee Details" level="H2" /></Toolbar></headerToolbar><columns><Column><Text text="Product ID" /></Column><Column><Text text="Product Name" /></Column><Column><Text text="Product Description" /></Column><Column><Text text="Product rate" /></Column><Column><Text text="Product price" /></Column></columns><items><ColumnListItem><cells><Text text="{ProductID}" /><Text text="{Name}" /><Text text="{Description}" /><Text text="{Price}" /><Text text="{CurrencyCode}" /></cells></ColumnListItem></items></Table>

 

        5. And in  View1.controller.js :

           Add the below code


onInit: function() {
var oModel = new sap.ui.model.odata.ODataModel(  "proxy/https/s12hanaxs.hanatrial.ondemand.com/p1941903330trial/opensap/myproducts/services.xsodata/");  this.getView().setModel(oModel);
},

      

       Finally review page  shows uncaught (in promise) error while Retrieving data's from our own odata.

 

    

 

uncaught.png

 

     However when i tried with the sample odata (http://services.odata.org/V2/(S(cl0ssdfbwe3c4ra5hpbg2k45))/OData/OData.svc/) its all working fine, But for my own odata its throwing uncaught (in promise) error.

working.png

 

     Am I done anything wrong with my Application ,

 

     Please let me help to sort out the problem. Thanks in advance


Viewing all articles
Browse latest Browse all 845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>