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: 

CALL METHOD ob_grid1->set_table_for_first_display does not change display

Former Member
0 Kudos

Dear experts,

I'm using CALL METHOD ob_grid1->set_table_for_first_display, during the first run the display is ok.

When I back to screen 0 and enter different values and re-run, the values of internal table has been changed.

But the second run still display the values I have during the first run. What could be the reason for this and how to solve this? Thanks.

IF ob_custom1 IS INITIAL.

CREATE OBJECT ob_custom1

EXPORTING

container_name = 'ALV_CONTAINER'.

ENDIF.

IF ob_split1 IS INITIAL.

CREATE OBJECT ob_split1

EXPORTING

parent = ob_custom1

orientation = cl_gui_easy_splitter_container=>orientation_vertical.

ENDIF.

IF ob_grid1 IS INITIAL.

CREATE OBJECT ob_grid1

EXPORTING

i_parent = ob_split1->top_left_container.

PERFORM build_fieldcatalog.

gs_layout1-info_fname = 'ROWCOLOR'.

gs_layout1-smalltitle = 'X'.

CALL METHOD ob_grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'T_REPORT'

is_layout = gs_layout1

CHANGING

it_outtab = T_REPORT

it_fieldcatalog = alv_fcat_dock1.

ENDIF.

Kath

3 REPLIES 3

Former Member
0 Kudos

hi,

did you call the method REFRESH_TABLE_DISPLAY.

after set_table_for_first display.

regards,

Sakshi jain

jj
Active Contributor
0 Kudos

On back action, you free the control objects., then only IF ob_custom1 IS INITIAL. checks will work

Former Member
0 Kudos

Hi,

Please add the code after else statement.

IF ob_grid1 IS INITIAL.
      CREATE OBJECT ob_grid1
         EXPORTING
             i_parent = ob_split1->top_left_container.

        PERFORM build_fieldcatalog.

gs_layout1-info_fname = 'ROWCOLOR'.
gs_layout1-smalltitle = 'X'.

CALL METHOD ob_grid1->set_table_for_first_display
       EXPORTING
         i_structure_name = 'T_REPORT'
         is_layout = gs_layout1
      CHANGING
         it_outtab = T_REPORT
         it_fieldcatalog = alv_fcat_dock1.
ELSE.                                                               " Add
     Call method refersh table for display.        " Add
ENDIF.