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: 

Index of Values in the List Boxes on a Selection Screen

Former Member
0 Kudos

Hi,

I have a list box on the selection screen for Month field. It has the values Jan, Feb, Mar....etc in it.

These entries, I added thru the VRM_SET_VALUES.

Now, I want to default the month to current month SY-DATUM+4(2).

Is there any FM to which I can send this SY-DATUM+4(2) as an Index and the corresponding value gets set for the Month field.

As an alternatvie, I could use<b> Case Sy-DATUM+4(2). when '01'. p_month = 'Jan'. etc etc..</b> But I want to avoid this big case statement.

Please suggest.

Thanks,

Suryakiran D.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Suryakiran,

Try to use the func <b>MONTH_NAMES_GET</b>.It will

return the month name along with the number.

And also you can directly select from table <b>T247</b>

Thanks&Regards,

Siri.

Message was edited by: Srilatha T

8 REPLIES 8

Former Member
0 Kudos

Hi Suryakiran,

Try to use the func <b>MONTH_NAMES_GET</b>.It will

return the month name along with the number.

And also you can directly select from table <b>T247</b>

Thanks&Regards,

Siri.

Message was edited by: Srilatha T

0 Kudos

Thanks,

Since this is months, I could get the data from T247. This solves my issue for now. But what if the values in the list box are generic values? I just wanted to know if there is any INDEX concept so that I can straight away set the value of the List box based on the Index.

Regards,

Suryakiran D.

0 Kudos

Hi

I can't understand your problem if you know the data using in the listbox you should know how to get out the value for a certain index.

Anyway you can use VRM_GET_VALUES to get out all value setted for a certain input fields.

Max

0 Kudos

i guess you are comparing this with the html dropdown box. there is not index concept within ABAP for list box.

Regards

Raja

Former Member
0 Kudos

Hi

When you transfer the data to fm VRM_SET_VALUES you need to fill a table (type VRM_VALUES), why don't you declare this table as global data, in this way you can read it to find out the value you need.

data: wa TYPE vrm_value.

READ TABLE values INTO WA WITH KEY key = SY-DATUM+4(2).

.....

Max

Lakshmant1
Active Contributor
0 Kudos

Hi Suryakiran,

Check FM POPUP_TO_SELECT_MONTH

Thanks

Lakshman

Former Member
0 Kudos

Hi

you can use

default addition in the parameter.

Parameter: p_month like <> default sy-datum+4(2).

regards

kishore

athavanraja
Active Contributor
0 Kudos

in the initializtion event write the following code.

initialization .

data: wa type T247 .

select single * from T247 into wa where spras eq s-langu and mnr eq sy-datum+4(2) .

<parameter name of list box> = wa-ktx .

Regards

Raja