Skip to Content
avatar image
Former Member

Combined rows in alv display

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 31, 2017 at 06:51 AM

    "I prepared alv display using same approach" ??

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

    More detail please

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Jun 02, 2017 at 07: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.

    Add comment
    10|10000 characters needed characters exceeded