Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Re-Display ALV Grid with New Layout

Former Member
0 Kudos

I have an application that accepts input from an editor control, and then calls an ALV grid based on the input. The layout of the grid can change each time.

Each time I display the ALV grid screen, I call SET_TABLE_FOR_FIRST_DISPLAY. However, it never shows the updated structure, it only shows the original.

Any ideas on what to do to get it to display the new version? I can post a sample app demonstrating the problem, but it is 160 lines of code.

Thanks for any suggestions

3 REPLIES 3

former_member181962
Active Contributor
0 Kudos

Can you show your code to call to the SET_TABLE_FOR_FIRST_DISPLAY?

0 Kudos

Thanks. Here is the code. Each time I clear the reference variables.

FORM create_alv_grid.
  DATA:        l_s_layout      TYPE lvc_s_layo.

  CLEAR: g_r_custom_container,
         g_r_alv_grid.

  PERFORM create_field_catalog.
  PERFORM prepare_layout CHANGING l_s_layout.

  CREATE OBJECT g_r_custom_container
         EXPORTING container_name = g_container.

  CREATE OBJECT g_r_alv_grid
         EXPORTING i_parent = g_r_custom_container.

  CALL METHOD g_r_alv_grid->set_table_for_first_display
    EXPORTING
      is_layout          = l_s_layout
      i_bypassing_buffer = 'X'
    CHANGING
      it_outtab          = <tab>
      it_fieldcatalog    = g_t_fcat.
ENDFORM."

Former Member
0 Kudos

Hi

Use this statement in the else condition with the refreshed data.

CALL METHOD gr_alvgrid->refresh_table_display.

gr_alvgrid is the name of the ALV grid.

Hope this is wht u are looking for.

Prashant