Creating a Drop Down in ALV
There are requirement when you have to give drop down in alv report as input .
So i am sharing sample code for this input field
TYPE-POOLS: vrm. "declare along with sliss
*-----selection screen add this code for list box-----------------------*
PARAMETERS : p_days(10) AS LISTBOX VISIBLE LENGTH 10.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
AT SELECTION-SCREEN OUTPUT.
list TYPE vrm_values,
value LIKE LINE OF list.
AT SELECTION-SCREEN OUTPUT.
name = 'P_DAYS'.
REFRESH : LIST.
value-key = '1'.
value-text = '1 Days'.
APPEND value TO list.
value-key = '2'.
value-text = '2 Days'.
APPEND value TO list.
value-key = '3'.
value-text = '3 Days'.
APPEND value TO list.
value-key = '4'.
value-text = '4 Days'.
APPEND value TO list.
value-key = '5'.
value-text = '5 Days'.
APPEND value TO list.
value-key = '6'.
value-text = '6 Days'.
APPEND value TO list.
value-key = '7'.
value-text = '7 Days'.
APPEND value TO list.
value-key = '8'.
value-text = '8 Days'.
APPEND value TO list.
value-key = '9'.
value-text = '9 Days'.
APPEND value TO list.
value-key = '10'.
value-text = '10 Days'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = name values = list.
REFRESH : LIST.
value-key = '1'.
value-text = '1 Days'.
APPEND value TO list.
value-key = '2'.
value-text = '2 Days'.
APPEND value TO list.
value-key = '3'.
value-text = '3 Days'.
APPEND value TO list.
value-key = '4'.
value-text = '4 Days'.
APPEND value TO list.
value-key = '5'.
value-text = '5 Days'.
APPEND value TO list.
value-key = '6'.
value-text = '6 Days'.
APPEND value TO list.
value-key = '7'.
value-text = '7 Days'.
APPEND value TO list.
value-key = '8'.
value-text = '8 Days'.
APPEND value TO list.
value-key = '9'.
value-text = '9 Days'.
APPEND value TO list.
value-key = '10'.
value-text = '10 Days'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = name values = list.