Skip to Content

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

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 .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Oct 11, 2018 at 02:09 AM
    -1

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


    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10, 2018 at 10:37 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 11 at 03:38 PM

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

    Add comment
    10|10000 characters needed characters exceeded