‎2010 May 20 11:46 AM
Hello Friends,
I had created an ALV using CL_SALV_TABLE. My requirement is to hide some of the satndard functions appearing in ALV. I had tried this using the method REMOVE_FUNCTION from CL_SALV_FUNCTIONS. For example to hide Find function, I tried by giving function code as MC_FC_FIND (function code for Find in normal ALV created using CL_GUI_ALV_GRID). But this lead to dump error. I can't find any function codes in CL_SALV_TABLE class.
Can anyone tell me which is the function code that I have to use and in which class I can find this.
Regards,
Abijith
‎2010 May 20 1:17 PM
Hi ,
You can get Names in debugging using,
DATA: r_functions TYPE REF TO cl_salv_functions,
t_func_list TYPE salv_t_ui_func,
w_fname type string,
wa_func_list LIKE LINE OF t_func_list.
* Get all functions
r_functions = gr_table->get_functions( ).
"gr_table is ref to cl_salv_table
t_func_list = r_functions->get_functions( ).
LOOP AT t_func_list INTO wa_func_list.
w_fname = wa_func_list-r_function->get_name( ).
ENDLOOP.
Note: You can Hide the particular Function code by
wa_func_list-r_function->set_visible( ' ' ).
Hope This Helps You.
Regards,
Raghava Channooru
‎2010 May 20 3:06 PM
All the function codes you can find in attributes of interfcace IF_SALV_C_FUNCTION . So using Raghava's code you can hide specific option
lr_functions->set_all( 'X' ).
LOOP AT lt_function_list INTO ls_function.
check ls_function-r_function->get_name( ) = IF_SALV_C_FUNCTION=>SORT_ASC. "get sort ascending option
ls_function-r_function->set_visible( space ). "and hide it
ENDLOOP.
If you want to use custom options then simply assign custom GUI status
r_alv->set_screen_status(
pfstatus = "give GUI status
report = "of report
set_functions = co_alv->c_functions_all ).
Regards
Marcin
‎2010 Jul 10 7:23 AM