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

Update ALV after database is changed from another program

Former Member
0 Likes
704

Hi everybody,

I have an ALV OO, and the data showed in that ALV can be changed from another Z program. Is there any way to automatically update my ALV when the data is changed from the other program? Something like tha ALV program could be waiting for an event, and that event is launched from the updating program when  it updates the database....

Thanks in advance.

4 REPLIES 4
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
603

The ALV program picks the data from the table with updated values( from another program ). Instead of events or communication between 2 programs, why not try a auto refresh http://www.erpgenie.com/abaptips/content/view/346/33/ of ALV for a period of time. This makes it very easy

Read only

Kartik2
Contributor
0 Likes
603

Dear Jose Beiro,

As far as I know, there is no event in SAP which gets triggered on a general data base update. So if you want you may handle events in ALV, like on user enter you may check for the new data, if there is any change in the data, then you may build your internal table again and refresh the ALV table which will display the new data.

Hope it helps, Thank you.

Regards,

kartik

Read only

RaymondGiuseppi
Active Contributor
0 Likes
603

You could try to use such an event to refresh the display, then when handling the event look for a change in database since last display, if available look at CDHDR or DBTABLOG depending of the data you display.

For the refresh raising event search scn for cl_gui_timer for disussions or documents like Automatic Data Refresh on Module pool Screen.

Regards,

Raymond

Read only

Former Member
0 Likes
603

I have situations where the user can modify or delete rows in a table, based on ALV functions.  For my needs, I clear the ALV table immediately afterward, call my routine that grabbed the data for the table, sort it and do an ALV refresh.  Works very well for me.  However, if the data is changed by something other than a process called by the ALV, this would not work.  In one case, I have a refresh button that does the same thing (dump, rebuild the table and refresh the ALV), to allow the user to see what was changed by use of another program in another session.