I have been searching for the solution for my small problem..So I hope this question hasn`t been asked before.
I have an ALV grid in a pop up display using 'REUSE_ALV_GRID_DISPLAY'.
I have an input field on my screen that helps me display only certain keys on my alv grid.
When I input for example key 2 it shows all the correct products for that key 2.
When I try to enter another key....it shows the correct products but each column is duplicated. So each time I input something and hit 'Show' each column in that table is duplicated again.
Tried REFRESH, CLEAR my internal table....but I haven`t been able to make it work.
Did this happen to anybody ?
Newbie Ilinca
my input module for that screen:
when 'SHOW'.
select col1 col2....
into corresponding fields of table it_display
from ztable
where col1 = ztable2-col1.
CLEAR ls_fieldcatlog.
ls_fieldcatlog-row_pos = '1'.
ls_fieldcatlog-col_pos = '1'.
ls_fieldcatlog-fieldname = 'COL1'.
ls_fieldcatlog-tabname = 'IT_DISPLAY'.
ls_fieldcatlog-seltext_m = 'Infotype'.
APPEND ls_fieldcatlog TO lt_fieldcatlog.
CLEAR ls_fieldcatlog.
ls_fieldcatlog-row_pos = '1'.
ls_fieldcatlog-col_pos = '2'.
ls_fieldcatlog-fieldname = 'COL2'.
ls_fieldcatlog-tabname = 'IT_DISPLAY'.
ls_fieldcatlog-seltext_m = 'Infotype'.
APPEND ls_fieldcatlog TO lt_fieldcatlog.
...
noloyo-zebra = 'X'.
noloyo-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_grid_title = 'INFOTYPE DETAILS'
is_layout = noloyo
it_fieldcat = lt_fieldcatlog
i_screen_start_column = 10
i_screen_start_line = 20
i_screen_end_column = 100
i_screen_end_line = 40
TABLES
t_outtab = it_display
EXCEPTIONS
program_error = 1
OTHERS = 2.
AND MY DECL:
TYPES: BEGIN OF type_com,
col1TYPE ztable-col1,
col2TYPE ztable-col2,
....
END OF type_com.
DATA : it_display TYPE STANDARD TABLE OF type_com.