‎2012 Jun 28 1:09 PM
Hi guys!
How can I sort and merge data in columns when I am using CALL METHOD go_grid->set_table_for_first_display.
I tried deleting almost all the standard buttons form the standard toolbar, and keeping just the "sort ascending" and "sort descending" ones.
But when I use them they do not merge the cells with the same value (they just sort the columns).
Do you happen to know a method or a way to do this thing? Is it necessary to use it_sort parameter?.
Here is the way I called the method.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
is_variant = ls_vari
i_save = 'A'
is_layout = gs_layout
it_toolbar_excluding = g_t_tlbr_excl
CHANGING
it_outtab = gt_alv
it_fieldcatalog = gt_fcat.
CALL METHOD go_grid->set_toolbar_interactive.
CALL METHOD cl_gui_control=>set_focus
EXPORTING
control = go_grid.
CALL METHOD go_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
‎2012 Jun 29 1:35 PM
I also thought of something else....
As you can see in the image below in the alv display you can select one or more rows .
Maybe the sort is afected by this feature? What do you think?
‎2012 Jun 28 2:34 PM
can you check the layout structure you are passing? The issue you are facing can happen if the below checkbox is ticked.
What I could not understand is why would you hide standard buttons to achieve this functionality.
Anyway, let me know if this worked for you.
‎2012 Jun 29 7:42 AM
Hi
I tried, but it doesn't work.
The checkbox wasn't ticked, and when I created the fieldcatalog I did not check the no_cell_merging feature.
The idea is that I want to create a custom toolbar and I need a sort button.
Any more ideas?
‎2012 Jun 29 10:42 AM
Please post a screenshot. One reason could be there is already some unique number sorted earlier.
eg. if you sort an ALV with RFQ number and date, since RFQ number is unique, dates can not be merged.
Anyway.
In case you want to create entire custom toolbar, you only need to add one funtion.
tool_wa_exclude = cl_gui_alv_grid=>mc_fc_excl_all.
APPEND tool_wa_exclude TO tool_it_exclude .
This will hide it all.
‎2012 Jun 29 1:20 PM
Yes I know that.
The Idea is that I hid most of the buttons and I kept the sort ones, but they don't work properly. When I click them the data gets sorted, but the cells with the same value in the column do not merge.. that is my problem...
‎2012 Jun 29 11:00 AM
‎2012 Jun 29 1:25 PM
‎2012 Jun 29 1:35 PM
I also thought of something else....
As you can see in the image below in the alv display you can select one or more rows .
Maybe the sort is afected by this feature? What do you think?
‎2012 Jun 29 1:50 PM
‎2012 Jun 29 3:12 PM
Yes!
When I disable the input option the buttons do their job.
Thanks