cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP CDS Annotation for Hierarchy Fiori Elements UI application - S4HANA OP System

muthuhana
Explorer

Hello Experts,

I am trying to create Hierarchy report using CDS annotation & Fiori Elements. I found this documentation where below annotation has been used to refer Hierarchy CDS view definition but seems only works for cloud.

https://help.sap.com/docs/abap-cloud/abap-rap/implementing-hierarchical-view

@OData.hierarchy.recursiveHierarchy:[{ entity.name: '/DMO/I_EmployeeHN_HR' }]

Is there any similar kind of annotation available to refer the Hierarchy CDS view in S4HANA OP system ? if not, is there any other way we can achieve this behavior ?

Thanks a lot.

View Entire Topic
dominik_ee
Advisor
Advisor

Hierarchy capabilities are only available since the 2311 cloud release. For OP 2023 (7.58) this was not yet available and will only be available in newer OP releases starting with the next OP release. 

In older releases the only way to achieve this functionality would be a custom implementation. You would have to define an unmanaged query and annotate the CDS entity on header level with the @OData.hierarchy.recursiveHierarchy Annotation and define all hierarchy properties over there (except the entity.name sub-annotation). With this annotations you define the metadata of the service in order to be interpreted correctly by the UI. The framework however is not providing any hierarchical functionality and you would have to implement everything in the unmanaged query implementation yourself (which is quite extensive and cumbersome). 

TharinduW
Explorer
0 Kudos
Thank you for the swift response @dominik_ee ! Much appreciated. I will try the unmanaged query approach to see how it goes!