Application Development and Automation 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: 
Read only

drop down box in selection screen

Former Member
0 Likes
5,272

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.

8 REPLIES 8
Read only

gopi_narendra
Active Contributor
0 Likes
882

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

Read only

0 Likes
882

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.

Read only

0 Likes
882

No it cant be done select options it can be used only for paremeters

Regards

- Gopi

Read only

Former Member
0 Likes
882

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

Read only

0 Likes
882

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.

Read only

0 Likes
882

hi Madhan,

You cannot use select-options it works for parameters only ...

Regards,

Santosh

Read only

Former Member
0 Likes
882

No..

It can be done only for parameters and not for select-options..

THanks

Naren

Read only

anversha_s
Active Contributor
0 Likes
882

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