2010 Jun 08 4:09 PM
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.
2010 Jun 08 4: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
2010 Jun 08 4:50 PM
Hi
Thanks for this, did you mean the following?
cl_salv_controller_metadata=>get_lvc_layout( CHANGING s_layout = lv_lvc_s_layo ).
lv_lvc_s_layo-no_merging = 'X'.
cl_salv_controller_metadata=>set_lvc_layout( EXPORTING s_layout = lv_lvc_s_layo ).
It still merges sort fields, sorry if I've mis-understood.
Thanks
2010 Jun 08 5:13 PM
NO. I just provided the class & method for your reference to understand the where SALV doesn't handle the NO_MERGING.
Regards,
Naimesh Patel
2010 Jun 08 5:21 PM
Hi
This is clear now, thanks for the help.
Points awarded.
Thanks
2011 Jan 26 11:18 AM
2013 Jun 12 10:50 AM
Hi,
there's some news, see Note 1818083 - ALV layout: Merging behavior in object model
2013 Jun 20 11:23 AM
Hi,
I implemented the note and set the display setting set_no_merging to TRUE but still the sorted cells are merged.
2013 Jun 26 11:35 AM
Yes, I know
I have opened a "SAP Message Number" for this issue.
2013 Jul 19 1: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.>>
2014 Sep 11 12:31 PM
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
2015 May 12 3:15 PM
Hi,
I had the same issue and solved it with a little workaround.
You can copy the values from the column you want to sort by into a another field which you are going to hide on the Screen. Then you can sort by that hidden field.
Regards,
Tommy
2023 Oct 13 9:59 AM
Hi,
You can achieve this by using the display settings instead of sorts or layout setting.
DATA: lo_display TYPE REF TO cl_salv_display_settings.
lo_display = co_alv->get_display_settings( ).
lo_display->set_no_merging( value = 'X' ).