cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Table columns reset!

Former Member
0 Kudos

Hello,

I have a WD application with ALV Table integrated in a view. When i run this application, and modify the settings of this table and hide some columns, this changes get saved permanently, i.e., if i relaunch the application in a new window these columns are still hidden.

How can i make sure that every time a user runs this application he gets to see all the columns no matter how he left his column settings in his earlier session. This problem exists with the standard SAP Demo ALV examples as well. And I am sure that some of you must have also faced this problem. How can i resolve this. Thanks.

Regards,

Vasu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I am not sure if there is a method to restore the default settings. But when you initialize your ALV, you can probably make each column visible explicitly. The code for doing that would be:

data: lt_col type salv_wd_t_column_ref,

ls_col type salv_wd_s_column_ref.

lt_col = l_alv_model->if_salv_wd_column_settings~get_columns( ).

loop at lt_col into ls_col.

ls_col-r_column->set_visible( abap_true ).

endloop.

Regards,

Nithya

Former Member
0 Kudos

Thanks Nithya for the helpful reply. But i was wondering if there is any other SAP provided method for achieving the same.

Regards,

Vasu

Former Member
0 Kudos

Hi Vasu,

While instantiate your ALV component, Just delete it if it is already exist. Then definetly this will be solved i hope.

Best Regards,

Vijay