cancel
Showing results for 
Search instead for 
Did you mean: 

Remove ALV column

former_member186783
Participant
0 Kudos

Hi everyone!

I have an ALV table in my WD application. For some cases I'd like to completely remove (and not just hide) some columns from the ALV.

I know that I can set the visibility parameter:


lr_column->set_visible( if_wdl_core=>visibility_none ).

The problem is that in this case the user can put back this column to the ALV table in the settings menu, and useres with Role "A" can see everything but users with Role "B" can't see some columns

My question is: Is there a way to remove completely the column from the ALV?

Thanks

N.

Accepted Solutions (1)

Accepted Solutions (1)

former_member199125
Active Contributor
0 Kudos

Hi..

to delete column from alv table use belw statement.

lo_value->if_salv_wd_column_settings~delete_column( 'ATTRIBUTE NAME'').

Regards

Srinivas

Answers (1)

Answers (1)

sahai
Contributor
0 Kudos

Hi everyone!

>

> I have an ALV table in my WD application. For some cases I'd like to completely remove (and not just hide) some columns from the ALV.

> I know that I can set the visibility parameter:

>


> lr_column->set_visible( if_wdl_core=>visibility_none ).
> 

>

> The problem is that in this case the user can put back this column to the ALV table in the settings menu, and useres with Role "A" can see everything but users with Role "B" can't see some columns

> My question is: Is there a way to remove completely the column from the ALV?

>

> Thanks

> N.

hi,

check this piece of code below for your reference.

DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
  LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
  ).
LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN( 'BUNY_BAL_WT' ). "BUNY_BAL_WT is my column name  "may be different in your case.

regards,

sahai.s