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


is_layout = gs_layout

is_variant = gs_variant

i_save = 'A'

i_default = 'X'

it_toolbar_excluding = gt_exclude


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 a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 11, 2019 at 03:38 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 11, 2018 at 02:09 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.