Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV: Not merging the cell when record not identifical

Former Member
0 Kudos
438

Hi all,

I have sort criterion as below. However I face an issue, if the ebeln is not the same but the ebelp is same, the ebelp column is merging in the ALV which is not what I want. Does that a way to not merge the cell when the ebelp is same(while the ebeln is different).

FORM init_sort.

   CLEAR gs_sort.

   gs_sort-fieldname = 'EBELN'.

   gs_sort-spos      = 1.

   gs_sort-down      = gc_x.

   APPEND gs_sort TO gt_sort.

   CLEAR gs_sort.

   gs_sort-fieldname = 'EBELP'.

   gs_sort-spos      = 2.

   gs_sort-up        = gc_x.

   APPEND gs_sort TO gt_sort.

ENDFORM.                    "init_sort

3 REPLIES 3

ThomasZloch
Active Contributor
0 Kudos
107

Old issue, ALV cell merging is not smart enough to recognize combined sort columns, it just compares the previous rows values for each column separately. Not sure how this behaves e.g. in Web Dynpro ALV.

Cannot be fixed, as far as I know, or would like to learn how.

Thomas

former_member194152
Contributor
0 Kudos
107

Hi,

In Change layout button of standard ALV toolbar, go to last tab named "Display" there are some properties of ALV there you can mange cell merging setting for ALV during sort.

Use this setting and save default layout will solve your problem.

In coding , use "cell_merge" field of ALV layout  "slis_layout_alv".

Thanks and Regards,

Gagan

0 Kudos
107

This just switches cell merging on and off altogether. What we want is "smart" merging, factoring in a multi-column sort order, i.e. not merging identical values when there are non-identical values to the left.


Thomas