cancel
Showing results for 
Search instead for 
Did you mean: 

Pass select option to CDS View only! No AMDP

0 Kudos
5,954

I know we can pass Select options from ABAP to CDS using table function and AMDP approach,

But as we know there are advantages of using core CDS and I was wondering that is there any approach where I can pass my select option to CDS view and consume it in CDS view only

View Entire Topic
MateuszAdamus
Active Contributor

Hello amit316chauhan

Condition generated from Select Options is passed to the DB server and handled on the DB side. Records are not filtered in the application server. Please read the SAP Help documentation when not sure.

I see no reason why the same thing shouldn't happen when querying data from a CDS view.

Kind regards,
Mateusz
0 Kudos

I Aggre that the condition passed is executed at DB layer

   SELECT *
       FROM z_cds_view
       INTO TABLE @DATA(lt_result)
       where field1 in s_field1. (Here Where Clause will be executed at DB level)

In Above code Complete z_cds_view will gets executed(lets say it retrieve 1Mil records) without filter first and then its result(1M records) will be filtered again (at DB level) by passing s_field1.

So the performance could have been improved if there would have been a way to pass select option directly at DB level, can you please comment on same?

Kind Regards

gasparerdelyi
Product and Topic Expert
Product and Topic Expert

The WHERE condition will be applied by DB the way the optimizer can deal with the situation.
It will not pass non-matching records to the application server.

If it will process many records or not depends on a number of factors:

  • If it is a calculated field
  • if the field is coming from a join or association then what are the ON conditions
just to name the trivial ones...
Why filter pushdown is not working is sometimes a not so easy question... but far more details are needed for analysis.