cancel
Showing results for 
Search instead for 
Did you mean: 

Column disable in ALV - Web Dynpro ABAP

Former Member
0 Kudos

Hi Experts,

My requirement is to disable particular columns in ALV.

Kindly expain the procedure to achieve this or send me any links regarding the same.

Regards,

Aishwarya.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member233090
Active Contributor
0 Kudos

Hi,

You can do it using Personalization,

i will send you a url pls check it there is a vedio by Thompson jung, where he has disable some of the coloumns using personalzation.

Even i have tried it , i find this site very useful.

hope you too will like it[link|/docs/DOC-8238#section4 [original link is broken]]

cheers,

bhavana

former_member1151507
Participant
0 Kudos

Hi Aishwarya.,

If you want to disable particular columns, you can use SET_ENABLED method of that particular UI element.

In this example, i am using TextView.

DATA lo_ref_cmp_usage TYPE REF TO if_wd_component_usage.

DATA lo_table_setings TYPE REF TO if_salv_wd_table_settings.

DATA lo_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

DATA lo_table TYPE REF TO cl_salv_wd_config_table.

DATA lo_textview TYPE REF TO CL_SALV_WD_UIE_TEXT_VIEW .

lo_ref_cmp_usage = wd_this->wd_cpuse_alv_test( ).

IF lo_ref_cmp_usage->has_active_component( ) IS INITIAL.

lo_ref_cmp_usage->create_component( ).

ENDIF.

lo_ref_interfacecontroller = wd_this->wd_cpifc_alv_test( ).

lo_table = lo_ref_interfacecontroller->get_model( ).

CREATE OBJECT lo_textview.

lo_textview->SET_TEXT_FIELDNAME( 'PERNR' ).

lo_column_settings ?= lo_table.

lo_column = lo_table->if_salv_wd_column_settings~get_column( 'PSPID' ).

lo_column_hdr = lo_column->create_header( ).

lo_column_hdr->set_text( 'Employee').

lo_column->set_cell_editor( lo_textview ).

lo_textview->SET_ENABLED( abap_false ).

If you want to enable/disable dynamically, you can use SET_ENABLED_FIELDNAME by passing the attribute name as parameter. By setting that attribute value accordingly, you can set the column enable/disable.

Please let me know in case of any issues.

Regards,

Manogna

Former Member
0 Kudos

Aishwarya,

This has been discussed so many times.please search in scn

data column type ref to cl_salv_wd_column.

  • provide data to ALV

ref_comp_usage = wd_this->wd_cpuse_alv_employee_search( ).

if ref_comp_usage->has_active_component( ) is initial.

ref_comp_usage->create_component( ).

endif.

ref_interfacecontroller = wd_this->wd_cpifc_alv_employee_search( ).

ref_interfacecontroller->set_data( node ).

alv_config = ref_interfacecontroller->get_model( ).

check method CREATE_RESULT_CONTEXT of component controller in HRASR00_EMPLOYEE_SEARCH for reference

Thanks

Bala Duvvuri

column = alv_config->if_salv_wd_column_settings~get_column( id = 'PERNR' ).

column->set_visible( if_wdl_core=>visibility_blank ).