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

SELECT-OPTIONS + Drop Down!

Former Member
0 Likes
3,313

HI Experts,

Is it possible to add the feature of Drop Down-List Box to a SELECT-OPTIONS field in selection screen?

1) If so, How it can be achieved?

thanq.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,164

Hi,

It is not possible for select-options. But you can use two parameters instead.

Please check this sample codes.


tables: mara.
type-pools: vrm.
 
ranges: r_matnr for mara-matnr.
 
selection-screen begin of line.
selection-screen comment (10) ff_text.
parameters: p_fld1 type mara-matnr as listbox visible length 20.
selection-screen position 50.
selection-screen comment (10) tf_text.
parameters: p_fld2 type mara-matnr as listbox visible length 20.
selection-screen end of line.
 
initialization.
 
  ff_text = 'From Field'.
  tf_text = 'To Field'.
 
  perform build_user_drop_down_list.
 
start-of-selection.
 
  r_matnr-sign = 'I'.
  r_matnr-option = 'BT'.
  r_matnr-low = p_fld1.
  r_matnr-high = p_fld2.
  append r_matnr.
 
* Now you can use the R_MATNR in a select statement.
 
 
************************************************************************
* build user_drop_down_list
************************************************************************
form build_user_drop_down_list.
 
  data: name type vrm_id,
        list type vrm_values,
        value like line of list.
 
  clear list. refresh list.
 
  clear value.
  value-key = 'MATA'.
  value-text = 'Material A'.
  append value to list.
  clear value.
  value-key = 'MATB'.
  value-text = 'Material B'.
  append value to list.
  clear value.
  value-key = 'MATC'.
  value-text = 'Material C'.
  append value to list.
  clear value.
  value-key = 'MATD'.
  value-text = 'Material D'.
  append value to list.
  clear value.
  value-key = 'MATE'.
  value-text = 'Material E'.
  append value to list.
 
 
* Set the values for P_FLD1
  name = 'P_FLD1'.
  call function 'VRM_SET_VALUES'
       exporting
            id     = name
            values = list.
 
* Set values for P_FLD2
  name = 'P_FLD2'.
  call function 'VRM_SET_VALUES'
       exporting
            id     = name
            values = list.
 
endform.

Regards,

Ferry Lianto

HI Experts,

Is it possible to add the feature of Drop Down-List Box to a SELECT-OPTIONS field in selection screen?

1) If so, How it can be achieved?

thanq.

4 REPLIES 4
Read only

Former Member
0 Likes
1,164

Hi Sridhar,

It is not possible.

as an alternative, you can have two separate Parameters serving as a range.

Once the user enters the vlaues using the drop down, you can move the values in the parameters into a Range and then use it in the select statements:

Check the sample program: DEMO_DROPDOWN_LIST_BOX as a referance.

regards,

Ravi

Read only

Former Member
0 Likes
1,165

Hi,

It is not possible for select-options. But you can use two parameters instead.

Please check this sample codes.


tables: mara.
type-pools: vrm.
 
ranges: r_matnr for mara-matnr.
 
selection-screen begin of line.
selection-screen comment (10) ff_text.
parameters: p_fld1 type mara-matnr as listbox visible length 20.
selection-screen position 50.
selection-screen comment (10) tf_text.
parameters: p_fld2 type mara-matnr as listbox visible length 20.
selection-screen end of line.
 
initialization.
 
  ff_text = 'From Field'.
  tf_text = 'To Field'.
 
  perform build_user_drop_down_list.
 
start-of-selection.
 
  r_matnr-sign = 'I'.
  r_matnr-option = 'BT'.
  r_matnr-low = p_fld1.
  r_matnr-high = p_fld2.
  append r_matnr.
 
* Now you can use the R_MATNR in a select statement.
 
 
************************************************************************
* build user_drop_down_list
************************************************************************
form build_user_drop_down_list.
 
  data: name type vrm_id,
        list type vrm_values,
        value like line of list.
 
  clear list. refresh list.
 
  clear value.
  value-key = 'MATA'.
  value-text = 'Material A'.
  append value to list.
  clear value.
  value-key = 'MATB'.
  value-text = 'Material B'.
  append value to list.
  clear value.
  value-key = 'MATC'.
  value-text = 'Material C'.
  append value to list.
  clear value.
  value-key = 'MATD'.
  value-text = 'Material D'.
  append value to list.
  clear value.
  value-key = 'MATE'.
  value-text = 'Material E'.
  append value to list.
 
 
* Set the values for P_FLD1
  name = 'P_FLD1'.
  call function 'VRM_SET_VALUES'
       exporting
            id     = name
            values = list.
 
* Set values for P_FLD2
  name = 'P_FLD2'.
  call function 'VRM_SET_VALUES'
       exporting
            id     = name
            values = list.
 
endform.

Regards,

Ferry Lianto

Read only

0 Likes
1,164

Looks familiar.

Regards,

RIch Heilman

Read only

0 Likes
1,164

Ahhh yes, here it is......

Regards,

RIch Heilman