REPORT ZDROPDOWNLIST .
types: begin of t_vbap,
posnr type vbap-posnr,
end of t_vbap.
data: it_vbap TYPE STANDARD TABLE OF t_vbap,
wa_vbap like line of it_vbap.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
""""""""""""
PARAMETERS: SO_NUM like vbap-vbeln.
""""""""""""
PARAMETERS: P_POSNR(10) AS LISTBOX VISIBLE LENGTH 10.
*********************************************************
*AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
clear list.
SELECT posnr
up to 10 rows
into CORRESPONDING FIELDS OF TABLE it_vbap
from vbap
where
vbeln = SO_NUM.
loop at it_vbap into wa_vbap.
VALUE-KEY = wa_vbap-posnr.
VALUE-TEXT = wa_vbap-posnr.
APPEND VALUE TO LIST.
endloop.
NAME = 'P_POSNR'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
*clear list.
********************************************************
*START-OF-SELECTION.
START-OF-SELECTION.
WRITE: / 'SELECTED VALUE KEY:', SO_NUM.
types: begin of t_vbap,
posnr type vbap-posnr,
end of t_vbap.
data: it_vbap TYPE STANDARD TABLE OF t_vbap,
wa_vbap like line of it_vbap.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
""""""""""""
PARAMETERS: SO_NUM like vbap-vbeln.
""""""""""""
PARAMETERS: P_POSNR(10) AS LISTBOX VISIBLE LENGTH 10.
*********************************************************
*AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
clear list.
SELECT posnr
up to 10 rows
into CORRESPONDING FIELDS OF TABLE it_vbap
from vbap
where
vbeln = SO_NUM.
loop at it_vbap into wa_vbap.
VALUE-KEY = wa_vbap-posnr.
VALUE-TEXT = wa_vbap-posnr.
APPEND VALUE TO LIST.
endloop.
NAME = 'P_POSNR'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
*clear list.
********************************************************
*START-OF-SELECTION.
START-OF-SELECTION.
WRITE: / 'SELECTED VALUE KEY:', SO_NUM.