‎2008 Feb 13 7:51 AM
Hi friends ,
i have given select-options for the year in the selection-screen.
If particular range is given i want to get all the years in between that range.Beacuse i will include that year in my record of internal table n modify it.Kindly tell me how to get all the years between the range given in the selection-screen
Thanks in advnce
‎2008 Feb 13 8:08 AM
premraj,
SELECT-OPTIONS : s_year LIKE ...........
AT SELECTION-SCREEN.
IF s_year-low LE s_year-high.
MOVE : s_year-low TO itab-year.
APPEND YEAR.
s_year-low = s_year-low + 1.
ENDIF.
Don't forget to reward if useful.
‎2008 Feb 13 7:59 AM
Hi,
Once u speify the select-options u will get the range of values for the year...
if u give year between 2002 and 2008 ,u will get 2003,2004,2005,2006,207 along with 2002 and 2008..
Regards,
Nagaraj
‎2008 Feb 13 8:04 AM
hey nagraj,
i know that i will get the range but in the Selection options table
the fields will be sign,between,low n hign right.but i want all the years explicitly in that range so that i will use that year and append my table
thanks
sunitha.p
‎2008 Feb 13 8:08 AM
premraj,
SELECT-OPTIONS : s_year LIKE ...........
AT SELECTION-SCREEN.
IF s_year-low LE s_year-high.
MOVE : s_year-low TO itab-year.
APPEND YEAR.
s_year-low = s_year-low + 1.
ENDIF.
Don't forget to reward if useful.
‎2008 Feb 13 8:16 AM
Hi PremRaj,
Basically we used selection option to run the command while selection data from Data Base. if you required for that then not to worry it automatically taken that range.
Instead of this if you want to use this range in your program then I suggesu the following way.
select-option S_mblnr type mseg-mblnr.
type : begin of tp_mseg,
mblnr type mseg-mblnr,
endof tp_mseg,
Data : t_mseg type table of t_mseg,
wa_mseg type wa_mseg.
At Selection-screen.
Data :wa_str type mseg-mblnr.
data : wa_tmp type mseg-mblnr.
wa_Str = s_mblnr-high - s_mblnr-low.
wa_tmp = s_mblnr-low.
do wa_str times.
t_mseg-mblnr = wa_tmp.
wa_tmp = wa_tmp + 1.
append t_mseg.
enddo.
hope ti help you.
Regards
Swati