2009 Mar 17 10:06 AM
Please don't have a subject in ALL CAPITALS. I've changed it for you this time.
Hi,
I want to read values in a select-options one by one because I need to pass all the data between low and high.
Thanks a lot.
Sandra.
Edited by: Matt on Mar 17, 2009 11:10 AM
2009 Mar 17 10:16 AM
The select-options is for a date so I don't know which table I can use, but thank you all!
2009 Mar 17 10:10 AM
Select option is just like internal table. so as u read itab u can also read it
loop at select_option name.
read select option name index sy-tabix.
endloop.Edited by: tahir naqqash on Mar 17, 2009 3:10 PM
2009 Mar 17 10:11 AM
If u want to use select statement with slect option specify the condition in where as IN s_option it will work for each value seperately,
If u want sinle values one by loop at it.
try like this.
data: wa like line of s_options.
loop at s_options into wa.
"use wa value here wa-low but this will only give values of multiple selection
"to get values between low and high use *IN*
endloop.кu03B1ятu03B9к
Edited by: kartik tarla on Mar 17, 2009 3:42 PM
Edited by: kartik tarla on Mar 17, 2009 3:42 PM
2009 Mar 17 10:12 AM
Ex:
Loop at so_date.
date1 = so_date-low.
endloop.
if u need the other interval. then so_date-high.
2009 Mar 17 10:12 AM
Select options don't contain the values one by one. So, you have to do a select from the appropriate table. So, if your select options is for MATNR, then you'd have to do
SELECT matnr FROM mara INTO TABLE lt_matnr WHERE matnr IN s_matnr.
matt
2009 Mar 17 10:12 AM
I know that, but in that internal table I only have low and high and I want to pass all values between them.
Thanks.
2009 Mar 17 10:16 AM
then use
select * from pa0001
where
pernr in sel_option.
" When u use IN SEL_OPTION , it will consider all values in select option
.
Edited by: tahir naqqash on Mar 17, 2009 3:17 PM
2009 Mar 17 10:16 AM
i think u need to loop and check values between do endo.
like
v_var = s_option-low.
DO.
"use v_var.
"increment it.
if v_var > s_option-high.
exit.
else.
"use the value
endif.
enddo.
кu03B1ятu03B9к
Edited by: kartik tarla on Mar 17, 2009 3:46 PM
2009 Mar 17 10:23 AM
Hi,
When you use statement:
SELECT-OPTIONS : s_datum FOR sy-datum.
Then this creates an internal table s_datum with four fields sign, option, low, high.
So if you write
low value as:
sy-datum - 4
and high value as:
sy-datum
Then a single row is appended to s_datum as:
sign : I
option : BT
low value : sy-datum - 4
high value : sy-datum
So it will automatically take all values between the low and high values.
Hope this helps you.
Regards,
Tarun
2009 Mar 17 10:16 AM
The select-options is for a date so I don't know which table I can use, but thank you all!
2009 Mar 17 10:24 AM
>
> The select-options is for a date so I don't know which table I can use, but thank you all!
You can't use a table. Do it like this:
l_dat = s_dat-low.
WHILE l_dat LE s_dat-high.
WRITE / l_dat.
ADD 1 TO l_dat.
ENDWHILEHowever, if the user decides to use a pattern, or exclusions, it can get problematic. Usually, therefore, for date selections, I use two parameters - one for the start date, one for the end, rather than select-options.
matt
2009 Mar 17 10:16 AM
SELECT-OPTIONS system implicitly creates the select options internal table which contains the fields of SIGN,OPTION,LOW & HIGH.
2009 Mar 17 10:20 AM
2009 Mar 17 10:26 AM
Select-options: s_date for sy-datum.
data: cnt type i,
diff type i,
G_date type sy-datum.
diff = s_date-high - s_date-low
do diff times.
G_date = s_date-low + cnt.
write: / G_date.
cnt = cnt + 1.
endloop.
2009 Mar 17 10:28 AM
Hi Sandra,
You can't use a table for date select-options.
Best Regards,
Sayak