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: 

CL_GUI_TIMER

gerwin_borkowsky
Explorer
0 Kudos

Hi,

I have a great problem with the class CL_GUI_TIMER. We want to use this class to refresh a CL_GUI_ALV_GRID after i.e. 10 seconds. Therefore I wrote an eventhandler which reacts on the event FINISHED of the timer by refreshing the grid an starting the timer once again. But when a modal windows was opened then framework seems to block the event (it's a system event) an the timer stops. I've enhanced the timer to react on the event himself but that doesn't help.

Have anybody a solution for this problem?

4 REPLIES 4

Former Member
0 Kudos

The following is untested but I recall doing something like it in the past.

At the end of your PAI logic:

CALL FUNCTION 'RZL_SLEEP'

STARTING NEW TASK 'TIMER'

PERFORMING timer_finished ON END OF TASK

...

FORM timer_finished USING taskid.

SET USER-COMMAND 'REFRESH'.

ENDFORM.

Obviously you need to handle PAI function code REFRESH. Can't recall whether SET USER-COMMAND works in this context (it is intended for interactive reporting), but if not you should be able to use function module SAPGUI_SET_FUNCTIONCODE.

Cheers,

Scott

0 Kudos

Hi Scott,

that does work until I create an object(container or grid). I tried Set user-command, sapgui_set_funtioncode an cl_gui_cfw=>set_new_ok_code but nothing works.

Anyway, thanks for answering.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

We had the same problem with the SAP timer. We opened a problem with SAP through OSS but got a response that the Timer was working as designed. Our solution was to create our own timer ActiveX control in Visual Basic. We created our timer to automatically reset itself after it fires its event. This way if the Control Framework is blocked (by a modal window or other processing) you will miss the events that fire during that time, but the timer will keep on firing. You will have to create your own proxy class for the new control. To do this you can study the existing SAP proxy classes. The hardest part is distributing the ActiveX control to all the frontend PCs. To get around this we loaded the Control installer into the Mime repository. If the proxy class can't instantiate the control, we download the installer using the function module DOWNLOAD_WEB_OBJECT and start the installation.

0 Kudos

Hi Thomas,

> We had the same problem with the SAP timer. We

> opened a problem with SAP through OSS but got a

> response that the Timer was working as designed. Our

I'm still waiting on the answer to my ticket. I think I now know the content of the response.

[workaround]

Thanks, that's a nice idea.

Gerwin