cancel
Showing results for 
Search instead for 
Did you mean: 

Use CDS custom entity as data source/association for other views

stem21
Discoverer
0 Kudos
133

Hello Community!

We built a custom cds root entity which gets its data from a remote client proxy. Now we want to use this custom entity as a data source for other views or as association/join in other views. Every approach I tried failed so far - is there any solution to that?

Use custom entity as data source:

 

define view entity I_Entity2
  as select from I_CustomEntity

 

 Error: Entity "I_CustomEntity" cannot be used as the data source

Use custom entity in join statement:

 

define view entity I_Entity2
  as select from I_Entity1 join I_CustomEntity ....

 

Error: Entity "I_CustomEntity" cannot be used as the data source

Use custom entity as association:

 

define view entity I_Entity2
  as select from I_Entity1

  association [1] to I_CustomEntity as _Custom ...
{
  _Custom.Field1
}

 

Error: Target of association _Custom cannot be an abstract/custom entity

Accepted Solutions (1)

Accepted Solutions (1)

jrtr
Discoverer

Hello,

you cannot use custom entities as data source. You can just integrate/expose it as an association without accessing a field. For example: 

define view entity I_Entity2
  as select from I_Entity1

  association [1] to I_CustomEntity as _Custom
{
  _Custom
}

 

reference (answer from Andre Fischer) 

stem21
Discoverer
0 Kudos

Thanks for the link!

Answers (0)