Skip to Content
0

failed to display data in ui5table from abap odta service

Mar 14, 2017 at 12:52 PM

48

avatar image

Hi Experts,

I am trying to extract data from odata (abap) service to display in table but i am getting below errors .

1.OPTIONS https://sapds0.sabre.com:8000/sap/opu/odata/sap/YOSCARS_SRV/$metadata request @ datajs.js:17

E2 @ datajs.js:17 o.request @ datajs.js:17 (anonymous) @ library-preload.js:1866 a._loadMetadata @ library-preload.js:1866 constructor @ library-preload.js:1862 constructor @ library-preload.js:1901 o @ sap-ui-core.js:393 onInit @ Yoscar.controller.js:40 a.fireEvent @ sap-ui-core.js:449 a.fireEvent @ sap-ui-core.js:991 (anonymous) @ sap-ui-core.js:573 c._initCompositeSupport @ library-preload.js:862 (anonymous) @ sap-ui-core.js:461 constructor @ sap-ui-core.js:461 constructor @ sap-ui-core.js:971 constructor @ sap-ui-core.js:805 f @ sap-ui-core.js:638 f @ sap-ui-core.js:638 sap.ui.view @ library-preload.js:881 o.(anonymous function) @ sap-ui-core.js:393 (anonymous) @ index.html:19 datajs.js:17 OPTIONS https://sapds0.sabre.com:8000/sap/opu/odata/sap/YOSCARS_SRV/$metadata request @ datajs.js:17 E2 @ datajs.js:17 o.request @ datajs.js:17 (anonymous) @ library-preload.js:1866 a._loadMetadata @ library-preload.js:1866 a.refresh @ library-preload.js:1867 m.refreshMetadata @ library-preload.js:1921 constructor @ library-preload.js:1901 o @ sap-ui-core.js:393 onInit @ Yoscar.controller.js:40 a.fireEvent @ sap-ui-core.js:449 a.fireEvent @ sap-ui-core.js:991 (anonymous) @ sap-ui-core.js:573 c._initCompositeSupport @ library-preload.js:862 (anonymous) @ sap-ui-core.js:461 constructor @ sap-ui-core.js:461 constructor @ sap-ui-core.js:971 constructor @ sap-ui-core.js:805 f @ sap-ui-core.js:638 f @ sap-ui-core.js:638 sap.ui.view @ library-preload.js:881 o.(anonymous function) @ sap-ui-core.js:393 (anonymous) @ index.html:19

2.Uncaught in promise

code in view .

var oTable= new sap.ui.table.Table("Table1",{

visibleRowCount : 5, editable: false }); var oColumn1 = new sap.ui.table.Column("Col1",{ label : "Movie Year", template : new sap.ui.commons.TextField().bindProperty("value","MovieYear"), }); // Add column to table oTable.addColumn(oColumn1); // Creating column2 var oColumn2 = new sap.ui.table.Column("Col2",{ label : "Category", template : new sap.ui.commons.TextField().bindProperty("value","MovieCategory"), }); // Add column to table oTable.addColumn(oColumn2); // Creating column3 var oColumn3 = new sap.ui.table.Column("Col3",{ label : "Movie Name", template : new sap.ui.commons.TextField().bindProperty("value","MovieName"), }); // Add column to table oTable.addColumn(oColumn3);

oTable.bindRows("/MoviesSet"); return [oTable];

code in controller .

var sServiceUrl = "https://sapds0.sabre.com:8000/sap/opu/odata/sap/YOSCARS_SRV/"; var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,false"user1","pwd1");

Thanks & Regards,

Smruti Ranjan Moharana

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu Mar 14, 2017 at 01:09 PM
0

deploy to server to run

Share
10 |10000 characters needed characters left characters exceeded
smruti moharana Mar 14, 2017 at 01:47 PM
0

Hi Jun,

Thanks a lot for u r quick reply ,kindly note that i am not getting the above error in case of other services(by north wind),i am getting the result by webapp preview.

Thanks & Regards,

Smruti Ranjan Moharana

Share
10 |10000 characters needed characters left characters exceeded