cancel
Showing results for 
Search instead for 
Did you mean: 

Binding table item problem with expand list

Former Member
0 Kudos

Hi Experts,

I have an entity set HeaderSet with sale orders and item entity set ItemSet.  I have defined the navigation sets, so that automatic expand happens using framework.  It worked everything fine from gateway perspective. I'm displaying sale orders as an table and by choosing the order, i want to display items. I checked in debugging that when i select the sale order, expand is working fine and properly returning the corresponding sale order items.  Here, problem is i could not able to see the data in the item table.  It is problem with the binding. Please check the code here.

GatewayService: /sap/opu/odata/sap/ZORDER_SRV/HeaderSet('1')?$expand=ItemSet01 working fine.

Skeleton Code under controller:

//Template  to map the data to the respective column    

var template2 = new sap.m.ColumnListItem({

id: "second_template",

type: "Navigation",

visible: true,

cells: [

new sap.m.Label("ID2", {

text: "{M2>Vbeln}"

}),

new sap.m.Label({

text: "{M2>Posnr}"

}),

new sap.m.Label({

text: "{M2>Product}"

}),

new sap.m.Label({

  text: "{M2>Total}"

  })

]    

});

var  oFilters = null;

//For Odata model

oTable2.bindItems( "M2>/",template2, null, oFilters);

Code Under View:

                   var arrParams = ["$expand=ItemSet01"];

                  var sServiceUrl2 = "http://PUNSEZSAPVM31.ad.infosys.com:8010/sap/opu/odata/sap/ZORDER_SRV";

                   var oModel2 = new sap.ui.model.odata.ODataModel(sServiceUrl2,true);

     // here sItemName coming when we select the order which is working properly

                   oModel2.read("/HeaderSet('" + sItemName + "')?", null,arrParams,

                        false,function(oData2, oResponse){

                   list2 = oData2.results; });

                   console.log(list2);

                   var oJsonModel2 = new sap.ui.model.json.JSONModel();

                   oJsonModel2.setData(list2);

                   sap.ui.getCore().setModel(oJsonModel2,"M2");

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi k p,

why you are adding oFilter in the bindItems if there is no filter ...

try this :

oTable2.bindItems( "M2>/",template2);


thanks

Viplove

Former Member
0 Kudos

Thanks for your reply.

I identified the problem myself.

I had to use this below statement to read proper dataset.

list2 = oData2.ItemSet01.results;

Answers (0)