cancel
Showing results for 
Search instead for 
Did you mean: 

Layout variant settings are lost while using method refresh_table_display of class cl_gui_alv_grid.

0 Kudos

I have passed the variant gs_variant to the method set_table_for_first_display of cl_gui_alv_grid for initial display of editable ALV.

When I refresh the ALV using the method refresh_table_display after editing contents of ALV , all the settings of the layout variant are lost eventhough the gs_variant has the correct variant set.

CALL METHOD g_grid->set_table_for_first_display

EXPORTING

is_layout = gs_layout

is_variant = gs_variant

i_save = 'A'

i_default = 'X'

it_toolbar_excluding = gt_exclude

CHANGING

it_fieldcatalog = gt_fieldcat

it_outtab = gt_outtab.

I have tried using methods get_variant, set_variant but nothing seems to work out.

CALL METHOD g_grid->get_variant IMPORTING es_variant = gs_variant.

CALL METHOD g_grid->set_variant EXPORTING is_variant = gs_variant.

CALL METHOD cl_gui_cfw=>flush.

CALL METHOD g_grid->set_frontend_layout EXPORTING is_layout = gs_layout.

CALL METHOD g_grid->refresh_table_display.

Can someone please guide me how to save the current layout varaint settings when Refreshing the ALV .

Accepted Solutions (0)

Answers (3)

Answers (3)

Thank you for you inputs Bongkeun Shin . I have tried this, but this did not solve my issue.


0 Kudos

I have the same issue. Does anyone know a solution?

Former Member
0 Kudos

When I refresh the ALV, I only use 2 methods below.

I recommend you to use only 2 methods and check out if there is any code that refresh gs_layout.

CALL METHOD po_grid->refresh_table_display

CALL METHOD cl_gui_cfw=>flush