Skip to Content
author's profile photo Former Member
Former Member

sorted data on an alv grid

hi there,

i am displaying a data on the alv grid, how ever i want it in a sorted manner, where should i do that.

regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 04:38 AM

    Hi,

    use the sort internal table IT_SORT to the function module parameter or to the method..

    THanks,

    naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 04:39 AM

    Hi Chinmaya,

    There are two options available..

    1) You can do sorting in your ABAP code inself

    SORT ITAB BY field1 field2.....

    2) After displaying ALV grid there is standard functionality of sort given by SAP on application toolbar.

    Regards,

    Amey

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 04:42 AM

    How are displaying the ALV..are you using FM or OO..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 05:23 AM

    Hi,

    In the method SET_TABLE_FOR_FIRST_DISPLAY there is a parameter named IT_SORT..Pass the sort internal table T_SORT in this parameter..

    DATA: T_SORT TYPE LVC_T_SORT.

    DATA: S_SORT TYPE LVC_S_SORT.

    S_SORT-SPOS = '1'.

    S_SORT-FIELDNAME = 'MATNR'.

    S_SORT-UP = 'X'.

    APPEND S_SORT TO T_SORT.

    CLEAR S_SORT..

    Thanks

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.