cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding ALV header and footer

Former Member
0 Kudos

Friends,

I am working on an ALV table in a standard Web Dynpro ABAP application.

The business requirement is to hide the header and footer for the ALV table.

The header has a dropdown to choose u201CStandard Viewu201D and 2 options: Filter and Settings.

The footer for the ALV table containing the Row and Column numbering also needs to be hidden.

I am looking at the IF_SALV_WD_TABLE_SETTINGS to find the relevant methods to hide the header and footer.

Please let me know if I am on the right track and if there is an alternate way to do this through changing the layout of the ALV table. I tried to hide the header and footer manually via the layout but am unable to do so, as the ALV table is just displayed as ViewContainerUI Element.

Please help as I am new to ALV in WDA.

Thanks and Regards.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have a look on this code which will hide 'export' and 'pdf' option from header. Doube click on if_salv_wd_std_functions on this interface and you will see all the function. Then just find out which you want to hide, get the method name from there and add the line in this code...and make as abap_false.

DATA: lr_cmp_usage           TYPE REF TO if_wd_component_usage.
 
  lr_cmp_usage = wd_this->wd_cpuse_cu_alv_search( ).
  IF lr_cmp_usage->has_active_component( ) IS INITIAL.
    lr_cmp_usage->create_component( ).
  ENDIF.
 
  DATA: lr_if_controller TYPE REF TO iwci_salv_wd_table,
        lr_config_model  TYPE REF TO cl_salv_wd_config_table.
 
  lr_if_controller = wd_this->wd_cpifc_cu_alv_search( ).
  lr_config_model = lr_if_controller->get_model( ).
 
 
  lr_config_model->if_salv_wd_std_functions~set_export_allowed( abap_false ).
  lr_config_model->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).

Hope it works.

Former Member
0 Kudos

Hi,

lr_config_model->if_salv_wd_std_functions~set_export_allowed( abap_false ).

lr_config_model->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).

these settings are already present in the code. I dont think either of them affect the footer or header.

Thanks.

Answers (4)

Answers (4)

elmarmvogt
Explorer
0 Kudos

Hi all,

  you cannot hide the header of an ALV in a once.

You have to disable each function seperatlly like this:

lo_alv_conf_mdl->if_salv_wd_std_functions~set_export_allowed( abap_false ).

lo_alv_conf_mdl->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).

lo_alv_conf_mdl->if_salv_wd_table_settings~set_top_of_list_visible( abap_true ).

o_alv_conf_mdl->if_salv_wd_std_functions~set_filter_complex_allowed( abap_false ).

lo_alv_conf_mdl->if_salv_wd_std_functions~set_filter_filterline_allowed( abap_false ).

lo_alv_conf_mdl->if_salv_wd_std_functions~set_dialog_settings_allowed( abap_false ).

lo_alv_conf_mdl->if_salv_wd_std_functions~set_edit_append_row_allowed( abap_false ).

lo_alv_conf_mdl->if_salv_wd_std_functions~set_edit_check_available( abap_false ).

lo_alv_conf_mdl->if_salv_wd_std_functions~set_view_list_allowed( abap_false ).

This works in my case.

Regards

Former Member
0 Kudos

Closing and opening another thread as the header is hidden and only the footer remains.

Former Member
0 Kudos

Hi,

I solved the issue for the footer too.

I declared as:

data footer_visible_false type salv_wd_constant.

value->if_salv_wd_table_settings~sET_FOOTER_VISIBLE( footer_visible_false ).

Regards.

Former Member
0 Kudos

Why not you use table contorl, if you want to hide all options of ALV. Is there any specific reason.

Former Member
0 Kudos

Hi,

I do want to hide all the ALV options. Please tell me how and where to use the table control. I am new to ALV.

Thanks and Regards.

ramasamy_kumar
Explorer
0 Kudos

Just a small addition to the above provided help

Set the properties for the below method in l_table (cl_salv_wd_config_table) ,

IF_SALV_WD_TABLE_SETTINGS~SET_TOP_OF_LIST_VISIBLE

IF_SALV_WD_TABLE_SETTINGS~SET_FOOTER_VISIBLE

Cheers,

Kumar

Former Member
0 Kudos

Kumar,

I have added the following lines of code to WDDOINIT code.

value->if_salv_wd_table_settings~set_footer_visible( ).

value->if_salv_wd_table_settings~set_top_of_list_visible( ).

These method calls seems to make the header and footer visible. How to make them invisible. What values should i pass as parameter to these methods. I tried giving abap_false as parameter but error occurs.

Please help.

Thanks and Regards.

former_member182429
Active Participant
0 Kudos

Hi there, try the following:

value->if_salv_wd_table_settings~set_footer_visible( FOOTER_VISIBLE_FALSE ).

value->if_salv_wd_table_settings~set_top_of_list_visible( abap_false ).

Former Member
0 Kudos

Hi Hskok,

I added the following 2 lines of code:

value->if_salv_wd_table_settings~set_footer_visible( FOOTER_VISIBLE_FALSE ).

value->if_salv_wd_table_settings~set_top_of_list_visible( abap_false ).

I get the error:

Field "FOOTER_VISIBLE_FALSE" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.

the second line of code (set_top_of_list_visible) has no effect on the header or footer.

Thanks and Regards.