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: 

refresh data in alv automaticly

former_member353207
Participant
0 Kudos
233

Hi,

I've an alv with a Z-Table. Data changes currently. I want the alv refreshing automaticly by every data-change (made by another program). I don't want to push a key.

a timer would be a solution, bu only the second-best.

Any ideas ?

Regards Joerg

1 ACCEPTED SOLUTION

eyal_alsheikh
Active Participant
0 Kudos
105

Hi,

I think you can use class CL_GUI_TIMER to implement

timer in your program.

Eyal.

13 REPLIES 13

eyal_alsheikh
Active Participant
0 Kudos
106

Hi,

I think you can use class CL_GUI_TIMER to implement

timer in your program.

Eyal.

FredericGirod
Active Contributor
0 Kudos
105

Hi Joerg,

look at : /people/rich.heilman2/blog/2005/10/18/a-look-at-clguitimer-in-46c

Regards

Frédéric

0 Kudos
105

Thanks all,

this works well with timer solution. good but not perfect.

Any ideas how to register an event on my z-table for every data-change an send it to my program ?

Joerg

0 Kudos
105

Hi

Can you paste your code.

so that I can see and let you know.

Regards

vijay

0 Kudos
105

In technical setting (SE11), you have an option: Log data change.

Maybe read the documentation.

But I'm not sure you could have an event, you could only create a log, and check in the log if something append to the table.

0 Kudos
105

Joerg,

Try using the Method '<b>REFRESH_TABLE_DISPLAY</b>' present in the class 'CL_GUI_ALV_GRID'.

I hope this method would help.

Thanks

Kam

former_member188685
Active Contributor
0 Kudos
105

Hi

when ever there is a data change for refresh

you need to register an event

CALL METHOD G_GRID->REGISTER_EDIT_EVENT

EXPORTING

I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.

then in that event You call method refresh

this will automatically refreshes.

regards

vijay

0 Kudos
105

Vijay,

this is only 'normal' alv-code in PBO of dynpro '100':

DATA: ok_code LIKE sy-ucomm,

gt_meld TYPE TABLE OF zmeldung,

g_container TYPE scrfname VALUE 'ALV1',

grid1 TYPE REF TO cl_gui_alv_grid,

g_custom_container TYPE REF TO cl_gui_custom_container.

...

IF g_custom_container IS INITIAL.

CREATE OBJECT g_custom_container

EXPORTING container_name = g_container.

CREATE OBJECT grid1

EXPORTING i_parent = g_custom_container.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'ZMELDUNG'

CHANGING

it_outtab = gt_meld.

ENDIF.

....

Joerg

0 Kudos
105

Joerg,

Modify the code as follows:

IF g_custom_container IS INITIAL.

CREATE OBJECT g_custom_container

EXPORTING container_name = g_container.

CREATE OBJECT grid1

EXPORTING i_parent = g_custom_container.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'ZMELDUNG'

CHANGING

it_outtab = gt_meld.

<b>ELSE.

CALL METHOD GRID1->REFRESH_TABLE_DISPLAY.</b>

ENDIF.

Thanks,

Kam

0 Kudos
105

Kam,

thanks, good idea. But it only works on new cycle PBO.

Maybe I try this in combination with Cl_Gui_Timer Class.

(Link posted from Frédéric)

Joerg

0 Kudos
105

Joerg,

Let me know if u require more help.

Thanks

Kam

Former Member
0 Kudos
105

hi you can do that by...RFC_PING_AND_WAIT

Message was edited by: Anid

abdul_hakim
Active Contributor
0 Kudos
105

Hi

use REFRESH_TABLE_DISPLAY.

Check the below program also..

BCALV_GRID_02

Abdul