cancel
Showing results for 
Search instead for 
Did you mean: 

ALV: Disable/Hide "Settings"

Former Member
0 Kudos

Hi all,

I've hiden some columns in my ALV, I don't want to the users can display it using the link "Settings".

Is there any way to disable this option? or don't show these hiden columns in "settings"?

Or any way to not include these columns in the field catalog of the ALV?

Thanks in advance.

Regards,

Manu.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

To delete column you can use method

if_salv_wd_column_settings~delete_column('ATTR_NAME').

Code snippet:

DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

LO_INTERFACECONTROLLER =   WD_THIS->WD_CPIFC_ALV( ).

  DATA LO_CONFIG TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

  LO_CONFIG = LO_INTERFACECONTROLLER->GET_MODEL(   ).

LO_CONFIG-> IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN('ATTR_NAME').

Hope this helps u.,

Regards,

Kiran

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

To hide the link to the settings menu altogether do this:

   DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .

   DATA lr_config_table TYPE REF TO cl_salv_wd_config_table.

    "get interfacecontroller of alv componentn
  lo_interfacecontroller = wd_this->wd_cpifc_alv_component( ).
  "get the config model for customizing alv table
  lr_config_table = lo_interfacecontroller->get_model( ).

   "remove settings link/button from alv table
  lr_config_table->IF_SALV_WD_STD_FUNCTIONS~SET_DIALOG_SETTINGS_ALLOWED( value = ' ' ).

The other option is to make sure the columns don't appear in the settings menu. For this you needto set them to none for example this way:

  DATA lr_column TYPE REF TO cl_salv_wd_column.

  lr_column = lr_config_table->if_salv_wd_column_settings~get_column( 'YOUR_COL_ID' ).

  lr_column->set_visible( cl_wd_uielement=>e_visible-none ).

Let us know if you get it to work 🙂

Br Jan

Former Member
0 Kudos

Hi Gon,

If you dont want to visible settings option to the user make it using...

set_dialog_settings_allowed method.

wd_this->g_alv_model->if_salv_wd_std_functions~set_dialog_settings_allowed( value = abap_false ).

Cheers,

Kris.

amy_king
Active Contributor
0 Kudos

Hi Manu,

One option is in how you define the context node that is mapped to the ALV's DATA node. If the ALV's DATA node is defined as having a dictionary structure, the ALV will automatically display all fields of the structure even if only a subset of fields is selected when you define the context node attributes. To make the ALV display only the context node attributes and no other fields from the underlying data structure, remove the dictionary structure from the context node definition.

Another approach is to programmatically set a column as technical with method CL_SALV_COLUMN->SET_TECHNICAL.

Cheers,

Amy