‎2008 Mar 08 3:17 PM
Hi.
I build a report to show with SALV some lines with information about PP-orders.
If the user use the Refresh-Button he see newest status of all orders. But now they want a automatically refresh. Every 30 minutes it should happens a refresh without any manual handling. I have no idea in which way I should realize this function.
Has anyone an idea?
Thx.
‎2008 Mar 08 10:11 PM
You might like to check out the ABAP "cl_gui_timer" class to do this e.g. see
Also, below is a sample program I posted a while ago which might help you too with the "old" way of doing this.
cheers
Jonathan
report zlocal_auto_refresh no standard page heading.
data:
begin of gs_step,
uzeit like sy-uzeit,
step like sy-tabix,
start_end(10) type c,
end of gs_step,
gt_step like gs_step occurs 10,
g_step_number like sy-tabix.
*=======================================================================
Events
*=======================================================================
at user-command.
perform user_command.
*=======================================================================
Mainline
*=======================================================================
start-of-selection.
perform start_of_report.
end-of-selection.
&---------------------------------------------------------------------
*& Form start_of_report
&---------------------------------------------------------------------
form start_of_report.
set pf-status '1000LIST'. "contains ZREFRESH ucomm
perform run_a_step.
endform. "start_of_report
&---------------------------------------------------------------------
*& Form run_a_step
&---------------------------------------------------------------------
form run_a_step.
*" Demo with something that takes some time, like sleeping...
data:
ls_step like gs_step.
add 1 to g_step_number.
if g_step_number > 9.
stop.
endif.
get time.
clear: ls_step.
ls_step-step = g_step_number.
ls_step-uzeit = sy-uzeit.
ls_step-start_end = 'Starting'.
append ls_step to gt_step.
* generate a delay for demo
call function 'ENQUE_SLEEP'
exporting
seconds = 1
exceptions
others = 0.
get time.
clear: ls_step.
ls_step-step = g_step_number.
ls_step-uzeit = sy-uzeit.
ls_step-start_end = 'Ended'.
append ls_step to gt_step.
format reset.
format color col_normal.
loop at gt_step into ls_step.
write: /
ls_step-uzeit,
ls_step-start_end,
ls_step-step,
at sy-linsz space.
endloop.
uline.
call function 'RFC_PING'
starting new task 'NEWTASK'
performing when_back on end of task.
endform. "run_a_step
&---------------------------------------------------------------------
*& Form when_back
&---------------------------------------------------------------------
form when_back
using
i_taskname type any.
receive results from function 'RFC_PING'.
set user-command 'ZREFRESH'. "act like user pressed something
endform. "when_back
&---------------------------------------------------------------------
*& Form user_command
&---------------------------------------------------------------------
form user_command.
case sy-ucomm.
when 'ZREFRESH'.
perform run_a_step.
sy-lsind = sy-lsind - 1.
endcase.
endform. "user_command[/code]
‎2008 Mar 10 5:45 AM
Hi,
Use CL_GUI_TIMER class.it will solve your requierment.
L.Velu