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

ALV - Drilldown After Sort

Hello friends,

In ALV reports (using either cl_salv_table or cl_gui_alv_grid) I always face a problem when a drilldown is performed on sorted output list.

I retrieve the sort columns and the selected row-column values using event-handler. Now, when I sort my internal table based on the sort columns it results in different sorted order...meaning, it is not the same as the sorted-order on the screen. What could be the reason? Please help me out!

Thanks,

Sam

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Aug 30, 2006 at 11:51 PM

    Sam, that is very weird, I've just tested one of my programs using the ALV Object Model, and it is working fine when I sort. I believe that I've tested this before when using CL_GUI_ALV_GRID as well and had no problems. Can you post your code?

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Rich Heilman

      I believe my approach to display the output made the difference. I did not use the method "create_dynamic_table" using the field catalog to get an output reference. Previously, I assigned this reference to a field symbol and equate it to my output table contents. Instead, called the factory method directly (like in your sample).

      Thanks Rich!

  • author's profile photo Former Member
    Former Member
    Posted on Sep 05, 2006 at 08:49 PM

    what rich is told is correct.

    use

    gr_sorts->add_sort( columnname = 'CARRID'

    subtotal = 'X' ).

    gr_sorts->add_sort( columnname = 'another column'

    subtotal = 'X' ).

    this is how you need to build sort sequence before calling display method.

    and remove

    PERFORM get_sort_sequence.

    PERFORM adjust_output_table. from double click method...no need of generating subroutine pool to sort...

    try this and let us know whether its working or not...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 05, 2006 at 10:00 PM

    exactly you don't require to build internal table

    with create_dynamic_table. it is required only when you don't know the no of fields you have in your internal table. like if you want to have fields depending on the clients in your r/3 system here you don't know how many clients you have in your system you have to know fileds dynamically(during run time only).

    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.