‎2007 Mar 09 2:50 PM
I have listbox DD1 and I populated that with SPFLI-CITYFROM data. I used SELECT DISTINCT statement so that it will not repeat same entry on my list box. It was successful but then on the 2nd time and on the succeeding times you click on the listbox (trying to select other item), the listbox shows all the city entries from the SPFLI-CITYFROM. The SELECT DISTINCT takes effect only at first because as I have said on the 2nd and succeeding times you click the listbox, it will show you all entries of SPFLI-CITYFROM data. why is that? i dont understand.
im sorry if i sound so dumb. im a newbie. big thanks to all.
_________________________________
TYPE-POOLS: VRM.
DATA: VALUE TYPE VRM_VALUES WITH HEADER LINE.
DATA: DD1(20).
DATA: INT_SPFLI TYPE STANDARD TABLE OF SPFLI WITH HEADER LINE.
SELECT DISTINCT CITYFROM FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE INT_SPFLI.
START-OF-SELECTION.
SET SCREEN 100.
MODULE PBO OUTPUT.
LOOP AT INT_SPFLI.
VALUE-KEY = INT_SPFLI-CITYFROM.
APPEND VALUE.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'DD1'
VALUES = VALUE[].
ENDMODULE.
MODULE PAI INPUT.
CASE SY-UCOMM.
WHEN 'BTNEXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
‎2007 Mar 09 2:59 PM
‎2007 Mar 09 2:55 PM
Hello Jack,
Put he select
SELECT DISTINCT CITYFROM FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE INT_SPFLI.
In the PBO of the screen,,
Vasanth
‎2007 Mar 09 3:02 PM
I put it on the MODULE PBO OUTPUT but still the same. =(
thanks for the reply <b>Vasanth.</b> I appreciate it.
‎2007 Mar 09 3:07 PM
Actually if we want to be efficient, you should only get the data and build the value table once in the start of the program.
report zrich_0001.
type-pools: vrm.
data: value type vrm_values with header line.
data: dd1(20).
data: int_spfli type standard table of spfli with header line.
initialization.
select distinct cityfrom from spfli
into corresponding fields of table int_spfli.
loop at int_spfli.
value-key = int_spfli-cityfrom.
append value.
endloop.
start-of-selection.
set screen 100.
module pbo output.
call function 'VRM_SET_VALUES'
exporting
id = 'DD1'
values = value[].
endmodule.
module pai input.
case sy-ucomm.
when 'BTNEXIT'.
leave program.
endcase.
endmodule.
Regards,
Rich Heilman
‎2007 Mar 09 2:59 PM
Refresh the table before selecting
<b>REFRESH INT_SPFLI.
clear INT_SPFLI.</b>
SELECT DISTINCT CITYFROM FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE INT_SPFLI.
‎2007 Mar 09 2:59 PM
‎2007 Mar 09 3:10 PM
thanks <b>Rich Heilman</b>. it solved my issue!
thanks also to <b>Chandrasekhar</b>. I appreciate your effort.
<b>thanks guys! </b> 😃