on 07-26-2016 6:58 PM
Hi,
I am looking to bind table items for an expand set along with filter but unable to achieve it most of the examples are with respect to Sap.ui.Table looking for binding with sap.m.Table from SAP odata service. Someone point me to a sample code or link to lookup.
Thanks,
Ramesh
Hello Ramesh,
as per your service response, binding should be as below, this will work-
<Text text="{POModel>NavItem/results/0/PoItem}"></Text>
or I am not sure whether response structure can be changed from backend, as per your current code (<Text text="{POModel>NavItem/PoItem}"></Text>) structure should look a like below:
"NavItem": {
"__metadata": {
"id": "*******/sap/opu/odata/sap/ZPO_SRV/ItemSet('00010')",
"uri": "*******/sap/opu/odata/sap/ZPO_SRV/ItemSet('00010')",
"type": "ZPO_SRV.Item"
},
"PoNumber": "4500008238",
"PoItem": "00010",
"Material": "",
"NavSchedule": {
"__deferred": {
"uri": "*******/sap/opu/odata/sap/ZPO_SRV/ItemSet('00010')/NavSchedule"
}
}
}
Regards,
Akhilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramesh,
Check out this link it may help you.
URI Conventions (OData Version 2.0) &middot; OData - the Best Way to REST
Thanks
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have updated the Plunker for you needs, please check this - https://plnkr.co/edit/gG0uMhrqjFec2xzELCtS?p=preview
here I am expanding "Supplier" on "Product"
Odata link - http://services.odata.org/V2/OData/OData.svc/Products?$expand=Supplier
Hope this will help you
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Once again thanks for pointing out another example seems close but I am not able to achieve the binding please see the attached file for what I am trying to experiment the binding is not happening for expand don't know what I am doing wrong maybe you can spot it. Except that I am not dynamically doing the binding instead doing in xml view.
Thanks
Ramesh
Sorry, I tried {POModel>NavItem/PoItem as well as {POModel>/NavItem/PoItem} but no luck when I copied I had the last tried one in the attached file.
Now I am suspecting if anything to do with resources version of SAPUI5 in Hana studio not able to interpret the SEGW generated ODATA service in SAP as far as binding is concerned. We are using HANA database do we need to be in particular service pack? Anyone had such version compatibility issues?
Thanks,
Ramesh
Hi Chandan,
In the Plunkr Code am able to see the below piece of code.
oTable1.bindItems({
path: '/Products',
parameters:{expand : 'Supplier'},
template:oTemplate1
});
In this code could you please explain "parameters:{expand : 'Supplier'}," this line.
And while binding text you are using {ID},{Description} how can we see those in the Odata.
Regards,
Shekar
Sorry for the late response,
"parameters:{expand : 'Supplier'}," is for to use Expand query on the odata model.
more info on - http://www.odata.org/getting-started/basic-tutorial/#expand
Thanks and Regards,
Chandan
Hi,
A simple example is here - https://plnkr.co/edit/gG0uMhrqjFec2xzELCtS?p=preview
Odata service used - http://services.odata.org/V2/OData/OData.svc/
Note - I am using https://cors-anywhere.herokuapp.com/ to nullify the Cross Origin Issues.
Thanks,
Chandan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chandan, Thanks for your response, I am able to bind the sap.m table with no issues in a straight forward case but my issue is when I use a filter and I have odata associations with expand dataset is what I am looking for.
For example if I use filter on sales order create date I want to see the header, item and schedule line details in a table. Which are odata expand entitysets. I get these details in a single call to odata service.
Thanks,
Ramesh
User | Count |
---|---|
77 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.