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: 

sort problem in ALV

former_member194669
Active Contributor
0 Kudos

I have ALV grid (Object oriented), I am sorting all the fields in the grid in LVC_S_SORT table and passing to method set_table_for_first_display

Here my problem is the ALV grid in the third line (next group level ) all fields are not displaying due to its have same vale of previous line

I know this problem of sort. How to overcome this.

ALV display

fld1 fld2 fld3 fld4 fld5 fld6 fld7

002 MH P1 N509 AA 1 CR

... .. .. .... ............... 7 MH

006 MI IM N509 AA 1 CR

Here you can see the fld4 and fld5 are not displayed in the Grid but below mentioned list output it is displayed properly (The below mentioned list output taken from grid --> list output option)

List Output.

fld1 fld2 fld3 fld4 fld5 fld6 fld7

002 MH P1 N509 AA 1 CR

002 MH P1 N509 AA 7 MH

006 MI IM N509 AA 1 CR

How to make the sort criteria?

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

So you don't want the columns to group if same value?

Regards,

RIch Heilman

0 Kudos

If so, then you will want to try to set a flag in the layout parameter.

data: xlayout    type lvc_s_layo.     "<-  Here

xlayout-NO_MERGING = 'X'.      "<-  Here

  call method alv_grid->set_table_for_first_display
      exporting
           is_layout              = xlayout    "<-  Here
      changing
           it_outtab       = i_alv[]
           it_fieldcatalog = fieldcat[].

Regards,

Rich Heilman