Application Development and Automation 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: 
Read only

Check All select-options NOT initial ?

former_member194669
Active Contributor
0 Likes
1,980

All,

I have report with 269 fields select-options inputs. I need to check any select-options have any value or not.

I know each select-option have is initial or not

For example


if not s_matnr[] is initial

I do not want to check each input field as initial or not.

Any other easy way do this ?

All,

I have report with 269 fields select-options inputs. I need to check any select-options have any value or not.

I know each select-option have is initial or not

For example


if not s_matnr[] is initial

I do not want to check each input field as initial or not.

Any other easy way do this ?

4 REPLIES 4
Read only

former_member194669
Active Contributor
0 Likes
1,300

Solved


  call function 'RS_REFRESH_FROM_SELECTOPTIONS'
    exporting
      curr_report     = v_program
    tables
      selection_table = i_seltab
    exceptions
      not_found       = 1
      no_report       = 2.
loop at i_seltab.
   if not i_seltab-low is initial.
    v_not_initial = c_x.
   endif.
endloop.

Read only

Former Member
0 Likes
1,300

Hi,

you can do that in two ways,

firstly use OBLIGATORY Addition with the select-option declaration

DATA w_c TYPE char20.
SELECT-OPTIONS : s_matnr FOR w_c OBLIGATORY.

OR Use this method using field-symbols.........

DATA w_c TYPE char20.
SELECT-OPTIONS : s_matnr FOR w_c.

FIELD-SYMBOLS: <fs> TYPE ANY.
DATA w_string TYPE string.

AT SELECTION-SCREEN.
  LOOP AT SCREEN.
    IF screen-name CS '-LOW'.
      w_string = screen-name.
      REPLACE '-LOW' IN w_string WITH space.
      ASSIGN (w_string) TO <fs>.
      IF <fs> IS ASSIGNED.
        IF <fs> IS INITIAL.
          " WRITE YOUR LOGIC...........
        ELSE.
          " WRITE YOUR LOGIC...........
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.

Regards,

Siddarth

Read only

0 Likes
1,300

Siddarth,

Yes this will also work.

but Loop at screen will not work in start-of-selection.

Read only

0 Likes
1,300

Ah!!!!

I thought you wanted that in AT Selection-screen itself.... anyways nice solution using the FM... thanks