<?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: ABAP - Timer and Auto-refresh in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716191#M33211</link>
    <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; Thank you very much for your reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2018 08:13:14 GMT</pubDate>
    <dc:creator>bzakaria</dc:creator>
    <dc:date>2018-12-11T08:13:14Z</dc:date>
    <item>
      <title>ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716182#M33202</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt; I would like to create a program whose fields of time are refreshed via a timer.&lt;/P&gt;
  &lt;P&gt; the code works very well, and it refreshes the time. but the problem is that all the fields and the screen are refreshed, and I would like the first field of time that refreshed without the rest of the fields.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/246361-capturetimer.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Code : &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;REPORT ZTESTTIMER.

PARAMETERS : time type t DEFAULT 300.
PARAMETERS : Name type STRING.
PARAMETERS : City type STRING.
PARAMETERS : Phone type STRING.

CLASS my DEFINITION.

PUBLIC SECTION.

METHODS : run_handler FOR EVENT finished OF cl_gui_timer.

ENDCLASS.

DATA timer TYPE REF TO cl_gui_timer.
DATA myh TYPE REF TO my.

CLASS my IMPLEMENTATION.
METHOD run_handler.

CALL METHOD timer-&amp;gt;run.

call method CL_GUI_CFW=&amp;gt;SET_NEW_OK_CODE
EXPORTING
new_code = 'REFR'.
ENDMETHOD.

ENDCLASS.

at SELECTION-SCREEN OUTPUT.
time = time - 1.

CREATE OBJECT timer.
CREATE OBJECT myh.
timer-&amp;gt;interval = '1'.
CALL METHOD timer-&amp;gt;run.
SET HANDLER myh-&amp;gt;run_handler FOR ALL INSTANCES.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Nov 2018 17:27:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716182#M33202</guid>
      <dc:creator>bzakaria</dc:creator>
      <dc:date>2018-11-30T17:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716183#M33203</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I know this is a demo report, but please don't use CALL METHOD for static method call, or CREATE OBJECT!&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ztimer.
CLASS my DEFINITION.
  PUBLIC SECTION.
    METHODS: run_handler FOR EVENT finished OF cl_gui_timer.
ENDCLASS.

DATA timer TYPE REF TO cl_gui_timer.
DATA myh TYPE REF TO my.

SELECTION-SCREEN: BEGIN OF BLOCK bl1 WITH FRAME.
PARAMETERS: time  TYPE t DEFAULT 300.
PARAMETERS: name  TYPE string.
PARAMETERS: city  TYPE string.
PARAMETERS: phone TYPE string.
SELECTION-SCREEN: END OF BLOCK bl1.

AT SELECTION-SCREEN OUTPUT.
  time = time - 1.

  IF timer IS INITIAL.
    timer = NEW #( ).
    myh   = NEW #( ).
    SET HANDLER myh-&amp;gt;run_handler FOR ALL INSTANCES.

    timer-&amp;gt;interval = '1'.
    timer-&amp;gt;run( ).

  ENDIF.

START-OF-SELECTION.

END-OF-SELECTION.

CLASS my IMPLEMENTATION.

  METHOD run_handler.
    cl_gui_cfw=&amp;gt;set_new_ok_code( 'REFR' ).
    timer-&amp;gt;run( ).
  ENDMETHOD.

ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Since cl_gui_cfw=&amp;gt;set_new_ok_code will trigger a PAI/PBO, the dynpro gets refreshed, there is no other way!&lt;/P&gt;&lt;P&gt;But you could put the countdown field to a HTML control an only refresh this HTML or better do the countdown with javascript and only tigger the PAI at the end of the countdown!&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;Domi&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 20:22:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716183#M33203</guid>
      <dc:creator>Domi</dc:creator>
      <dc:date>2018-11-30T20:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716184#M33204</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;dominik.bigl2&lt;/SPAN&gt; thank you for your reply. &lt;/P&gt;&lt;P&gt;Could you guide me how I can refresh that HTML control without the rest of the components. (because I'm still a beginner in abap).&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 12:38:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716184#M33204</guid>
      <dc:creator>bzakaria</dc:creator>
      <dc:date>2018-12-02T12:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716185#M33205</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;bzakaria&lt;/SPAN&gt; the timer is to be implemented in javascript inside the html page, not in abap : &lt;A href="https://www.w3schools.com/js/js_timing.asp"&gt;https://www.w3schools.com/js/js_timing.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;+ javascript "submit" (of an HTML form) at the end of the countdown, to trigger ABAP code.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 13:38:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716185#M33205</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-12-02T13:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716186#M33206</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;  thank you for your reply,&lt;/P&gt;&lt;P&gt;In fact, i wish to execute queries and calculations by the timer, and the countdown is just to test the timer and auto-refresh ! &lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 15:08:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716186#M33206</guid>
      <dc:creator>bzakaria</dc:creator>
      <dc:date>2018-12-02T15:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716187#M33207</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;bzakaria&lt;/SPAN&gt; so your screen contains one part with some input fields that you don't want be refreshed, and another part which contains output fields which are recalculated in ABAP every X seconds and refreshed. &lt;/P&gt;&lt;P&gt;Are they recalculated based on the input fields? If so, the problem is to know how you can get the input values without enterfering with the current input. Instead, I guess that you want something like the input field for entering an object name in the SE80 repository browser, which automatically outputs the list of matching object names after one or more characters have been pressed. The input fields should not be in the dynpro but in the HTML form, and the output fields can be anywhere else. Moreover, your ABAP code would be triggered by the timer, not by the keyboard.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:49:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716187#M33207</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-12-02T16:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716188#M33208</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;bzakaria&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Have a look at report SAPHTML_EVENTS_DEMO. With this report and the link by  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;  you can implement your requirement!&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Domi&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 17:00:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716188#M33208</guid>
      <dc:creator>Domi</dc:creator>
      <dc:date>2018-12-02T17:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716189#M33209</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;No they will not be calculated based on the input fields, but by request independent of the other fields. &lt;/P&gt;&lt;P&gt;After each x seconds I will execute querie (example: read a field from a table filled by other programs) and I display the result in the field that will be refreshed.&lt;/P&gt;&lt;P&gt;Example : display in real time the number of items sold.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 22:34:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716189#M33209</guid>
      <dc:creator>bzakaria</dc:creator>
      <dc:date>2018-12-02T22:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716190#M33210</link>
      <description>&lt;P&gt;okay, with dynpro the result below is just awful, I recommend to use web browser solutions only (SAPUI5), forget dynpros.&lt;/P&gt;&lt;P&gt;The following two "awful" demos refresh data from the table of banks (transaction code FI01 to create or FI02 to maintain them)&lt;/P&gt;&lt;P&gt;This one with input fields in a dynpro:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA timer TYPE REF TO cl_gui_timer.

CLASS my DEFINITION.
  PUBLIC SECTION.
    METHODS pbo.
  PRIVATE SECTION.
    METHODS:
      run_handler FOR EVENT finished OF cl_gui_timer,
      init_alv,
      reload_alv.
    DATA: gt_output  TYPE STANDARD TABLE OF bnka,
          salv       TYPE REF TO cl_salv_table,
          go_docking TYPE REF TO cl_gui_docking_container.
ENDCLASS.

SELECTION-SCREEN: BEGIN OF BLOCK bl1 WITH FRAME.
PARAMETERS: name  TYPE string.
PARAMETERS: city  TYPE string.
PARAMETERS: phone TYPE string.
SELECTION-SCREEN: END OF BLOCK bl1.

CLASS my IMPLEMENTATION.
  METHOD pbo.
    IF timer IS INITIAL.
      " FIRST TIME ONLY
      timer = NEW #( ).
      SET HANDLER run_handler FOR timer.
      timer-&amp;gt;interval = 1.
      timer-&amp;gt;run( ).

      init_alv( ).
    ENDIF.
  ENDMETHOD.

  METHOD init_alv.
    CREATE OBJECT go_docking
      EXPORTING
        repid                       = sy-repid
        dynnr                       = sy-dynnr
        side                        = go_docking-&amp;gt;DOCK_AT_LEFT
        extension                   = 180.
    CALL METHOD cl_salv_table=&amp;gt;factory
      EXPORTING
        r_container  = go_docking
      IMPORTING
        r_salv_table = salv
      CHANGING
        t_table      = gt_output[].
    salv-&amp;gt;display( ).
    reload_alv( ).
  ENDMETHOD.

  METHOD run_handler.
    reload_alv( ).
    timer-&amp;gt;run( ).
  ENDMETHOD.

  METHOD reload_alv.
    SELECT * FROM bnka INTO TABLE @gt_output.
    salv-&amp;gt;refresh( s_stable = VALUE #( row = abap_true col = abap_true ) ).
  ENDMETHOD.

ENDCLASS.

LOAD-OF-PROGRAM.
  DATA(myh) = NEW my( ).

AT SELECTION-SCREEN OUTPUT.
  myh-&amp;gt;pbo( ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This one with input fields in a web browser:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA timer TYPE REF TO cl_gui_timer.

CLASS my DEFINITION.
  PUBLIC SECTION.
    METHODS pbo.
  PRIVATE SECTION.
    METHODS:
      run_handler FOR EVENT finished OF cl_gui_timer,
      init_alv,
      reload_alv.
    DATA: gt_output   TYPE STANDARD TABLE OF bnka,
          salv        TYPE REF TO cl_salv_table,
          go_splitter TYPE REF TO cl_gui_easy_splitter_container.
ENDCLASS.

PARAMETERS dummy.

CLASS my IMPLEMENTATION.

  METHOD pbo.
    IF timer IS INITIAL.
      " FIRST TIME ONLY
      timer = NEW #( ).
      SET HANDLER run_handler FOR timer.
      timer-&amp;gt;interval = 1.
      timer-&amp;gt;run( ).
      init_alv( ).
    ENDIF.
  ENDMETHOD.

  METHOD init_alv.
    CREATE OBJECT go_splitter
      EXPORTING
        parent      = cl_gui_container=&amp;gt;screen0
        orientation = cl_gui_easy_splitter_container=&amp;gt;orientation_horizontal.
    CALL METHOD cl_salv_table=&amp;gt;factory
      EXPORTING
        r_container  = go_splitter-&amp;gt;top_left_container
      IMPORTING
        r_salv_table = salv
      CHANGING
        t_table      = gt_output[].
    salv-&amp;gt;display( ).
    reload_alv( ).
    cl_abap_browser=&amp;gt;show_html( html_string = `&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;Type something: &amp;lt;input&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;` container = go_splitter-&amp;gt;bottom_right_container ).
  ENDMETHOD.

  METHOD run_handler.
    reload_alv( ).
    timer-&amp;gt;run( ).
  ENDMETHOD.

  METHOD reload_alv.
    SELECT * FROM bnka INTO TABLE @gt_output.
    salv-&amp;gt;refresh( s_stable = VALUE #( row = abap_true col = abap_true ) ).
  ENDMETHOD.

ENDCLASS.

LOAD-OF-PROGRAM.
  DATA(myh) = NEW my( ).

AT SELECTION-SCREEN OUTPUT.
  myh-&amp;gt;pbo( ).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2018 08:25:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716190#M33210</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-12-03T08:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP - Timer and Auto-refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716191#M33211</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; Thank you very much for your reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 08:13:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timer-and-auto-refresh/m-p/716191#M33211</guid>
      <dc:creator>bzakaria</dc:creator>
      <dc:date>2018-12-11T08:13:14Z</dc:date>
    </item>
  </channel>
</rss>

