on 2024 Jan 04 7:46 AM
Hello Team,
I have been following this documentation to create Employee hierarchical list report (in ABAP trail version) but getting below error while creating Service Binding.
https://help.sap.com/docs/abap-cloud/abap-rap/implementing-hierarchical-view
Issue while creating service Binding:

@AbapCatalog.viewEnhancementCategory: [#NONE]<br>@AccessControl.authorizationCheck: #NOT_REQUIRED<br>@EndUserText.label: 'Consumption view for Hierarchy'<br>@Metadata.ignorePropagatedAnnotations: true<br>@ObjectModel.usageType:{<br> serviceQuality: #X,<br> sizeCategory: #S,<br> dataClass: #MIXED<br>}<br>@Metadata.allowExtensions: true<br>@OData.hierarchy.recursiveHierarchy:[{ entity.name: 'ZI_EMPHIERARCHY_CONF1' }]<br>define view entity ZC_EMPHIERARCHY1<br> as select from ZI_EMPHIERARCHY1<br> association of one to many ZC_EMPHIERARCHY1 as _Manager on $projection.Manager = _Manager.Employee<br>{<br> key Employee,<br> Manager,<br> /* Associations */<br> _Manager <br>}
Thanks a lot.
Best Regards,
Muthu
Request clarification before answering.
Hi Muthu
error says there is no "parent" association. Within your CDS Hierarchy definition, what is the parent association used? Is that association also exposed on your C view where you added this annoation
@OData.hierarchy.recursiveHierarchy:I have noted down my learnings and some issues I have faced while trying out hierarchies on BTP Trial account on this page. Hope that helps -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello dhananjayhegde
I don't have any compositional relationship just tried to use recursive Hierarchy like below
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Configuration for Employee Hierarchy'
define hierarchy ZI_EMPHIERARCHY_CONF1
as parent child hierarchy(
source ZI_EMPHIERARCHY1
child to parent association _Manager
start where
Manager is initial
siblings order by
Employee ascending
)
{
key Employee,
Manager
}@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Interface view for Employee Hierarchy'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_EMPHIERARCHY1
as select from zemphierarchy1
association of one to many ZI_EMPHIERARCHY1 as _Manager on $projection.Manager = _Manager.Employee
{
key employee as Employee,
manager as Manager,
_Manager
}@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Consumption view for Hierarchy'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@Metadata.allowExtensions: true
@OData.hierarchy.recursiveHierarchy:[{ entity.name: 'ZI_EMPHIERARCHY_CONF1' }]
define view entity ZC_EMPHIERARCHY1
as select from ZI_EMPHIERARCHY1
association of one to many ZC_EMPHIERARCHY1 as _Manager on $projection.Manager = _Manager.Employee
{
key Employee,
Manager,
/* Associations */
_Manager
}
Hi muthuhana
by parent association I meant the _Manager association in your example. It looks fine. Only thing I would change would be:
in ZC_EMPHIERARCHY1, comment the below line:
association of one to many ZC_EMPHIERARCHY1 as _Manager on $projection.Manager = _Manager.Employeeand then change the assoication exposure to
_Manager : redirected to ZC_EMPHIERARCHY1see if that helps
Cheers!
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.