cancel
Showing results for 
Search instead for 
Did you mean: 

Persisting ALV settings

mike_mcinerney
Participant
0 Kudos

I have a wd4a app that displays an alv.

I have fixed the first two columns on the left.

The user can resize any of the columns .

A subset of my code is shown below.

Question: What do I need to do so that the user's resized column widths will persist from session to session.

Additionally, some columns are not shown by default, so the user can add or drop them from the display, so ...

...same Question on persisting which columns to display from session to session?

Thanks... ...Mike


...
  l_value                    = l_ref_interfacecontroller->get_model( ).
  lr_table_settings ?= l_value .
  lr_table_settings->set_fixed_table_layout( abap_true ).

 ---------------------------------------------------------- *
* High Level Grid Config - Functions                         *
* ---------------------------------------------------------- *

  lr_standard_functions->set_edit_check_available( abap_false ).
  lr_standard_functions->set_display_settings_allowed( abap_true ).
  lr_standard_functions->set_filter_complex_allowed( abap_false ).
  lr_standard_functions->set_sort_headerclick_allowed( abap_true ).
  lr_standard_functions->set_filter_filterline_allowed( abap_false ).
  lr_standard_functions->set_dialog_settings_allowed( abap_true ).

* ---------------------------------------------------------- *
* Column Level Config                                        *
* ---------------------------------------------------------- *

  lr_column = lr_column_settings->get_column( 'PROJECT' ) .
  lr_column->set_fixed_position( cl_wd_abstr_table_column=>e_fixed_position-left ) .
  lr_column->set_resizable( abap_true ) .
  lr_column->set_width( '80' ) .

* ---

  lr_column = lr_column_settings->get_column( 'PROJECT_NAME' ) .
  lr_column->set_fixed_position( cl_wd_abstr_table_column=>e_fixed_position-left ) .
  lr_column->set_resizable( abap_true ) .
  lr_column->set_width( '240' ) .

* ---

  lr_column = lr_column_settings->get_column( 'ORG_UNIT' ) .
  lr_column->set_visible( '00' ) .
*   ---

  lr_column = lr_column_settings->get_column( 'BFR' ) .

...
more...

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Question: What do I need to do so that the user's resized column widths will persist from session to session.

Unfortunetely, column resizing using the ALV doesn't persist. Column resizing on a normal table UI element does persist as a personalization, but the dynamic nature of the ALV wrapper around the table eliminates this functionality. It is something SAP is currently investigating for possible future functionality.

mike_mcinerney
Participant
0 Kudos

Thanks Thomas. Does that answer also apply to the second part of the question pertaining to persisting user selections to hide/display columns?

Former Member
0 Kudos

Hi Micheal,

ALV Variants can be created with specific columns which need to be displayed.

Rangananthan.