Skip to Content
0
Mar 17 at 05:46 PM

Calculated field for CDS view in RAP

69 Views

Hi Experts,

I have two CDS (C_View selects data from I_View) and I need to define a virtual field in the child view I_View to be able to filter data in the parent view C_View by virtual field.

I've already tried the approach of marking field with annotations and calculating value in the global class:

@ObjectModel.readOnly: true<br>@ObjectModel.virtualElement: true <br>@ObjectModel.virtualElementCalculatedBy: 'ABAP:<CLASS>'

But in that case, the calculated value has an empty value in the C_View and I can't filter data.

Is it possible to use this approach to get the value for the virtual field in the views with a higher level?

Or maybe there are other methods to calculate values for fields in the CDS view.

Thanks and best regards.