‎2008 Jan 28 12:10 PM
ive appended the key-value set into listbox as:
select * from zda_sntype into table lt_zda_sntype.
name = 'PS_PARM'.
loop at lt_zda_sntype into wa_zda_sntype.
value-key = wa_zda_sntype-santyp.
value-text = wa_zda_sntype-txt30.
append value to list.
endloop.
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
lst_flg = 1.
endif.
IM USING DIALOG MODULE.....
HOW TO GET THE SELECTED VALUE, At runtime....????
In dialog module.........
‎2008 Jan 28 12:20 PM
the value you selected will store into the variable that you declared as listbox
for eg :
see this code
PARAMETERS: division AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND fcode.
AT SELECTION-SCREEN OUTPUT.
TYPE-POOLS: vrm. " For parameter drop down lists
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
name = dropdown_param.
value-key = 'S'.
value-text = 'Sheets'.
APPEND value TO list.
value-key = 'B'.
value-text = 'Blocks'.
APPEND value TO list.
value-key = 'P'.
value-text = 'Panels'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
START-OF-SELECTION.
IF division = 'S'.
WRITE : 'Sheets Division'.
ENDIF.
IF division = 'P'.
WRITE : 'Panels Division'.
ENDIF.
so we can compare the input by 'divison' in this case.
Hope its Useful ...
‎2008 Jan 28 12:19 PM
Hi Vishal,
U r using a list box in module pool,right..
If it so u can use search and select the list box..Its simple to do tht.From tht we can easily retrieve the value..
In thelayout u select a field from dictionary.If it is already having search help means no problem..U only want to select the listbox type..
Otherwise u want to put search help for tht field.It willbe very simple comparing to tht
reward if useful
‎2008 Jan 28 12:24 PM
Hi,
I think you can simply get the value in PAI.
Once user selected a value then in PAI your field 'NAME' should have the selected value.
‎2008 Jan 28 12:20 PM
the value you selected will store into the variable that you declared as listbox
for eg :
see this code
PARAMETERS: division AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND fcode.
AT SELECTION-SCREEN OUTPUT.
TYPE-POOLS: vrm. " For parameter drop down lists
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
name = dropdown_param.
value-key = 'S'.
value-text = 'Sheets'.
APPEND value TO list.
value-key = 'B'.
value-text = 'Blocks'.
APPEND value TO list.
value-key = 'P'.
value-text = 'Panels'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
START-OF-SELECTION.
IF division = 'S'.
WRITE : 'Sheets Division'.
ENDIF.
IF division = 'P'.
WRITE : 'Panels Division'.
ENDIF.
so we can compare the input by 'divison' in this case.
Hope its Useful ...
‎2008 Jan 28 12:26 PM
Hi,
In the screen layout editor set the field type as list box.
Then write the code u gave above in a PBO Module.
Specify the name as the screen field name.
Regards,
Renjith Michael.
‎2008 Jan 28 12:26 PM
‎2008 Jan 28 12:32 PM
hi
good
check this code ,hope this would help you to solve your problem.
REPORT ZLIST.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT.
NAME = 'PS_PARM'.
VALUE-KEY = '1'.
VALUE-TEXT = 'LINE 1'.
APPEND VALUE TO LIST. VALUE-KEY = '2'.
VALUE-TEXT = 'LINE 2'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
START-OF-SELECTION.
WRITE: / 'PARAMETER:', PS_PARM.
thanks
mrutyun^