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

Problem with ALV

Former Member
0 Likes
691

Hello experts,

i´ve a problem with an ALV.

The situation is:

I read some data from DB, pack them into an internal table call another dynpro and load them into the grid.


  CALL METHOD go_grid->set_table_for_first_display
    EXPORTING
      is_variant           = gs_layout
      i_save               = x_save
      i_default            = 'X'
      it_toolbar_excluding = pt_exclude
    CHANGING
      it_outtab            = it_vbeln[]
      it_fieldcatalog      = z_fieldcat.

The first call everything is okay. This time it_vbeln has one entry with 800000046.

But if i navigate back to the first screen and read other data put them into the table and call next window again.

Here i set a break point before calling:

CALL METHOD go_grid->set_table_for_first_display

This time it_vbeln has one entry with 800000042. Okay so far this is the new data.

After this call there is no additional code. The next thing is that the ALV appears on the screen.

BUT: With the entry 800000046!!!

If i make a refresh via the toolbar Button "Refresh"

The entry changes to 800000042.

Can someone tell me my fault?

Thank you

Points guaranted

4 REPLIES 4
Read only

Former Member
0 Likes
648

Hi, you should add following code into your program.

if gr_container is initial.

u2026u2026

call method go_grid->set_table_for_first_display

u2026u2026

else.

call method go_grid->refresh_table_display

exceptions

finished = 1

others = 2.

endif.

Read only

Former Member
0 Likes
648

Hi,

You have to write

grid1->refresh_table_diplay.

Aftr writing This I think it will work and also refer the program bcalv_grid_02.

Thanks

Ansuman

Read only

0 Likes
648

Hello,

if i use CALL METHOD go_grid->refresh_table_display in PAI before "leave Program" i get the following dump.

OBJECTS_OBJREF_NOT_ASSIGNED CX_SY_REF_IS_INITIAL

Read only

Former Member
0 Likes
648

Hello,

i solved the problem by calling the methods:

alv=>free

container=>free