on 04-10-2016 8:16 AM
I have a requirement to get data in the below format from hana, I have written a Calc view..but I am not sure how get to store the looping data (Awards, Wall of fame) by using Nested table. So that I can get the data in the below format. I am using Java Spring Framework to call the calc view.
Main table have to contain Awards and Wall of fame has nested tables.
{
"Name": "A",
"No": 89700,
"Awards": [
{
"Award_key": 1,
"Award_name": "Best Performer1"
},
{
"Award_key": 2,
"Award_name": "Best Performer2"
},
{
"Award_key": 3,
"Award_name": "Best Performer3"
}
],
"Wall_fame": [
{
"WF_key": 1,
"WF_name": "Best Performer1"
},
{
"WF_key": 2,
"WF_name": "Best Performer2"
}
]
}
Need help.
Just by using the calculation view, you will not get the required format. The calculation view just returns a flat/denormalized structure. To get that normalized structure you could use an XSJS service to prepare that JSON response. Another way would be to use an XSOData service with three entities (base entity, awards, wall frame) and the necessary dependency/navigation settings. Doing a GET request on the base entity with an expand on the two dependent entities would give you then the result in a similar form.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.