REPORT ZARJUN_LISTBOX .
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST,
c(20) type c.
data:begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.
data:begin of jtab occurs 0,
kunnr like kna1-kunnr,
land1 like kna1-land1,
end of jtab.
PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
default 'SELECT'.
AT SELECTION-SCREEN OUTPUT.
NAME = 'p_list'.
VALUE-KEY = '1'.
VALUE-TEXT = 'Name'.
APPEND VALUE TO LIST.
VALUE-KEY = '2'.
VALUE-TEXT = 'Country'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
start-of-selection. select kunnr name1 up to 20 rows from kna1 into table itab. select
kunnr land1 up to 20 rows from kna1 into table jtab.
case p_list.
when '1'.
loop at itab.
write:/ itab-kunnr,itab-name1.
endloop.
when '2'.
loop at jtab.
write:/ jtab-kunnr,jtab-land1.
endloop.
endcase.
Social Plugin