Skip to Content

CL_GUI_TIMER

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?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Feb 24, 2004 at 09:37 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Posted on Feb 25, 2004 at 01:08 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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