Skip to Content
0
Former Member
Dec 19, 2015 at 03:27 PM

sap.m.Table showing one record multiple times on Aggregation

1041 Views

Hi Community,

I am binding a sap.m.Table to Odata service .The service is returning correct data but the table is only showing last record of the data multiple times( = total records returned by SAPUI5) . Here is the JSON from debugger and XML View :

<Table inset="true" headerText="Technician Log" items="{NotifTechLog}">

<columns>

<Column id="__dynamicColumn0">

<header>

<Label text="Staff Name" />

</header>

</Column>

<Column id="__dynamicColumn1">

<header>

<Label text="Staff ID" />

</header>

</Column>

<Column id="__dynamicColumn2">

<header>

<Label text="Hours" />

</header>

</Column>

<Column id="__dynamicColumn3">

<header>

<Label text="Start Time" />

</header>

</Column>

<Column id="__dynamicColumn4">

<header>

<Label text="Start Date" />

</header>

</Column>

<Column id="__dynamicColumn5">

<header>

<Label text="End Time" />

</header>

</Column>

<Column id="__dynamicColumn6">

<header>

<Label text="End Date" />

</header>

</Column>

</columns>

<items>

<ColumnListItem>

<cells>

<Text text="{Zzpstaffname}" />

<Text text="{Zzpstaffno}" />

<Text text="{Zzplabhrs} {Zzpunit}" />

<Text text="{path : 'ZzpstartTime',type: 'sap.ui.model.odata.type.Time' }" />

<Text text="{path : 'ZzpstartDat', type : 'sap.ui.model.type.Date'}" />

<Text text="{path : 'ZzpendTime',type: 'sap.ui.model.odata.type.Time' }" />

<Text text="{path :'ZzpendDat', type : 'sap.ui.model.type.Date'}" />

</cells>

</ColumnListItem>

</items>

</Table>

  1. {d: {,…}}
    1. d:{,…}
      1. results:[{__metadata: {,…}, Mandt: "100", Sno: 1, Qmnum: "10000592", Zzpstaffno: "000000000002",…},…]
        1. 0:{__metadata: {,…}, Mandt: "100", Sno: 1, Qmnum: "10000592", Zzpstaffno: "000000000002",…}
          1. Mandt:"100"
          2. Qmnum:"10000592"
          3. Sno:1
          4. Zzpcostphr:"0.00"
          5. Zzpcurency:""
          6. ZzpendDat:"/Date(1450224000000)/"
          7. ZzpendTime:"PT18H58M00S"
          8. Zzplabhrs:"2.00"
          9. Zzpstaffname:"M"
          10. Zzpstaffno:"000000000002"
          11. ZzpstartDat:"/Date(1448841600000)/"
          12. ZzpstartTime:"PT17H58M00S"
          13. Zzpunit:""
          14. __metadata:{,…}
        2. 1:{__metadata: {,…}, Mandt: "100", Sno: 2, Qmnum: "10000592", Zzpstaffno: "000000000003",…}
          1. Mandt:"100"
          2. Qmnum:"10000592"
          3. Sno:2
          4. Zzpcostphr:"0.00"
          5. Zzpcurency:""
          6. ZzpendDat:"/Date(1450569600000)/"
          7. ZzpendTime:"PT17H58M00S"
          8. Zzplabhrs:"3.00"
          9. Zzpstaffname:"j"
          10. Zzpstaffno:"000000000003"
          11. ZzpstartDat:"/Date(1448928000000)/"
          12. ZzpstartTime:"PT18H58M00S"
          13. Zzpunit:""
          14. __metadata:{,…}
        3. 2:{__metadata: {,…}, Mandt: "100", Sno: 3, Qmnum: "10000592", Zzpstaffno: "000000000004",…}
          1. Mandt:"100"
          2. Qmnum:"10000592"
          3. Sno:3
          4. Zzpcostphr:"0.00"
          5. Zzpcurency:""
          6. ZzpendDat:"/Date(1450569600000)/"
          7. ZzpendTime:"PT18H58M00S"
          8. Zzplabhrs:"2.00"
          9. Zzpstaffname:"k"
          10. Zzpstaffno:"000000000004"
          11. ZzpstartDat:"/Date(1448841600000)/"
          12. ZzpstartTime:"PT12H58M00S"
          13. Zzpunit:""
          14. __metadata:{,…}