Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Regarding cell merging in ALV grid display

Hi experts,

How to merge the cells in the ALV Grid display ? Is there any option for doing that.

Tags:
replied

Hi First Fill the sort table ,

*Declaration of the structure for holding sort criteria for the output data to be displayed using ALV Grid

DATA:

fs_sort_data TYPE slis_sortinfo_alv.

*Internal table to hold sort criteria for the output data to be displayed using ALV Grid

DATA:

t_sort_data TYPE slis_t_sortinfo_alv.

*Declaration of the structure for holding ALV Grid Layout data

DATA:

fs_layout TYPE slis_layout_alv.

" To store fieldcat attributes

fs_sort_data-fieldname = 'SORDER'.

fs_sort_data-spos = '01'.

fs_sort_data-up = c_flag_x.

APPEND fs_sort_data TO t_sort_data.

fs_layout-zebra = c_flag_x.

fs_layout-cell_merge = c_flag_x.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

is_layout = fs_layout

it_fieldcat = t_fieldcat[]

it_sort = t_sort_data[]

TABLES

t_outtab = t_final

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF. " IF sy-subrc NE 0.

Follow the above procedure to get merge cell.

Regards.

Eshwar.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question