cancel
Showing results for 
Search instead for 
Did you mean: 

To hide toolbar in webdynpro alv

Former Member
0 Kudos

Hi all,

as per client reqirement i have to display Webdynpro Alv without Toolbar and No Column Heading for one column.

To hide toolbar i tried this code

Data: lv_value type ref to cl_salv_wd_config_table.

if lv_value is not initial.

CALL METHOD lv_value->IF_SALV_WD_FUNCTION_SETTINGS~SET_VISIBLE

  EXPORTING

    VALUE  = CL_WD_TOOLBAR=>E_VISIBLE-NONE.          "Hide toolbar

endif.

For not to display column heading i tried this code

* Getting the object reference of the column.

DATA LO_col TYPE REF TO CL_SALV_WD_COLUMN.

CALL METHOD LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN

EXPORTING

ID    = ‘HEADING’

RECEIVING

VALUE = LO_COL.

* Getting the object reference for the header

DATA : LO_HEADER TYPE REF TO CL_SALV_WD_COLUMN_HEADER.

CALL METHOD LO_COL->GET_HEADER

RECEIVING

VALUE = LO_HEADER.

* Setting the text as space '  '

CALL METHOD LO_HEADER->SET_TEXT

EXPORTING

VALUE = ‘  ’.

LO_HEADER->SET_PROP_DDIC_BINDING_FIELD(

PROPERTY =  IF_SALV_WD_C_DDIC_BINDING=>BIND_PROP_TEXT

VALUE = IF_SALV_WD_C_DDIC_BINDING=>DDIC_BIND_NONE ).

After trying this also i am unable to get rquired output.

Is there any other way for this requiremnt,  give examples and coding.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

bustamantejt
Explorer

You can try this to hide the toolbar (after having instantiated the component usage):


DATA: lo_value              TYPE REF TO cl_salv_wd_config_table,

      lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.

lo_interfacecontroller = wd_this->wd_cpifc_alv_modif( ).

lo_value = lo_interfacecontroller->get_model( ).

lo_value->if_salv_wd_std_functions~set_view_list_allowed( abap_false ).

lo_value->if_salv_wd_std_functions~set_export_allowed( abap_false ).

lo_value->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).

lo_value->if_salv_wd_table_settings~set_top_of_list_visible( abap_true ).

lo_value->if_salv_wd_std_functions~set_filter_complex_allowed( abap_false ).

lo_value->if_salv_wd_std_functions~set_filter_filterline_allowed( abap_false ).

lo_value->if_salv_wd_std_functions~set_dialog_settings_allowed( abap_false ).

lo_value->if_salv_wd_std_functions~set_edit_append_row_allowed( abap_false ).

lo_value->if_salv_wd_std_functions~set_edit_check_available( abap_false ).

You can use this method if you also want to hide the footer:


lo_value->if_salv_wd_table_settings~set_footer_visible(

  if_salv_wd_c_table_settings=>footer_visible_false ).

Former Member
0 Kudos

Thanks   Tomás Bustamante.

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi SKR,

To hide the toolbar of alv, please follow the below steps


DATA: lo_value              TYPE REF TO cl_salv_wd_config_table,

      lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.

lo_interfacecontroller = wd_this->wd_cpifc_ALV_TEST( )."replace alv_test with ur alv

lo_value = lo_interfacecontroller->get_model( ).

" to hide toolbar

CL_SALV_WD_MODEL_TABLE_UTIL=>SET_ALL(

     exporting

          R_MODEL = lo_value

          ALLOWED = abap_false ).

To clear the header text of the column, your code should still work.

Also check the below links

Changing the header of the Column – ALV Report | Team ABAP

Hope this helps you.

Regards,

Rama