Drop Down list on Selection Screen

*&---------------------------------------------------------------------*
*& Report ZVB_SEL_LISTBOX
*&---------------------------------------------------------------------*
REPORT zvb_sel_listbox.
TYPE-POOLS: vrm.

DATA: name     TYPE vrm_id,
      it_list  TYPE vrm_values,
      iw_value LIKE LINE OF it_list.

PARAMETERS: p_alph AS LISTBOX VISIBLE LENGTH 15.

AT SELECTION-SCREEN OUTPUT.
  name = 'P_ALPH'.
  iw_value-key = 'A'.
  iw_value-text = 'Apple'.
  APPEND iw_value TO it_list.
  iw_value-key = 'B'.
  iw_value-text = 'Bat'.
  APPEND iw_value TO it_list.

* Call the ''VRM_SET_VALUES' to display the values in Listbox
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = name
      values = it_list.

START-OF-SELECTION.
  WRITE: / 'Output:', p_alph.

Result:

 

Comments

Popular posts from this blog

CDS Views: Table Functions with Example

ABAP-Managed Database Procedures (AMDP) with Example

Passing Dynamic Variables to SO10 TEXT