Skip to Content

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

How to fetch multiple records from Odata service into the output table.

Hi everyone,

As you see in screen shot I have attached in this discussion, I'm trying to fetch data from detail entity set of odata by passing input to it dynamically through master view. In my case the input is BOM number("00000026" as shown in screen shot). I have created a table in my detail.view.xml and trying to do filter & binding in detail.controller.js

when I run follow url in browser it shows expected output in xml format.

http://<host>:<port>/sap/opu/odata/SAP/ZPPBOM_ODATA_SRV/DetailppSet/?$filter= Stlnr eq '00000026'

And when I run project using following code, it neither show any error in consol nor it shows any output in table.

In detail.controller.js there is a variable 'Bomnumber' in which I'm able to get BOM number dynamically from master view.

Please check following xml and js files.

Looking forward for helpful reply.


Jagrut Patil.


<Table id="detail1" >



   <Label text="BOM number"></Label>




  <Column width="12em">

   <Text text="Item number" />


  <Column minScreenWidth="Tablet" demandPopin="true">

   <Text text="Item Category" />


   <Column minScreenWidth="Tablet" demandPopin="true">

   <Text text="BOM component" />


  <Column minScreenWidth="Tablet" demandPopin="true" hAlign="Right">

   <Text text="Quantity" />


  <Column minScreenWidth="Tablet" demandPopin="true" hAlign="Center">

   <Text text="Unit of measure" />








            text="{Posnr}" />


          <Text text="{Postp}" />

          <Text text="{Idnrk}" />

   <Text text="{Menge}" />

          <Text text="{Meins}" />








onInit : function() {

var bus = sap.ui.getCore().getEventBus();

bus.subscribe("app", "RefreshDetail", this._refresh, this);


_refresh : function(channelId, eventId, data) {

var Bomnumber = data.Bomnumber;


var filter = (new sap.ui.model.Filter("Stlnr",

sap.ui.model.FilterOperator.EQ, Bomnumber));

var oModel = new sap.ui.model.odata.ODataModel(



var oTable = new sap.m.Table("detail1");



bom.jpg (163804 B)

your code is bad.

1) create odata model in onInit

2) bind table in onInit

3) in _refresh do filter on list binding from table


0 View this answer in context

Helpful Answer

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