02-07-2006 10:34 AM
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.
02-07-2006 10:41 AM
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
02-07-2006 10:41 AM
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
02-07-2006 10:51 AM
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.
02-07-2006 11:03 AM
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
02-07-2006 11:07 AM
i guess you are comparing this with the html dropdown box. there is not index concept within ABAP for list box.
Regards
Raja
02-07-2006 10:42 AM
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
02-07-2006 10:45 AM
02-07-2006 10:45 AM
Hi
you can use
default addition in the parameter.
Parameter: p_month like <> default sy-datum+4(2).
regards
kishore
02-07-2006 10:47 AM
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