‎2007 Apr 10 3:05 AM
Hi Experts,
I need to define a Parameter in Selection Screen, like,
P_Finanacila_Year---->shuld hv-->Drop Down peroperty(actually, once I did it by assigning the corresponding field of table to the Selection Screen filed, but now, I forget the Navigation),
So,
How to achieve it(Navigation)?
ThanQ.
‎2007 Apr 10 3:35 AM
Please refer to this demo program,Its self explanatory:
RSDEMO_DROPDOWN_LISTBOX
<b>Award points if it helps.</b>
thanks,
ashish.
‎2007 Apr 10 3:35 AM
Please refer to this demo program,Its self explanatory:
RSDEMO_DROPDOWN_LISTBOX
<b>Award points if it helps.</b>
thanks,
ashish.
‎2007 Apr 10 3:41 AM
hi Srinivas ,
i guess u mean to difine the parameter like a dropdown list whcih you can only get the
value from the list never input , so if that just define the parameter as listbox and that would be fine
ragards.
‎2007 Apr 10 4:05 AM
Hi..
Just paste this code: u will get idea..
<b>report YH642_DROP_DOWN_BOX.
TYPE-POOLS vrm.
**"Table declarations...................................................
*TABLES sscrfields.
*"Table declarations...................................................
PARAMETERS:
p_connid(11) AS LISTBOX
VISIBLE LENGTH 20 default 'FOREX-ANANTH'.
p_value TYPE i MODIF ID QWR.
*" Data declarations...................................................
"----
Work variables *
"----
DATA:
w_char(20) TYPE c,
w_flag TYPE i.
"----
INITIALIZATION. EVENT *
"----
INITIALIZATION.
"----
Internal table to hold delivery header data *
"----
DATA:
t_table TYPE
STANDARD TABLE
OF vrm_value,
vrm_values1 LIKE LINE OF t_table.
vrm_values1-key = 'a'.
vrm_values1-text = 'sap'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = '2'.
vrm_values1-text = 'testing'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = '2'.
vrm_values1-text = 'java'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = '4'.
vrm_values1-text = '.net'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = '5'.
vrm_values1-text = 'vc++'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'che'.
vrm_values1-text = 'chetta-ram'.
APPEND vrm_values1 TO t_table.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'p_connid'
values = t_table
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
.</b>
‎2007 Apr 10 4:05 AM
Hi,
Is it a selction-screen OR a screen you create with SE51 ( screen painter ) because the solution is different in both case.
<b>[1]. Drop-down for Selection-Screen.</b>
PARAMETERS: p_augru LIKE vbak-augru VISIBLE LENGTH 10 AS LISTBOX.This will show order reason values as Drop-down on selection screen. You can use addition <b>VISIBLE LENGTH n AS LISTBOX</b> with any "parameter" you want.
<b>[2]. Drop-down for screen variable created using SE51.</b>
- Display the screen layout using screen painter.
- Switch to change mode
- Double-click the variable you are insterested in having list-box.
- The "field attribute" screen will open.
- On this screen there is a <b>field called "Dropdown".</b> In this field <b>select 'listbox'</b> option.
- Also, if required set the visible length ( Vis. length) field with appropriate length so when the listbox is display, it has enough length to show description.
Let me know if you have any question.
Regards,
RS
‎2007 Apr 10 5:31 AM
ThanQ to all.
Hi RS,
Its Selection Screen, so I used ur first syntax i.e.
<i><b>PARAMETERS: p_augru LIKE vbak-augru VISIBLE LENGTH 10 AS LISTBOX</b></i>
Here(in ur example), I am getting the List Values, when I drop it down the p_augru field!
But, in my case, I am not getting the values i.e. Years. I defined like,
PARAMETERS p_gjahr LIKE bsad-gjahr VISIBLE LENGTH 4 AS LISTBOX.
May I know the reason?
ThanQ.
‎2007 Apr 10 5:44 AM
Hi,
Use the following code:
Decalration on the selection screen:
parameters: p_finyr(4) AS LISTBOX VISIBLE LENGTH 10 DEFAULT '2007'.
AT SELECTION-SCREEN OUTPUT.
PERFORM fill_listbox_p_finyr.
&----
*& Form fill_listbox_p_finyr
&----
text
----
Form fill_listbox_p_finyr.
DATA: lt_list TYPE vrm_values,
ls_value LIKE LINE OF lt_list.
REFRESH: lt_list.
CLEAR: ls_value,
lt_list.
ls_value-key = '2007'.
ls_value-text = '- Current'.
APPEND ls_value TO lt_list.
ls_value-key = '2006'.
ls_value-text = '- Previous'.
APPEND ls_value TO lt_list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_FINYR'
values = lt_list.
ENDFORM. " fill_listbox_p_finyr
‎2007 Apr 10 5:52 AM
Hi Nilesh,
OK, fine.
1- But, I need to display from 1990 till current year, so I need to mention every yaer in the Prog. as u mentioned as 2006 and 2007?
2- We(SAP) dont hv any easy solution(ready-made) for this i.e. Drop Down for Years?
(Actually, once I did by selecting the field in the corresponding table, but now I forget it the naviation!)
Looking for ur thoughts,
Anyways, ThanQ.