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

Function Codes in Dynamic ALV

former_member196651
Contributor
0 Likes
1,216

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

3 REPLIES 3
Read only

Former Member
900

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

Read only

MarcinPciak
Active Contributor
0 Likes
900

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

Read only

former_member196651
Contributor
0 Likes
900

This query has been answered.