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

Select-options

Former Member
0 Likes
534

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
513

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.

4 REPLIES 4
Read only

former_member404244
Active Contributor
0 Likes
513

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

Read only

Former Member
0 Likes
513

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

Read only

Former Member
0 Likes
514

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.

Read only

Former Member
0 Likes
513

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