<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: 3 timers in one program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807845#M1587802</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do create new instance of ALV on the events of refresh, it is timer that gives me trouble. I use one class and 3 methods for the 3 different timers. Two of the methods checks the database for new entries for in different Z custom tables and updates the ALV list on the screen. The 3rd one refreshes the screen every 10 mins. This program runs 24/7. &lt;/P&gt;&lt;P&gt;The declaration and the definitions are the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class zmm1_requests_metdef definition.&lt;/P&gt;&lt;P&gt;  public section.&lt;/P&gt;&lt;P&gt;    methods:&lt;/P&gt;&lt;P&gt;     handle_update_timer      for event finished of cl_gui_timer importing sender,&lt;/P&gt;&lt;P&gt;     handle_update_newentry   for event finished of cl_gui_timer importing sender,&lt;/P&gt;&lt;P&gt;     handle_update_wlan       for event finished of cl_gui_timer importing sender.&lt;/P&gt;&lt;P&gt;endclass.             &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;      gr_event_handler           type ref to zmm1_requests_metdef,&lt;/P&gt;&lt;P&gt;      gv_guitimer                     type ref to cl_gui_timer,&lt;/P&gt;&lt;P&gt;      gv_guitimer_newentry   type ref to cl_gui_timer,&lt;/P&gt;&lt;P&gt;      gv_guitimer_wlan           type ref to cl_gui_timer, &lt;/P&gt;&lt;P&gt;      gv_settime                      type i value 600,&lt;/P&gt;&lt;P&gt;      gv_settime_newentry     type i value 180,  &lt;/P&gt;&lt;P&gt;      gv_wlan_timer                type ref to cl_gui_timer,&lt;/P&gt;&lt;P&gt;      gv_wlanvalue                 type i value 20.    "20 seconds timer&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;create object gr_event_handler.&lt;/P&gt;&lt;P&gt;create object: gv_guitimer, gv_guitimer_newentry, gv_guitimer_wlan.&lt;/P&gt;&lt;P&gt;gv_guitimer_newentry-&amp;gt;interval = gv_settime_newentry.&lt;/P&gt;&lt;P&gt;gv_guitimer-&amp;gt;interval = gv_settime.&lt;/P&gt;&lt;P&gt;gv_guitimer_wlan-&amp;gt;interval = gv_wlanvalue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set handler gr_event_handler-&amp;gt;handle_update_newentry for gv_guitimer_newentry.&lt;/P&gt;&lt;P&gt;set handler gr_event_handler-&amp;gt;handle_update_timer for gv_guitimer.&lt;/P&gt;&lt;P&gt;set handler gr_event_handler-&amp;gt;handle_update_wlan for gv_guitimer_wlan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method gv_guitimer-&amp;gt;run( ).&lt;/P&gt;&lt;P&gt;call method gv_guitimer_newentry-&amp;gt;run( ).&lt;/P&gt;&lt;P&gt;call method gv_guitimer_wlan-&amp;gt;run( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The methods contain the entry check subroutines and the display forms. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erzsebet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Apr 2011 08:57:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-04-04T08:57:01Z</dc:date>
    <item>
      <title>3 timers in one program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807843#M1587800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a program which displays an ALV list on the screen and it is automatically update. For the update I use 3 timers with different intervals. The screen is updated regularly but after a while the timers with the shorter interval are kicked and are not working, only the timer with the biggest interval. I would like to know the followings: Why is this happening? Is there an way to work around it besides resetting the timers again? Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 08:39:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807843#M1587800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-01T08:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: 3 timers in one program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807844#M1587801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erzsebet Pirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no, it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure the timers raise events registered with same object instance, i.e. some code experts create new grid instance with refresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Post relevant code lines!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 12:19:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807844#M1587801</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-04-01T12:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: 3 timers in one program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807845#M1587802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do create new instance of ALV on the events of refresh, it is timer that gives me trouble. I use one class and 3 methods for the 3 different timers. Two of the methods checks the database for new entries for in different Z custom tables and updates the ALV list on the screen. The 3rd one refreshes the screen every 10 mins. This program runs 24/7. &lt;/P&gt;&lt;P&gt;The declaration and the definitions are the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class zmm1_requests_metdef definition.&lt;/P&gt;&lt;P&gt;  public section.&lt;/P&gt;&lt;P&gt;    methods:&lt;/P&gt;&lt;P&gt;     handle_update_timer      for event finished of cl_gui_timer importing sender,&lt;/P&gt;&lt;P&gt;     handle_update_newentry   for event finished of cl_gui_timer importing sender,&lt;/P&gt;&lt;P&gt;     handle_update_wlan       for event finished of cl_gui_timer importing sender.&lt;/P&gt;&lt;P&gt;endclass.             &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;      gr_event_handler           type ref to zmm1_requests_metdef,&lt;/P&gt;&lt;P&gt;      gv_guitimer                     type ref to cl_gui_timer,&lt;/P&gt;&lt;P&gt;      gv_guitimer_newentry   type ref to cl_gui_timer,&lt;/P&gt;&lt;P&gt;      gv_guitimer_wlan           type ref to cl_gui_timer, &lt;/P&gt;&lt;P&gt;      gv_settime                      type i value 600,&lt;/P&gt;&lt;P&gt;      gv_settime_newentry     type i value 180,  &lt;/P&gt;&lt;P&gt;      gv_wlan_timer                type ref to cl_gui_timer,&lt;/P&gt;&lt;P&gt;      gv_wlanvalue                 type i value 20.    "20 seconds timer&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;create object gr_event_handler.&lt;/P&gt;&lt;P&gt;create object: gv_guitimer, gv_guitimer_newentry, gv_guitimer_wlan.&lt;/P&gt;&lt;P&gt;gv_guitimer_newentry-&amp;gt;interval = gv_settime_newentry.&lt;/P&gt;&lt;P&gt;gv_guitimer-&amp;gt;interval = gv_settime.&lt;/P&gt;&lt;P&gt;gv_guitimer_wlan-&amp;gt;interval = gv_wlanvalue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set handler gr_event_handler-&amp;gt;handle_update_newentry for gv_guitimer_newentry.&lt;/P&gt;&lt;P&gt;set handler gr_event_handler-&amp;gt;handle_update_timer for gv_guitimer.&lt;/P&gt;&lt;P&gt;set handler gr_event_handler-&amp;gt;handle_update_wlan for gv_guitimer_wlan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method gv_guitimer-&amp;gt;run( ).&lt;/P&gt;&lt;P&gt;call method gv_guitimer_newentry-&amp;gt;run( ).&lt;/P&gt;&lt;P&gt;call method gv_guitimer_wlan-&amp;gt;run( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The methods contain the entry check subroutines and the display forms. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erzsebet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 08:57:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807845#M1587802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T08:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: 3 timers in one program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807846#M1587803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erzsebet,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK according to your un-formatted code you create three object instances for the timers. Now where is the handler instantiated and what is the code of the handler metods?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At least for performance reasons you should not create new ALV instances if the structure of the table displayed does not change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please do not forget to format the code lines using the &amp;amp;lt;&amp;amp;GT; button above. Also use Preview tab before posting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 09:10:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807846#M1587803</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-04-04T09:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: 3 timers in one program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807847#M1587804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clemenst!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code for the methods are almost the same, but the entry check is different. See below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method handle_update_newentry .
    if gv_update = '0'.
      gv_update = '1'.
      perform check_new_entry.
      if gv_newentry = '1'.
        if gv_subs_selektion-subd = 0201.
          perform display_whlists.
        call method gv_guitimer_newentry-&amp;gt;run( ).
        elseif gv_subs_selektion-subd = 0202.
          perform display_productionlist.
          call method gv_guitimer_newentry-&amp;gt;run( ).
        elseif gv_subs_selektion-subd = 0203.
          perform display_completelist.
          call method gv_guitimer_newentry-&amp;gt;run( ).
        endif.
        gv_newentry = '0'.
        gv_update   = '0'.
      elseif gv_newentry = '0'.
        gv_update = '0'.
        call method gv_guitimer_newentry-&amp;gt;run( ).
      endif.
    elseif gv_update = '1'.
      call method gv_guitimer_newentry-&amp;gt;run( ).
    endif.
  endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both only updates the internal table or the ALV if there is a new entry in the database. The handler first initiated after the first display and in the methods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Betty&lt;/P&gt;&lt;P&gt;(it is easier)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 09:40:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/3-timers-in-one-program/m-p/7807847#M1587804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T09:40:28Z</dc:date>
    </item>
  </channel>
</rss>

