Binding OData service to SAP UI5 table

SAPSAP UI5

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);
});
raja
Published on 19-Dec-2017 10:59:58
Advertisements