cancel
Showing results for 
Search instead for 
Did you mean: 

How to activate CDS views that depend on each other?

hauke_h
Discoverer
0 Kudos

I have 3 super simple CDS view examples from the CDS book, but I can't activate them, because they depend on each other. There must be a solution for this, but what? There are always errors that exist because anotehr part is still not activated. And you cannot force activation anymore, why?

Here are my CDS views:

1:

 

 

define root view entity Z_CompositionRootView
as select distinct from zscribbles_data as DATA
composition [0..*] of Z_CompositionChildView as _ChildView
{
  key DATA.char_r as RootKeyField,
  _ChildView
}

 

 

==> Cannot be activated because Z_CompositionChildView doesn't exist... and so on...

2:

 

define view entity Z_CompositionChildView
as select distinct from zscribbles_data as DATA
association to parent Z_CompositionRootView as _RootView
on $projection.RootKeyField = _RootView.RootKeyField
composition [0..*] of Z_CompositionGrandchildView
as _GrandchildView
{
  key DATA.char_r as RootKeyField,
  key DATA.char_c as ChildKeyField,
  _RootView,
  _GrandchildView
}

 

3:

define view entity Z_CompositionGrandchildView
as select distinct from zscribbles_data as DATA
association [1..1] to Z_CompositionRootView as _RootView
on $projection.RootKeyField = _RootView.RootKeyField
association to parent Z_CompositionChildView as _ChildView
on
$projection.RootKeyField = _ChildView.RootKeyField
and $projection.ChildKeyField = _ChildView.ChildKeyField
{
  key DATA.char_r as RootKeyField,
  key DATA.char_c as ChildKeyField,
  key DATA.char_g as GrandchildKeyField,
  _RootView,
  _ChildView
}

Accepted Solutions (0)

Answers (1)

Answers (1)

patrick_winkler
Product and Topic Expert
Product and Topic Expert
0 Kudos

Try to activate them all together. In ADT, the key combination is Ctrl+Shift+F3.
The mass activation icon is next to the single activation icon.