‎2006 Sep 07 3:32 PM
Hi,
I have a requirement where the user is going to pass values in select-option in low and high. lets say s_bwart(movement types).
now i have to fetch this bwart values into an internal table.
my internal table will be having only one field that is bwart. so how do i populate my internal table with those values. could any body help me in this.
Thanks in advance
neha
‎2006 Sep 07 3:34 PM
move s_bwart-low to itab-bwart.
append itab.
move s_bwart-high to itab-bwart.
append itab.
But why move to new table?
‎2006 Sep 07 3:36 PM
hi Neha,
do this way ..
at selection screen.
select bwart from <Table> into table itab where bwart in s_bwart.this way it fetches all the bwart values within the range of s_bwart.
Regards,
Santosh
‎2006 Sep 07 3:38 PM
I think I misunderstood the question. If the user is using your select option to provide a range and you need all values within that range, then use the solution provided by Santosh.
‎2006 Sep 07 3:37 PM
Hi,
start-of selection.
if not b_bwart[] is initial.
loop at s_bwart.
if s_bwart-sign = 'BT'.
itab-bwart = s_bwart-low.
append itab.
itab-bwart = s_bwart-high.
append itab.
else.
itab-bwart = s_bwart-low.
append itab.
endif.
endif.
Regards
Amole
‎2006 Sep 07 3:38 PM
hi Neha,
This can be achieved but why do you want to move all the values between s_bwart-low and high into an internal table. What is the exact requirement? Select-options allows you to choose the value as per your requirement.
Like...
- you can select between low and high.
- you can select two or more distinct values by selecting the arrow and filling the values in the table control. thus the selection only contains the values filled in there.
- you can choose excluing any value... and so on.
select bwart
from <table>
into table itab
where bwart in s_bwart.Regards,
Richa
‎2006 Sep 07 3:39 PM
Hi, when using SELECT-OPTIONS, use can pretty much do any kind of selection he wants, including ranges, and excluding values, so the best way to handle it is to select from the data base when the user executes the report. for example.
data: begin of ibwart occurs 0,
bwart type mseg-bwart,
end of ibwart.
select-options: s_Bwart for mseg-bwart.
start-of-selection.
select bwart into table ibwart
from <b>T156</b>
where bwart in s_bwart.Regards,
Rich Heilman