cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a hierarchy based data from flat data in cap java using TopLevels in OData

Irbaaz
Associate
Associate
0 Kudos
117

Hello there,

I am new in SAP CAP Java, i am looking for transforming a flat table data into a hierarchy based data using OData.

Let's take an example, let's assume this is the flat table data:

Irbaaz_0-1745251579331.png

and  response should be:

Irbaaz_1-1745251632150.png

I have created response exactly like the above response by customized tree based on the values from the flat table data. I want to implement this by using 'com.sap.vocabularies.Hierarchy.v1.TopLevels'. I don't see any blogs ,Tutorials about this. do we have anything like that? or is it possible to do it?, Can anyone help me out? 

Thanks in advance!
Irbaaz

 



Accepted Solutions (0)

Answers (1)

Answers (1)

VladimirM1
Associate
Associate
0 Kudos

Check Capire https://cap.cloud.sap/docs/advanced/odata#hierarchical-transformations and our sample application https://github.com/SAP-samples/cloud-cap-samples-java where we have a working demo of the hierarchical data.