cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CDS hierarchy view

JamesG
Participant
0 Kudos
216

Hi experts,

when I define parent and child,i get this error:

someone can help me?

this is me code:

@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'test'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity zddl_test5 as select from aufm as a
{
a.bwart,
a.aufnr,
a.matnr,
a.werks,
a.lgort,
a.charg,
@Semantics.quantity.unitOfMeasure: 'ZDDL_TEST5.MEINS'
a.menge,
a.meins
}
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'test'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@Hierarchy.parentChild: [ { name: 'parent',recurseBy: '_parent' } ]
define view entity zddl_test10 as select from zddl_test5
association [0..*] to zddl_test10 as _PARENT on $projection.matnr = _PARENT.matnr
and $projection.werks = _PARENT.werks
and $projection.lgort = _PARENT.lgort
and $projection.charg = _PARENT.charg
{
_PARENT,
aufnr,
matnr,
werks,
lgort,
charg,
@Semantics.quantity.unitOfMeasure: 'ZDDL_TEST10.MEINS'
menge,
meins
}
define hierarchy zddl_test11
as parent child hierarchy (
source zddl_test10
child to parent association _parent
siblings order by matnr,werks,lgort,charg ascending
multiple parents allowed
)
{ aufnr,
matnr,
werks,
lgort,
charg,
menge,
meins,
_parent

}

Best regards

Accepted Solutions (0)

Answers (0)