05-31-2017 7:16 AM
Hi,
I prepared alv display using same approach for multiline column display and i am getting output. But only thing is that not all data rows are being displayed.
I am getting a combined row at end like this. I have about 2,000 rows of data in my output table for alv display but it is displaying only 800 rows.
when i select view->list output on alv toolbar, it displays all the rows fine.
Thanks.
05-31-2017 7:51 AM
"I prepared alv display using same approach" ??
What approach ? Are you talking about TrikTresors column merging ??
More detail please
06-01-2017 7:13 AM
Hi,
Yes. I am referring to trik tresors column merging approach.
I followed below link:
06-01-2017 8:02 AM
Firstly, you should make it explicitly clear that you are not using standard SAP since the code you have mentioned comes from some one elses blog.
Secondly, I have implemented the same code without a problem so share the code where you define which columns and rows you wish to merge. As for showing it in list output ok, the will always be the case because that is basically a standard report without all the fancy functions of the grid.
06-01-2017 9:51 AM
hi,
***code for populating data to be displayed
***gt_gen_data has about 8000 rows
DATA : lwa_gen_data TYPE ty_gen_data.
SORT gt_gen_data BY kunnr.
***ROW 1
CLEAR wa_styles.
wa_styles-field01 = text-005.
wa_styles-field02 = text-006.
wa_styles-field03 = text-026.
APPEND wa_styles TO gt_styles.
***ROW 2
CLEAR wa_styles.
wa_styles-field03 = text-025.
APPEND wa_styles TO gt_styles.
LOOP AT gt_gen_data INTO lwa_gen_data.
CLEAR wa_styles.
wa_styles-field01 = lwa_gen_data-kunnr.
wa_styles-field02 = lwa_gen_data-cust_name.
wa_styles-field03 = lwa_gen_data-del_blck.
APPEND wa_styles TO gt_styles.
ENDLOOP.
CALL METHOD gr_alv_grid->set_table_for_first_display
EXPORTING
is_variant = gs_variant
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fieldcatalog
it_outtab = gt_styles.
***code for merge
wa_style-style = alv_style_font_bold
+ alv_style_align_center_center
+ alv_style_color_int_normal .
CALL METHOD gr_alv_grid->zm_set_cell_style
EXPORTING
i_row = 1
i_col = 1
i_style = wa_style-style.
CALL METHOD gr_alv_grid->zm_set_cell_style
EXPORTING
i_row = 1
i_col = 2
i_style = wa_style-style.
***Merge columns vertically
CLEAR gt_col_merge.
wa_style-style = alv_style_font_bold
+ alv_style_align_center_center
+ alv_style_color_int_key.
CALL METHOD gr_alv_grid->zm_set_cell_style
EXPORTING
i_row = 1
i_col = 3
i_style = wa_style-style.
CALL METHOD gr_alv_grid->zm_set_cell_style
EXPORTING
i_row = 2
i_col = 3
i_style = wa_style-style.
***calling display method of zcl_gui_alv_grid
gr_alv_grid->z_display( ).
"rest whole code is same.
thanks
06-02-2017 8:09 AM
It appears that you have not mentioned how you wish to merge the cells. There are two methods that should be used for this - Set_Merge_Horiz and Set_Merge_Vert. Please review Enno's examples again.