Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Access filter parameters inside CDS virtual element calculated class

Chandruu0208
Explorer
0 Likes
2,779

Hi All,

The scenario is that, I am passing two filter parameters (BEGDA & ENDDA) to my CDS based OData service. I have a virtual element for which the data is obtained from a calculated class.

When I call the CDS by passing the filters (BEGDA & ENDDA) the CDS view is called and which in turn calls the class I had created for the virtual element. Inside this class I am try to call an FM which requires the BEGDA and ENDDA as the input parameters.

I am unable to access the dates (BEGDA and ENDDA) that is passed to the CDS entity set inside by virtual element calculated class.
Can anyone help with a solution?

Thanks in advance,

Regards

4 REPLIES 4
Read only

tnns
Explorer
0 Likes
2,230

HI chandruu0208,

have you found a solution for this problem?

Read only

lei_li
Discoverer
0 Likes
2,230

Hi Chandrasekhar, have you found solutoin on this 🙂

Read only

0 Likes
2,230

Hi Lei Li, Unfortunately it is not possible to pass filters in this approach. Instead we need to create an unmanaged query to achieve this.

Regards

Read only

sushanthherlep
Product and Topic Expert
Product and Topic Expert
0 Likes
2,230

Hello Chandrashekar,

The reply is quite late. May be you can check the Filter Push down approach as mentioned in this blog.

https://blogs.sap.com/2021/05/14/filters-push-down-in-abap-cds-views-for-a-better-performance-of-the...

Regards,

Sushanth Herle