Skip to Content
avatar image
Former Member

SELECT-OPTIONS + Drop Down!

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 04, 2007 at 05:54 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 04, 2007 at 05:53 PM

    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

    Add comment
    10|10000 characters needed characters exceeded