Skip to Content
0
Feb 10, 2015 at 06:38 AM

Odata Filter to fetch multiple items into table.

24 Views

Hi,

I am trying to fetch line items in the detail view of a UI5 application.

The record has 4 to 5 line items but instead of that i am only getting a single line item.

what should i do to get the multiple line items.

below i am attaching the code for the above along with the screenshot of the output.

Please help me to find the solution.

Thanks in advance.

Detail.View.Xml

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc"
  xmlns="sap.m" controllerName="sap.ui.demo.myFiori.View.Detail"
  xmlns:html="http://www.w3.org/1999/xhtml" xmlns:f="sap.ui.layout.form">
  <Page title="Physical Inventory Document Details">
  <content>

<ObjectHeader id="title" title="{Vbeln}">
  </ObjectHeader>

<IconTabBar expanded="{device>/isNoPhone}"> <items> <IconTabFilter icon="sap-icon://supplier"> <f:SimpleForm editable="false" layout="ResponsiveGridLayout" id="FormId"> <core:Title text="Physical Inventory Count" /> <Text text="Physical Inventory Document Number" /> <Input enabled="true" editable="false" id="ip_phyno" /> <Text text="PLant" /> <Input enabled="true" editable="false" id="ip_plant" /> <Text text="Storage Location" /> <Input enabled="true" editable="false" id="ip_strloc" /> </f:SimpleForm> </IconTabFilter> </items> </IconTabBar> </content> <Table id="dtable"> <headerToolbar> <Toolbar> </Toolbar> </headerToolbar> <columns> <Column minScreenWidth="Tablet" demandPopin="true" hAlign="Center"> <Text text="Items" /> </Column> <Column minScreenWidth="Tablet" demandPopin="true" hAlign="Center"> <Text text="Material Desc." /> </Column> <Column minScreenWidth="Tablet" demandPopin="true" hAlign="Center"> <Text text="Batch" /> </Column> <Column hAlign="Right"> <Text text="Stock Type" /> </Column> <Column hAlign="Center" minScreenWidth="Tablet" demandPopin="true"> <Text text="Quantity" /> </Column> <Column hAlign="Center" minScreenWidth="Tablet" demandPopin="true"> <Text text="Unit of Entry" /> </Column> <Column demandPopin="true" minScreenWidth="Tablet"> <Text text="zero count" /> </Column> </columns> <items> <ColumnListItem vAlign="Middle"> <cells> <ObjectIdentifier title="{Item}" /> <Text text="{Material}" /> <Text text="{Batch}" /> <Text text="{STy}" /> <Input value="{Quantity}" type="{Text}" unit="{number}" editable="true" /> <Input value="{Une}" type="{Text}" description="{UoE}" editable="true" /> <!-- <Text text="{Quantity}" /> <Text text="{Une}" /> --> <CheckBox text="" /> </cells> </ColumnListItem> </items> </Table> </Page> </core:View>



Detail.Contoller.js

sap.ui.controller("sap.ui.demo.myFiori.View.Detail", {




  onInit: function() {

  sap.ui.getCore().getEventBus().subscribe("app","RefreshDetail", this._refresh,this);

  },

_refresh : function (chnId,evtId,info){

  this.getView().byId("ip_phyno").setValue(info.phys_inv_doc);
  this.getView().byId("ip_plant").setValue(info.plant);
  this.getView().byId("ip_strloc").setValue(info.str_loc);


  var path = "/z_DetailSet(Physinventory='" + info.phys_inv_doc + "',Fiscalyear='" + info.fis_year + "')";
  this.byId("dtable").bindElement(path);


},


});


Attachments

UI5.png (80.7 kB)