Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CL_SALV_TABLE remove Sort/Filter

Former Member
0 Likes
2,154

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.

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
1,069

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

Read only

0 Likes
1,069

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,