on 2024 Jan 05 9:55 AM
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.
Request clarification before answering.
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can relate to what Muthu is saying. I am currently on S/4HANA on-premise 2023 version and am getting the following error on eclipse. I am quite confident that the underlying hierarchy implementation, consumption/interface views etc are following the correct annotations etc. I even tried implementing the CDS views/hierarchies/SD/SBs from Dominik Eira Elias's session on Hierarchy Support in RAP to the letter.
Error during compilation. See next line for details.Error in entity 'XXXX(CDS)': Hierarchy for view XXXX is not supported
If it helps, these are the software component versions on my on-prem system
SAP_BASIS 758
SAP_ABA 75I
SAP_GWFND 758
SAP_UI 758
Perhaps @Andre_Fischer or @Dominik_Eira_Elias could comment 🙂
Regards,
Tharindu W
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Muthu
Yes, Hierarchy support for Fiori Elements with OData V4 is available since S/4 HANA Cloud 2208. For OP, I think, it is OP 2023 release, but I am not quite sure. This is read-only hierarchy support.
For Fiori Elements with OData V2, it is not supported out of the box via CDS Hierarchy. Instead you will need to achieve it through custom Query Implementation class to build the hierarchy, as far as I know.
Hope this helps.
Regards
Dhananjay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as far as I know, the annotation
@Odata.hierarchy.recursiveHierarchy
works only for OData V4.
The CDS Hierarchy itself has been supported since long but it is the native support of hierarchy feature in OData v4 which utilizes CDS hiearchy and this is available in S/4 HANA OP release 2023.
Before S/4 HANA OP 2023, if you want to display hierarchical data on Fiori Elements app, then only option for you is to use OData v2 and then implement a query class on consumption layer. No out-of-the-box support through annotations. It requires ABAP coding to build the hierarchy.
With OData v4, from OP 2023, this can be achieved with a simple annotation - no ABAP coding required to show hierarchy on Fiori Elements.
Hello dhananjayhegde
Before S/4 HANA OP 2023, if you want to display hierarchical data on Fiori Elements app, then only option for you is to use OData v2 and then implement a query class on consumption layer. No out-of-the-box support through annotations. It requires ABAP coding to build the hierarchy.
I have tried Custom Entity but unable to get the data in hierarchal manner. Am I missing anything else from the Backend ?
Could you please share if you have any references for this scenario.
User | Count |
---|---|
62 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.