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: 

Selection option on Year field with List

Former Member
0 Kudos
1,174

Hello,

We need to create Selection option on Year field with List as 2016(default current year), 2015, 2014,....2000, 1999 etc.

List with 20 options to select.

We found list box as one option, but for this we will need to initialize it for 20 times, which increases size of code.

Please suggest if there is any other option for this.

Regads,

7 REPLIES 7

former_member190321
Participant
0 Kudos
301

Hi,

Try this code

select-options year for sy-datum(4) default sy-datum+0(4).

Former Member
0 Kudos
301

Please provide some more detail. Do you want to set initial values of year select option field as 2016, 2015 ...... 1999 etc ?

Thanks,

Prakash

0 Kudos
301

Yes, correct

2016 --> Default will be sy-datum+0(4).

2015

2014

.

.

.

2001

2000

1999

0 Kudos
301

There are two options:1

1. Create a dropdown list ( which will make the code bit longer)

2. Create and store the years in a table and create a search help for the year field

former_member196331
Active Contributor
0 Kudos
301

Question is Not clear. You don't want to maintain 20? You want to maintain dynamic.

Save years in one table then

in select options values fetching from

'F4IF_INT_TABLE_VALUE_REQUEST'

Check it forum. Values coming from the Query And adding to the Selection screen field F4.

Else.

Explain it clearly.

Former Member
0 Kudos
301

Hello All,

sorry if my doubt is not enough clear

I would like to have selection option list for field 'YEAR' with around 15 to 20 options in order as

2016 --> Default will be sy-datum+0(4).

2015

2014

.

.

.

2001

2000

1999

I don't want to use list box for this. Please guide if there is any other better option

Regards,

0 Kudos
301

Do you want a listbox without code to fill it (no VRM_SET_VALUES) so you need some ddic information.

You could create a domain (type DATS) with a table of values (just one field/data element on this domain) and create a small report that refresh/intiialize the value list at new year {or do it manually thru SE16[n] or SM30}

Or create a search help (with user exit) that provide this list. so attaching it to the parameter/field with the option list_box should do the trick?


we will need to initialize it for 20 times, which increases size of code.

You need at most 16-17 lines of code, data definition included...

Regards,
Raymond