Dropdown list in selection-screen

Dropdown list in selection-screen

Sample code :


  PARAMETERS : p_field TYPE ztype AS LISTBOX VISIBLE LENGTH 25.
* If the  ZTYPE has a domain with values, values will be autmatically
* displayed.

If your type has no values in domain or if you want to change the dropdown list values use FM VRM_SET_VALUES in initialization:


FORM initialization .

  DATA: lt_dropdown_list TYPE vrm_values.

  lt_dropdown_list = VALUE #( ( key = '1'  text   = 'Value 1' )
                              ( key = '2'  text   = 'Value 2' )
                              ( key = '3'  text   = 'Value 3' ) ).

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = 'P_FIELD'
      values          = lt_dropdown_list
    EXCEPTIONS
      id_illegal_name = 1
      OTHERS          = 2.

ENDFORM.

About the author

fjourneau administrator

Hi, I'm Florian Journeau, SAP ABAP R3 Freelance, based in Toulouse, France. You want to know more about me, have a look on my CV : cv.fjourneau.net.

Leave a Reply