top of page
blank.png
Search
Writer's pictureSmart Logic Academy

ABAP tricks #9/100: 🤔 Is it possible to use Select-Options with CDS View?

SELECT-OPTIONS is not an SQL feature, it's an ABAP ( or OPEN SQL ) feature that the SQLScript does not understand. So, thinking of pushing this Select-Options variable directly to the DB layer is not possible.



The only filtering technique SQLScript can understand is using a WHERE clause. If we can convert these options into a WHERE clause understood by SQLScript, we can execute it dynamically in the DB layer.



Workaround:


  1. Conversion of the selection tables into an SQL WHERE clause using method CL_SHDB_SELTAB=>COMBINE_SELTABS( ).


  2. Handling of dynamic WHERE clauses within the AMDP method using the SQL script function APPLY_FILTER to apply the selection criteria.




Please share with your ABAP friends and follow us.

If you want to dive deeper, visit our course https://lnkd.in/daTqKQFV



33 views0 comments

Comentarios


bottom of page