Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Loop at parameters from selection-screen.

Hi guys,

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:

DATA:

          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.

          CLEAR line.

     ENDIF.

ENDLOOP.

SELECT * FROM table

WHERE (list).

Thank you in advance for your help.

Tags:
replied

Hi,

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

Regards.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question