‎2006 Nov 23 3:25 AM
Hi all,
I have a requirement in which i need to display a drop down list box for some of the fields in the input selection screen like 1) status to be A) Yes b) No and the 2) Order field to be A) Not started B) In Progress C) Complete....
So i need any one of you please help me out to write the code for the above requirement, hope iam clear in my question and if possible please try give me some example code thanks in advance.
‎2006 Nov 23 3:28 AM
use the function moduel VRM_SET_VALUES
type-pools VRM.
data: NAME type VRM_ID,
LIST type VRM_VALUES,
VALUE like line of LIST.
NAME = <FIELD NAME>. (selection scrren parameter field)
VALUE-KEY = 'YES'.
VALUE-TEXT = 'Yes'.
append VALUE to LIST.
VALUE-KEY = 'NO'.
VALUE-TEXT = 'No'.
append VALUE to LIST.
call function 'VRM_SET_VALUES'
exporting
ID = NAME
VALUES = LIST.
clear LIST.
Regards
- Gopi
‎2006 Nov 23 3:36 AM
Hi Gopi,
Thanks for replying Can we do it for even Select-options,my requirement is for Select-options if possible please try to send me.
‎2006 Nov 23 3:38 AM
No it cant be done select options it can be used only for paremeters
Regards
- Gopi
‎2006 Nov 23 3:30 AM
Hi,
Check this sample code..
TYPE-POOLS: vrm.
PARAMETERS: p_test TYPE char4 AS LISTBOX VISIBLE LENGTH 10.
DATA: t_data TYPE vrm_values.
INITIALIZATION.
DATA: s_data TYPE vrm_value.
s_data-key = 'ABCD'.
s_data-text = 'First four'.
APPEND s_data TO t_data.
s_data-key = 'EFGHI'.
s_data-text = 'Second four'.
APPEND s_data TO t_data.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_TEST'
values = t_data
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
START-OF-SELECTION.
WRITE: / p_test.
Thanks,
Naren
‎2006 Nov 23 3:37 AM
Hi Naren,
Thanks for your reply, i need some clarification like can we do the same for select-options if so please help me in this regard.
‎2006 Nov 23 11:19 AM
hi Madhan,
You cannot use select-options it works for parameters only ...
Regards,
Santosh
‎2006 Nov 23 6:53 AM
No..
It can be done only for parameters and not for select-options..
THanks
Naren
‎2006 Nov 23 11:20 AM
hi,
Check the link to know how to populate values as a LIST(drop down list)
here is the sample piece of code,
PROGRAM zlist.
TYPE-POOLS : VRM.
DATA: param TYPE vrm_id,
values TYPE vrm_values,
value LIKE LINE OF values.
PARAMETERS: p_name(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT.
param = 'P_NAME'.
value-key = '1'.
value-text = 'NAME1'.
APPEND value TO values.
value-key = '2'.
value-text = 'NAME2'.
APPEND value TO values.
*--and so onnn
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = param
values = values.Rgsd
Anver