2013 Jan 24 12:13 PM
Hi experts,
I want to remove the sort and filter options from cl_salv_table output.
lr_functions_so->set_sort_asc( abap_false ).
lr_functions_so->set_sort_desc( abap_false ).
lr_functions_so->set_group_sort( abap_false ).
lr_functions_SO->SET_GROUP_FILTER( ABAP_FALSE ).
lr_functions_so->set_group_subtotal( abap_false ).
I use the above code but when I right click on any column, the sort and filter functions are available.
Plz help how can I disable these options.
2013 Jan 24 2:41 PM
Looks like this "Exclusion" only works for the Toolbar buttons, but not for the context menu.
Method DISPATCH of class CL_GUI_ALV_GRID generates the context menu when you right click on the column. While generating the Context menu, the Toolbar exclusion is not considered at all. This behavior is even true for the Grid generated by class CL_GUI_ALV_GRID. But when generate the ALV using the class CL_GUI_ALV_GRID, you can register event CONTEXT_MENU_REQUEST to catch just before context menu is displayed. You can than remove the unwanted options from the context menu using the methods of the importing parameter E_OBJECT (demo program BCALV_GRID_06).
SALV Model doesn't have any wrapper event / method which would allow you to do exactly like this. You can, however, try to get the Grid object from the SALV model and register the event to gain the access of the native events. Read SALV Table 10 – Editable SALV Model (Overcome the restriction of SALV Model)
Regards,
Naimesh Patel
2013 Jan 28 8:20 AM
Dear Naimesh,
Thanks for reply, will you please provide me the sample code that how to connect the salv to alv object grid. I understand your logic but I am unable to connect the alv object grid event to salv grid.
Thanks,