Skip to Content
0

CDS View for tree table

Oct 12, 2016 at 03:40 PM

166

avatar image

Hi,

I have a requirement where I have to show Purchase Order and Purchase Order item in a tree structure. All purchase order items should be shown as child of purchase order.

There will be a filter bar above tree table where we will enter search filed to search Purchase Order/Purchase order Item.

For this I have created a CDS which returns all Purchase order Items in a linear structure. But to show data in tree structure, I have to make it hierarchical? What is best way to do it?

Regards,

Vinayak

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Attila Berencsi Dec 28, 2016 at 07:44 PM
0

Hi Vinayak,

maybe this is helpful, it is about CDS hierarchical annotations:
https://help.sap.com/saphelp_nw75/helpdata/en/23/473e6a8b1c4da2b0ba5be4f319a16c/content.htm?frameset=/en/23/473e6a8b1c4da2b0ba5be4f319a16c/frameset.htm¤t_toc=/en/d9/bc687d35fa42ccbb0b9256ce786d51/plain.htm&node_id=112

Maybe you can combine it with one of the below controls with small efforts (I'm planning to do such combination after we upgraded to NW 7.51, at the moment I load the data from the backend and build the tree manually into a JSON model and use the first control.At the moment we are on a low NW release and do not have the possibility to implement this more simple, onyl using JSON using ABAP backend):

https://sapui5.hana.ondemand.com/explored.html#/entity/sap.ui.table.TreeTable/samples

https://sapui5.hana.ondemand.com/explored.html#/entity/sap.m.Tree/samples

OData service example with annotations for tree/hierarchy representation:
https://blogs.sap.com/2015/10/23/treetable-odata-binding/

The service should be called on first level and every time you expand a node.

Regards

Attila

Share
10 |10000 characters needed characters left characters exceeded