Skip to Content

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

Merging cells in REUSE_ALV_GRID_DISPLAY

Hi,

I have created one report. In that am using "REUSE_ALV_GRID_DISPLAY" . I have given below sample code. The problem is the cells of the column (IDX) are not merged for same values. Is the code given below is correct or am I missing something?

*********************************************************

PERFORM build_layout CHANGING gs_layout. " gs_layout TYPE slis_layout_alv.

PERFORM build_fieldcatalog CHANGING gt_fcat. "gt_fcat TYPE slis_t_fieldcat_alv,

*********************************************************

CLEAR gs_sort.

gs_sort-spos = 1.

gs_sort-up = 'X'.

gs_sort-fieldname = 'IDX'.

gs_sort-tabname = 'GT_OUTTAB'.

APPEND gs_sort TO gt_sort. " gt_sort TYPE slis_t_sortinfo_alv.

*********************************************************

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

is_layout = gs_layout

it_fieldcat = gt_fcat

it_sort = gt_sort

TABLES

t_outtab = gt_outtab.

FORM build_fieldcatalog CHANGING p_lt_fieldcat TYPE slis_t_fieldcat_alv.

DATA: ls_fieldcat TYPE slis_fieldcat_alv.

DATA: pos TYPE i.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BOX'.

ls_fieldcat-datatype = 'CHAR'.

ls_fieldcat-outputlen = 2.

ls_fieldcat-checkbox = 'X'.

ls_fieldcat-input = 'X'.

ls_fieldcat-edit = 'X'.

APPEND ls_fieldcat TO p_lt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'IDX'.

ls_fieldcat-seltext_m = 'S.No'.

ls_fieldcat-datatype = 'INT1'.

ls_fieldcat-key = 'X'.

APPEND ls_fieldcat TO p_lt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'DATE'.

ls_fieldcat-seltext_m = 'Date'.

ls_fieldcat-datatype = 'DATS'.

APPEND ls_fieldcat TO p_lt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'TIME'.

ls_fieldcat-seltext_m = 'Time'.

ls_fieldcat-datatype = 'TIMS'.

APPEND ls_fieldcat TO p_lt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'OBJNR'.

ls_fieldcat-seltext_m = 'Obj No.'.

ls_fieldcat-datatype = 'CHAR'.

ls_fieldcat-outputlen = 22.

APPEND ls_fieldcat TO p_lt_fieldcat.

ENDFORM.

********************************

FORM build_layout CHANGING p_gs_layout TYPE slis_layout_alv.

p_gs_layout-cell_merge = fullscreen_cell_merge. " value = 'X'

ENDFORM. " BUILD_LAYOUT

Tags:
Former Member replied

in the case of Checkbox Group Functionality will fail, The same issue Discussed yesteday. I am not sure did you search in the Forum or not.

Just check this wiki

https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-ALVReportGroupFunctionalitywithCheckbox

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