‎2011 Mar 02 2:50 PM
Hello,
I have a problem implementing a SELECT-Statement. I have a generic number of select options on my selection screen and I have a range table for each select option. How can a generate a database select for these generic number of range tables?
Thank you very much in advance & regards,
Alexander
‎2011 Mar 02 2:59 PM
your select statement would include a line in the WHERE clause for each ranges table:
where....
fieldname IN ranges-table....
If the ranges table is empty, SAP will interpret as select all, not select none... read your documentation on select-options.
‎2011 Mar 02 3:01 PM
‎2011 Mar 02 3:36 PM
Thanks! The FM 'FVD_SELECT_OPTIONS_2_WHERE' seems to be the perfect one for my needs. But how can I set the import parameters, they are not in the dictionary. Thank you!
‎2011 Mar 03 7:24 AM
‎2011 Mar 02 3:08 PM
Thanks for your answers! The thing is, that I don't know how many range table are relevant for the WHERE clause. The number of range tables is generic, so I can't built a where clause with the IN statement. How can I concatenate these generic number of range tables? I have to use a parameter in the where clause which refers to every single range table? Do you know what I mean?
Thanks!
‎2011 Mar 02 3:14 PM
the answer I gave you will work if you have a ranges table for every possible select-options and refer to every ranges table in your where clause.... that way, you don't have to know which are populated and which are not at the time of SELECT.
You could also choose to create a dynamic where clause, based upon what you had select-options for and use with
WHERE ( whereclause ).
Edited by: BreakPoint on Mar 2, 2011 4:31 PM
‎2011 Mar 02 3:25 PM