Application Development 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: 

Select statement for generic select options

0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

Are you asking for

- use range in select : [WHERE - IN seltab|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_SELTAB.htm]

- tool like FVD_SELECT_OPTIONS_2_WHERE, COM_CONVERT_SELECT_INTO_WHERE or similar FM (se37, f4)

Regards,

Raymond

0 Kudos

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!

0 Kudos

Can you describe the structure of your "generic select-options" ?

0 Kudos

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!

0 Kudos

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

Former Member
0 Kudos

What have you coded so far?

Rob