‎2021 Apr 24 6:04 AM
hi experts,
how to use CDS view pass range parameters,and let it was not obligatory input?
somebody can help me ?
Thanks
‎2021 Apr 24 6:16 PM
Hello qw1391202028
First thing that comes to my mind is a question - why would you want to do it?
You can use your range parameters simply in an Open SQL query selecting records from the CDS and it will have the same effect. So why complicate the CDS and put the parameters there?
SELECT some_field
FROM my_cds
WHERE some_other_field IN @my_range_parameter
INTO TABLE @DATA(lt_results).However, if you really want to do it, here is a blog on how it can be achieved with a table function: https://blogs.sap.com/2018/03/21/select-options-in-cds-using-table-function/
Kind regards,‎2021 Apr 24 6:16 PM
Hello qw1391202028
First thing that comes to my mind is a question - why would you want to do it?
You can use your range parameters simply in an Open SQL query selecting records from the CDS and it will have the same effect. So why complicate the CDS and put the parameters there?
SELECT some_field
FROM my_cds
WHERE some_other_field IN @my_range_parameter
INTO TABLE @DATA(lt_results).However, if you really want to do it, here is a blog on how it can be achieved with a table function: https://blogs.sap.com/2018/03/21/select-options-in-cds-using-table-function/
Kind regards,‎2021 Apr 28 4:07 AM
hi Mateusz,
Thanks for your replay.
i just think about it.haha
Kind regards.
wei.guo