Skip to Content
0
Former Member
Jul 02, 2014 at 01:53 PM

Troubles with ALV set_table_for_first_display

85 Views

Hello people,

I am facing an interesting problem. I want do display data from an internal table on an ALV grid. So far, so good, When I am trying do do so again with different recordsets, the ALV displays the data from the first attemp again.

e.g.:

data of itab:

line 1: 1001 | some text in this column

line 2: 1002 | some other text

my_grid->set_table_for_first_display

exporting

is_layout = gc_layout

it_toolbar_excluding = lt_exclude

changing

it_outtab = itab

it_fieldcatalog = my_fieldcat

).

what is displayed on ALV?

line 1: 1001 | some text in this column

line 2: 1002 | some other text

Now, the data in itab changes and the reference to my_grid gets killed with: CLEAR my_grid.

data of itab:

line 1: 2001 | completely different data

again: create object my_alvgrid.....

my_grid->set_table_for_first_display

exporting

is_layout = gc_layout

it_toolbar_excluding = lt_exclude

changing

it_outtab = itab

it_fieldcatalog = my_fieldcat

).

what is displayed on ALV?

line 1: 1001 | some text in this column

line 2: 1002 | some other text

Any suggestions?

regards

Markus