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: 

Display month and year in dropdown list on selection screen

Former Member
0 Kudos
1,999

Hi

Can anyone tell me how to display months and year in a dropdown list on a selection screen?

also please tell me how to get the first and the last dates upon selecting the month and year on the dropdown list.

Month: January Year:2007 .

After selecting the required month and year, the first date and last date i.e '01.01.2007 - 31.01.2007' should be displayed on the right side.

Reward Points assured..

thanks,

Chetan

6 REPLIES 6

Former Member
0 Kudos
351

Hi..,

<b>

Just copy, paste and execute this program !!</b>

type-pools: vrm.

parameters : p_month(2) type n as listbox visible length 10,

p_year(4) type n as listbox visible length 10.

DATA : W_DATE type d, w_ldate type d.

initialization.

perform user_drop_down_list_fordt.

perform user_drop_down_list_foryr.

start-of-selection.

concatenate p_year p_month '01' into w_date.

call function 'BKK_GET_MONTH_LASTDAY'

exporting

i_date = w_date

IMPORTING

E_DATE = w_ldate

.

write /: w_date,w_ldate.

  • build user_drop_down_list

form user_drop_down_list_fordt.

data: name type vrm_id,

list type vrm_values,

value like line of list.

data: t_months type t247 occurs 0 with header line.

clear list. refresh list.

name = 'P_MONTH'.

select * into table t_months

from t247 where spras eq 'EN'.

sort t_months ascending by mnr.

loop at t_months.

clear value.

value-key = t_months-mnr.

value-text = t_months-ltx.

append value to list.

endloop.

  • Set the values

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

endform.

  • for year...

form user_drop_down_list_foryr.

data: name type vrm_id,

list type vrm_values,

value like line of list.

clear list. refresh list.

name = 'P_YEAR'.

do 9999 times.

clear value.

value-key = sy-index.

append value to list.

enddo.

  • Set the values

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

endform.

<b>

Hope this solves ur problem..</b>

regards,

sai ramesh

0 Kudos
351

Thanks a lot lot..

0 Kudos
351

Thanks a lot lot..

0 Kudos
351

Thanks a lot lot..

0 Kudos
351

Hi..,

you need to reward points for helpful answers to encourage people to answer more questions !!

regards,

sai ramesh

0 Kudos
351

Hi

What I can must do it, when I want to event when I change a month or year in Drop Down List?

Thank you