Skip to Content
avatar image
Former Member

Sort alv grid

Hi SAP

I have a problem during the Sorting of the data displayed on my Alv grid.

In particular data are sorted but the rows with the same values are not merged, why?

this is my sort table:

wa_sort-spos = '01'.

wa_sort-fieldname = 'MATNR'.

wa_sort-up = 'X'.

wa_sort-group = 'X'.

APPEND wa_sort TO a_sort.

CLEAR wa_sort.

wa_sort-spos = '02'.

wa_sort-fieldname = 'WERKS'.

wa_sort-up = 'X'.

APPEND wa_sort TO a_sort.

CLEAR wa_sort.

wa_sort-spos = '03'.

wa_sort-fieldname = 'LGORT'.

wa_sort-up = 'X'.

APPEND wa_sort TO a_sort.

CLEAR wa_sort.

and the methos Set_table_for_first_display

CALL METHOD g_grid7->set_table_for_first_display

EXPORTING

  • i_structure_name = 'SFLIGHT'

is_layout = gs_layout

CHANGING

it_outtab = t_7[]

it_fieldcatalog = gt_fieldcat7

it_sort = a_sort.

thanks to all,

bella pe voi!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Sep 01, 2009 at 10:01 AM
    Add comment
    10|10000 characters needed characters exceeded

  • Sep 01, 2009 at 10:21 AM

    Hi,

    Pass '*' in GROUP and not 'X'.

    regards,

    Ankur Parab

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2009 at 10:26 AM

    alwais the same problem with the '*',

    the olny differences with the example is the fieldcat build manually,

    can be this the problem?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2009 at 01:52 AM

    Hi Ballante,

    wa_sort-spos = '01'.
    wa_sort-fieldname = 'MATNR'.
    wa_sort-up = 'X'.
    wa_sort-group = 'X'.
    APPEND wa_sort TO a_sort.
    CLEAR wa_sort.
    <li>In your above code, you have set wa_sort-group = 'X'. But it is wrong. You need to set value either * (star) for Page feed (incl. underline) or UL for Underline. <li> Try to change the above one and execute. It should work now. Thanks Venkat.O

    Add comment
    10|10000 characters needed characters exceeded