<?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>Question Re: Clear Script/Function/Interval on leave page in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaa-p/12278657#M4600162</link>
    <description>&lt;P&gt;Hi Julian,&lt;/P&gt;&lt;P&gt;You need to leverage the window clearInterval() method to cancel the timer in case the context changes. &lt;/P&gt;&lt;P&gt;You can read and store the ABAP program/number pair through the scripting API and compare the context in an onAfterRefresh script. If the context has changed, call the clearInterval method with the given timer ID to cancel the scheduler.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Krists Magons&lt;/P&gt;&lt;P&gt;SAP Screen Personas Dev Team&lt;/P&gt;</description>
    <pubDate>Mon, 14 Sep 2020 12:38:55 GMT</pubDate>
    <dc:creator>kmagons</dc:creator>
    <dc:date>2020-09-14T12:38:55Z</dc:date>
    <item>
      <title>Clear Script/Function/Interval on leave page</title>
      <link>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaq-p/12278656</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;
  &lt;P&gt;I'm running a script with sets an interval to reload an alv every x minutes.&lt;/P&gt;
  &lt;P&gt;I now have the problem, that the function/script still seems to run, even when I route to another page of the flavor.&lt;/P&gt;
  &lt;P&gt;This is the error i get:&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1845543-awfafwad.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;
  &lt;P&gt;And the pages leaves in this loading state until I refresh with F5.&lt;/P&gt;
  &lt;P&gt;Any tips?&lt;/P&gt;
  &lt;P&gt;Regards,&lt;BR /&gt;Julian&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 12:24:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaq-p/12278656</guid>
      <dc:creator>jmoeller</dc:creator>
      <dc:date>2020-09-14T12:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Clear Script/Function/Interval on leave page</title>
      <link>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaa-p/12278657#M4600162</link>
      <description>&lt;P&gt;Hi Julian,&lt;/P&gt;&lt;P&gt;You need to leverage the window clearInterval() method to cancel the timer in case the context changes. &lt;/P&gt;&lt;P&gt;You can read and store the ABAP program/number pair through the scripting API and compare the context in an onAfterRefresh script. If the context has changed, call the clearInterval method with the given timer ID to cancel the scheduler.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Krists Magons&lt;/P&gt;&lt;P&gt;SAP Screen Personas Dev Team&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 12:38:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaa-p/12278657#M4600162</guid>
      <dc:creator>kmagons</dc:creator>
      <dc:date>2020-09-14T12:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Clear Script/Function/Interval on leave page</title>
      <link>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaa-p/12278658#M4600163</link>
      <description>&lt;P&gt;Hi Krists,&lt;/P&gt;&lt;P&gt;thanks for your fast reply. So, my futher questions are:&lt;/P&gt;&lt;P&gt;1.) Were do I get the ABAP program/number pair from?&lt;/P&gt;&lt;P&gt;2.) Do I have to call the onAfterRefresh of the current or next screen?&lt;/P&gt;&lt;P&gt;3.) I don't see where I can give my timer an ID. Where can I set this?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Julian&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 13:49:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaa-p/12278658#M4600163</guid>
      <dc:creator>jmoeller</dc:creator>
      <dc:date>2020-09-14T13:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Clear Script/Function/Interval on leave page</title>
      <link>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaa-p/12278659#M4600164</link>
      <description>&lt;P&gt;Hi Julian,&lt;/P&gt;&lt;P&gt;I think, it would be faster to have a call tomorrow or some other day. Please send me an e-mail to: krists.magons@sap.com and we will set-up a screen sharing session.&lt;/P&gt;&lt;P&gt;Thank you! &lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 13:55:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/clear-script-function-interval-on-leave-page/qaa-p/12278659#M4600164</guid>
      <dc:creator>kmagons</dc:creator>
      <dc:date>2020-09-14T13:55:08Z</dc:date>
    </item>
  </channel>
</rss>

