ABAP Timers and Auto-refresh
This ABAP program will automatically update a report every
30 seconds while it is on the screen
Submitted by : SAP Basis, ABAP Programming and Other IMG Stuff http://www.erpgreat.com First, create a function module in SE37 to wait 30 seconds. Make sure the function attribute is marked as RFC capable. (in the Processing type section - tick Remote-enabled module) FUNCTION Z_WAIT_30_SECS. DATA: ZTIME LIKE SY-UZEIT. GET TIME. ZTIME = SY-UZEIT + 30. DO. GET TIME. IF SY-UZEIT >= ZTIME. EXIT. ENDIF. ENDDO. ENDFUNCTION. Then create this test program. REPORT ZREFRESH LINE-SIZE 132 no standard page heading. DATA: ZNUM LIKE SY-TABIX. GET TIME. WRITE: /01 'Update Number:', ZNUM, SY-UZEIT. CALL FUNCTION 'Z_WAIT_30_SECS' STARTING NEW TASK 'IF' PERFORMING START_REFRESH ON END OF TASK. AT USER-COMMAND. IF SY-UCOMM = 'REFR'. SY-LSIND = SY-LSIND - 1. ADD 1 TO ZNUM. GET TIME. WRITE: /01 'Update Number:', ZNUM, SY-UZEIT. CALL FUNCTION 'Z_WAIT_30_SECS' STARTING NEW TASK 'IF' PERFORMING START_REFRESH ON END OF TASK. ENDIF. *---------------------------------------------------------------- * Program Subroutines *---------------------------------------------------------------- FORM START_REFRESH USING TASKNAME. * The SET USER-COMMAND initiates the communication back to the program SET USER-COMMAND 'REFR'. ENDFORM.*-- End of Program
Read Also
ABAP Books
More ABAP Tips
SAP ERP Modules, Basis, ABAP and Other IMG Stuff All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|