Application Development and Automation 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: 
Read only

ECC6 - Refresh ALV grid

Former Member
0 Likes
603

Hi experts,

I have a dialog screen that will display a report in an ALV grid. I don't know what is wrong with my code. The ALV grid is not refreshed if I back out from the screen and go back in for the new data. It is displaying the data from the previous run. Please see code below.

Thanks,

Chuong


*** BEFORE THE ALV IS DISPLAYED ****

* create object
   CREATE OBJECT cust_contain_mass_ch_parm11
      EXPORTING container_name = 'CONTAINER_ALL'.

* create ALV grid
   CREATE OBJECT grid_mass_ch_parm11
        EXPORTING
          i_parent = cust_contain_mass_ch_parm11.


* Load data into the grid and display them
   CALL METHOD grid_mass_ch_parm11->set_table_for_first_display
    EXPORTING
              is_layout            = gs_layout_mass_ch
              it_toolbar_excluding = lt_exclude_mass_ch
    CHANGING  it_outtab            = itab_mass_ch
              it_fieldcatalog      = parm_fieldcat[] .


*** AFTER THE ALV IS DISPLAYED ****

       CALL METHOD cust_contain_mass_ch_parm11->free.
       CALL METHOD cl_gui_cfw=>flush.

Code Formatted by: Alvaro Tejada Galindo on Apr 22, 2008 6:07 PM

Hi experts,

I have a dialog screen that will display a report in an ALV grid. I don't know what is wrong with my code. The ALV grid is not refreshed if I back out from the screen and go back in for the new data. It is displaying the data from the previous run. Please see code below.

Thanks,

Chuong


*** BEFORE THE ALV IS DISPLAYED ****

* create object
   CREATE OBJECT cust_contain_mass_ch_parm11
      EXPORTING container_name = 'CONTAINER_ALL'.

* create ALV grid
   CREATE OBJECT grid_mass_ch_parm11
        EXPORTING
          i_parent = cust_contain_mass_ch_parm11.


* Load data into the grid and display them
   CALL METHOD grid_mass_ch_parm11->set_table_for_first_display
    EXPORTING
              is_layout            = gs_layout_mass_ch
              it_toolbar_excluding = lt_exclude_mass_ch
    CHANGING  it_outtab            = itab_mass_ch
              it_fieldcatalog      = parm_fieldcat[] .


*** AFTER THE ALV IS DISPLAYED ****

       CALL METHOD cust_contain_mass_ch_parm11->free.
       CALL METHOD cl_gui_cfw=>flush.

Code Formatted by: Alvaro Tejada Galindo on Apr 22, 2008 6:07 PM

3 REPLIES 3
Read only

former_member191735
Active Contributor
0 Likes
565

Which class are you using?

i mean what is the reference?

use Refresh method to refresh

Check out for refresh method in your class

Read only

Former Member
0 Likes
565

Hi,

Use a vairiable first_flag , that is set for the first time as 'X' and only first time, u create controls and Set_Table_for_first_display function. and make first_flag as blank. and now call refresh_table_display.

char first_flag type c value 'X'.

if first_flag = 'X'.

  • create object

CREATE OBJECT cust_contain_mass_ch_parm11

EXPORTING container_name = 'CONTAINER_ALL'.

  • create ALV grid

CREATE OBJECT grid_mass_ch_parm11

EXPORTING

i_parent = cust_contain_mass_ch_parm11.

  • Load data into the grid and display them

CALL METHOD grid_mass_ch_parm11->set_table_for_first_display

EXPORTING

is_layout = gs_layout_mass_ch

it_toolbar_excluding = lt_exclude_mass_ch

CHANGING it_outtab = itab_mass_ch

it_fieldcatalog = parm_fieldcat[] .

first_flag = ' '.

endif.

call function grid_mass_ch_parm11->refresh_table_display.

This should work.

Sheel.

Read only

Former Member
0 Likes
565

Hi,

Use a vairiable first_flag , that is set for the first time as 'X' and only first time, u create controls and Set_Table_for_first_display function. and make first_flag as blank. and now call refresh_table_display.

char first_flag type c value 'X'.

if first_flag = 'X'.

  • create object

CREATE OBJECT cust_contain_mass_ch_parm11

EXPORTING container_name = 'CONTAINER_ALL'.

  • create ALV grid

CREATE OBJECT grid_mass_ch_parm11

EXPORTING

i_parent = cust_contain_mass_ch_parm11.

  • Load data into the grid and display them

CALL METHOD grid_mass_ch_parm11->set_table_for_first_display

EXPORTING

is_layout = gs_layout_mass_ch

it_toolbar_excluding = lt_exclude_mass_ch

CHANGING it_outtab = itab_mass_ch

it_fieldcatalog = parm_fieldcat[] .

first_flag = ' '.

endif.

call function grid_mass_ch_parm11->refresh_table_display.

This should work.

Sheel.