Loop at parameters from selection-screen.
In my report I have three blocks on selection screen, each block has three parameters and one select-option and I am trying to make dynamic SELECT statement with it. I was wondering if I could do something like this:
line(200) type c,
list like table of line(200).
LOOP AT parameters_from_sel_screen.
IF parameter_n is not initial.
CONCATENATE 'field_n =' parameter_n INTO line SEPARATED BY space.
APPEND line to list.
SELECT * FROM table
Thank you in advance for your help.
Eitan Rosenberg replied
I do not see the reasons for not using SELECT-OPTIONS.
You can use NO-EXTENSION and NO INTERVALS and it looks like PARAMETERS .
You can also use function SELECT_OPTIONS_RESTRICT for further customizing .
Do not waste your time on complex code use the KISS principle http://en.wikipedia.org/wiki/KISS_principle