cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide ALV columns in the grid as well as in the "settings"(right top)

Former Member
0 Kudos

Hi all,

Requirement:

1. Change the cell backcolor according to the input value, so I have to create a cell design field to control the color accordingly

2. User should be able to choose which fields should be hidden and which should be displayed, so I can not disable the "Settings" button

If some one can kindly advise me how to hide ALV columns in the grid as well as in the "settings"(right top)?

Any help would be greatly appreciated.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,,

ALV columns can be hidden using the following logic ,

lo_column              TYPE REF TO cl_salv_wd_column,
lo_column = lo_config_table->if_salv_wd_column_settings~get_column( <columnname> ).
lo_column->set_visible( CL_WD_UIELEMENT=>E_VISIBLE-NONE ).

lo_config_table can be obtained using get_model( ) method.

thanks,

aditya.

Former Member
0 Kudos

In addition to above code, if you delete the column instead of setting its visibility to none then I guess that column should not be visible in settings tab as well.

method would look something like this:

CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN

EXPORTING

ID = ls_column-id.

Regards

Manas Dua

Former Member
0 Kudos

Many thanks!

Problem solved by your advise.

Answers (0)