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-options

Former Member
0 Kudos

hi,

may i know how to assign the select-options data to itab if user enter the range as well as single val or also with exclude single val or exclude ranges.

if i use like this it will also get the low and high in the selection screen.

this is using ranges. but i need to store werks only in normal itab.

v_werks-sign = 'I'.

v_werks-option = 'EQ'.

v_werks-low = sdwerk-low.

v_werks-high = sdwerk-high.

append v_werks.

v_werks-sign = 'I'.

v_werks-option = 'BT'.

v_werks-low = sdwerk-low.

v_werks-high = sdwerk-high.

append v_werks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

The select-options itself is an internal table format, if u see in debugging mode u can understand.

v_werks[] = s_werks[].

All the values will get moved into the itab u want.

6 REPLIES 6

Former Member
0 Kudos

Hi,

The select-options itself is an internal table format, if u see in debugging mode u can understand.

v_werks[] = s_werks[].

All the values will get moved into the itab u want.

0 Kudos
tables: t001w.
select-options: s_werks for t001w-werks.
types: begin of ty_werks,
werks type t001w-werks,
end of ty_werks.
data: wa_werks type ty_werks.
data: lt_werks type ty_werks.

loop at s_werks where option = 'EQ' and sign ='I'.
wa_werks-werks = s_werks-low.
append wa_werks to lt_werks
endloop.

Former Member
0 Kudos

Hi,

Sorry i am not clear with what is your exact requirement.

Please clarify a bit more.

Regards

Arun

Former Member
0 Kudos

Say you have defined Select-option as 'sdwerk' for plant.

To include all the Plants in the entered selection into one internal table use below code:

DATA: begin of i_werks occurs 0,

werks like t001w-werks,

end of i_werks.

SELECT werks INTO table i_werks FROM T001W WHERE werks IN sdwerk.

Internal table sdwerk will have all the entered plants now.

Thanks

Former Member
0 Kudos

loop at sdwerk.

if not sdwerk-low is initial.

itab-werks = sdwerk-low.

append itab.

endif.

if not sdwerk-high is initial.

itab-werks = sdwerk-high.

append itab.

endif.

endloop.

Former Member
0 Kudos

thanks to all especially rahul.