Binding OData service to SAP UI5 table


Your service end point is incorrect- var oModel = new sap.ui.model.odata.v2.ODataModel("http://admin- think:88/sap/...",{useBatch : true});.

To fix this issue, you need to remove “CoreOpenAppSet()” portion of the variable which is getting passed to ODataModel constructor. You need to pass function import using ODataModel- “oModel.callFunction()”.

Once function call is completed, you can bind the result using “setBindingContext” as in below code −

var oPromise = oModel.callFunction("/CoreOpenAppSet");
oPromise.contextCreated().then(function(oContext) {
   oView.setBindingContext(oContext);
});

Updated on: 14-Feb-2020

906 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements