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: 

OO ALV refresh problem

Former Member
0 Kudos

I open an editable ALV report by pushing a button from main screen of my program.

The program reads data from database and prints them on OO editable ALV.

At the first time, there is no problem, I can edit fields and save them, no problem so far, but if i write sth on some editable fields and press BACK button without saving, and then again open the ALV from main screen, although i cleared everthing and read the data from db table, i still see the fields that i filled. They arent on the DB table becouse i didnt save before pushing BACK button and i cleared them.

I shouldnt see them after pushing BACK and opening ALV again.

I couldnt catch this problem at debug. I think i should clear some tables or areas but i couldnt be sure.

Anyone has ideas?

Thanks.

7 REPLIES 7

Former Member
0 Kudos

Hi,

I think, actually whenever you are going back and then coming again, those fields are not getting cleared and thus the value still exists in them. So, If you do not want to see the data filled in those fields: After BACK you have to use At USER COMMAND and clear them.

Thanks,

Venkatesh.

koolspy_ultimate
Active Contributor
0 Kudos

see the code for of back in gui status and in your code write at user command and clear the data there using refresh or clear.

0 Kudos

Refresh the Grid controls which you have defined for ALV when BACK/EXIT is pressed.

and reassign them again during ALV display for next time ...

Regards,

Seemanthini

Former Member
0 Kudos

hello ,

This problem is coming because ,you must not have cleared grid and container on click of Back button

use this code in PAI where you have handled Back

CALL METHOD <grid_name->free.

CALL METHOD cl_gui_cfw=>flush.

CALL METHOD <container_name>->free.

FREE: <grid_name->,<container_name>.

lijisusan_mathews
Active Contributor
0 Kudos

When you press the back button, perform a flush and free of your table container before performing the back operation.

Clemenss
Active Contributor
0 Kudos

Hi aydn,

you should register enter and modified event

ro_grid->register_edit_event( cl_gui_alv_grid=>mc_evt_enter ).
ro_grid->register_edit_event( cl_gui_alv_grid=>mc_evt_modified ).

also do not forget to call check changed data in every PAI

mo_grid->check_changed_data( ).

Also, after leaving the grid container it is not enough to free the data, please first call free method of voth the grid object and the container:

mo_grid->free( ).
mo_container->free( ).

Otherwise the new grid is hidden by the old one.

Regards

Clemens

Former Member
0 Kudos

I don´t know if you used the class CL_GUI_ALV_GRID to make the ALV.

If you really used, you can call the method refresh_table_display, after you call the method set_table_for_first_display.