Skip to Content

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

Bind Odata records to UI5 table

Hi All,

I am trying to bind the values coming from Odata gateway service to UI5 table. I have done the code like below but I am unable to bind the values to table. Can you please help me how to retrieve collection of data and bind to table.

var oTable = new sap.ui.table.Table("Sampletable");

  var sServiceUrl =   "/sap/opu/odata/sap/ZTEST_SERV_SRV/";

  var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true);

  oTable = sap.ui.getCore().byId("Sampletable");

  oTable.setModel(oModel);

  var oDropdownBox2 = new sap.ui.commons.DropdownBox(

  "DropdownBox2", {

  tooltip : "Materials",

  displaySecondaryValues : true,

  "association:listBox" : oListBox1

  });

oDropdownBox2

  .attachChange(function() {

  var oVal = oDropdownBox2.getValue();

  alert(oVal);

  OData.read("/sap/opu/odata/sap/ZTEST_SERV_SRV/matsavdataSet?$filter=Material ge '000000000000000476' and Material le '000000000000000480'",

    function (oData, oResponse)

    { 

    },

    function(oError){ 

               alert("Read failed");} 

           );  

  });

oPanel.addContent(oDropdownBox2);

  oPanel.addContent(oTable);

Regards,

Suresh

Former Member
Former Member replied

Hi All,

The below thread helped me to resolve the issue

How to bindrows of particular data

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