Showing results for 
Search instead for 
Did you mean: 

Calculated field for CDS view in RAP

0 Kudos

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.

Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you for visiting SAP Community to get answers to your questions.

As you're looking to get most out of your community membership, please consider include a profile picture to increase user engagement & additional resources to your reference that can really benefit you:

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

All the best,


Accepted Solutions (0)

Answers (0)