Skip to Content
0

Combined rows in alv display

May 31, 2017 at 06:16 AM

141

avatar image
Former Member

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.

untitled4.png (3.8 kB)
untitled.png (3.3 kB)
untitled3.png (14.6 kB)
untitled2.png (7.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Richard Harper May 31, 2017 at 06:51 AM
0

"I prepared alv display using same approach" ??

What approach ? Are you talking about TrikTresors column merging ??

More detail please

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi,
Yes. I am referring to trik tresors column merging approach.
I followed below link:

http://www.tricktresor.de/blog/zellen-verbinden/

Thanks.
0

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.

0
Former Member

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

0
Richard Harper Jun 02, 2017 at 07:09 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded