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

CL_SALV_TABLE sort without merging

Hi all

Does anyone know how to manage a sort using the SALV factory method (cl_salv_table) - WITHOUT the sort fields merging, i.e. the same function as with field NO_MERGING in LVC_S_FCAT using old style ALV?

The sorts all work fine using the following:

DATA: lr_salv_sorts TYPE REF TO cl_salv_sorts.

....

lr_salv_sorts->add_sort( EXPORTING columnname = 'YEAR'

position = '1'

sequence = '2'

subtotal = ' ' ).

However, the sort fields are all merged - you used to be able to switch this off using NO_MERGING in LVC_S_FCAT.....

I need to switch this merging off for ALV OM

Many thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jun 08, 2010 at 03:17 PM

    SALV doesn't handle NO_MERGING.

    Check the method GET_LVC_LAYOUT of the Class CL_SALV_CONTROLLER_METADATA which fills the Layout. This method doesn't fill the NO_MERGING option.

    One way to achieve this is using the ALV Display Layout. You can set the default Layout with the option Display > Without cell merging during sorts Set.

    Regards,

    Naimesh Patel

    Edited by: Naimesh Patel on Jun 8, 2010 10:17 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 26, 2011 at 11:18 AM

    This is great - thanks for the help

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2013 at 09:50 AM

    Hi,

    there's some news, see Note 1818083 - ALV layout: Merging behavior in object model

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 19, 2013 at 12:55 PM

    Note 1818083 - ALV layout: Merging behavior in object model

    Reply to Notification from SAP:

    <<This method does only influence the display of ALV grids in their own conatiner. It can not influence the display of fullscreen grids because of techical reasons. We will update the documentation to clarify the use of this method. To solve this problem please pass a container to the factory method of
    class cl_salv_table.>>


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 11, 2014 at 11:31 AM

    Hello folks,

    I am having a similar issue. I did the sorting part using cl_salv_sorts which merged the columns on which I applied sorting. But at the same time I don't want columns in the merged fashion. I tried below piece of code to set no merging but it didn't work.


    data: lv_s_layout type lvc_s_layo.

    call method cl_salv_controller_metadata=>get_lvc_layout
    changing
    s_layout = lv_s_layout.

    lv_s_layout-no_merging = 'X'.

    call method cl_salv_controller_metadata=>set_lvc_layout
    exporting
    s_layout = lv_s_layout.


    Any help..

    Regards,

    Harsh

    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.