<?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: on-the-fly WRITE when processing program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518513#M1424780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure where you are heading, but sounds like you could use FM &lt;STRONG&gt;SAPGUI_PROGRESS_INDICATOR&lt;/STRONG&gt;. This will display progress info on status bar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jan 2010 13:07:24 GMT</pubDate>
    <dc:creator>Sm1tje</dc:creator>
    <dc:date>2010-01-21T13:07:24Z</dc:date>
    <item>
      <title>on-the-fly WRITE when processing program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518512#M1424779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there dear UI specialists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to ask you if there is a possibility to display WRITEs on-the-fly during  the program flow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean for example&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF itab OCCURS 0,
        item_1(50) ,
      END OF itab .
DATA: line LIKE LINE OF itab .
 
DATA: ctr_i TYPE i .
DATA: ctr_c(3) .
 
ctr_i = 1 .
 
DO 5 TIMES .
  ctr_c = ctr_i .
  CLEAR line .
  CONCATENATE 'This is a' ctr_c 'line of log.'
  INTO line SEPARATED BY SPACE .
  ctr_i = ctr_i + 1 .
 
  APPEND line TO itab .
 
ENDDO .
 
LOOP AT itab INTO line .
  WAIT UP TO 1 SECONDS.
  WRITE / line-item_1 .
 
ENDLOOP .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that code will show an output list after 5 seconds and it looks like&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is a 1 line of log.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is a 2 line of log.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is a 3 line of log.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is a 4 line of log.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is a 5 line of log.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whilst &lt;STRONG&gt;I would like to display an empty screen when the program begins and populate it with each line every second&lt;/STRONG&gt;, so user would have the current log of program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to do with WRITE statement? Or maybe there is some other solution to reach such effect?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did a ALV_GRID -based solution, but I don't like it because to refresh grid I have to refresh screen with&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
      EXPORTING  FUNCTIONCODE = '/00'
      EXCEPTIONS FUNCTION_NOT_SUPPORTED = 1 .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;when each item is processed. So instead of LOOP I have to use READ statement then, because SAPGUI_SET_FUNCTIONCODE would probably break the LOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be thankful for help. Greetings. P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2010 12:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518512#M1424779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-21T12:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: on-the-fly WRITE when processing program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518513#M1424780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure where you are heading, but sounds like you could use FM &lt;STRONG&gt;SAPGUI_PROGRESS_INDICATOR&lt;/STRONG&gt;. This will display progress info on status bar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2010 13:07:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518513#M1424780</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2010-01-21T13:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: on-the-fly WRITE when processing program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518514#M1424781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; But in debugging mode see the list ouput and hit F5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2010 13:37:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518514#M1424781</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-21T13:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: on-the-fly WRITE when processing program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518515#M1424782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Micky Oestreich&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I would like the output to be "cumulated" and process indicator don't give me such functionality, I need sth like this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; after 1st second output looks like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is a 1 line of log.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; after 2nd second output looks like::&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is a 1 line of log.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is a 2 line of log.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; after 3rd second output looks like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is a 1 line of log.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is a 2 line of log.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is a 3 line of log.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... ... ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2010 13:55:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518515#M1424782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-21T13:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: on-the-fly WRITE when processing program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518516#M1424783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure that this is really user friendly, but you can do an auto-refresh on a list display.  Here is an example.   Copy this code and run the program. You can see that it will report that the job is running, then show you the log entries as they are added each time.  This is just an example program, but this should give you some idea of how you can refresh the display, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zrich_0001.

DATA: BEGIN OF itab OCCURS 0,
        item_1(50) ,
      END OF itab .
DATA: line LIKE LINE OF itab .

DATA: ctr_i TYPE i .
DATA: ctr_c(3) .

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler DEFINITION
*---------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION.

  PUBLIC SECTION.

    CLASS-METHODS: on_finished FOR EVENT finished OF cl_gui_timer.

ENDCLASS.                    "lcl_event_handler DEFINITION

DATA: lo_gui_timer TYPE REF TO cl_gui_timer.
DATA: lv_timeout TYPE i VALUE '3'.

START-OF-SELECTION.

  CREATE OBJECT lo_gui_timer.
  lo_gui_timer-&amp;gt;interval = lv_timeout.
  lo_gui_timer-&amp;gt;run( ).
  SET HANDLER lcl_event_handler=&amp;gt;on_finished FOR lo_gui_timer.

  ctr_i = 1 .

*  DO 5 TIMES .
*    ctr_c = ctr_i .
*    CLEAR line .
*    CONCATENATE 'This is a' ctr_c 'line of log.'
*    INTO line SEPARATED BY space .
*    ctr_i = ctr_i + 1 .
*    APPEND line TO itab .
*  ENDDO .

  WRITE:/ 'Job Running'.

AT USER-COMMAND.

  sy-lsind = sy-lsind - 1.

  WRITE:/ 'Job Running'.
  LOOP AT itab INTO line .
    WRITE / line-item_1 .
  ENDLOOP .

* Add another line for the next time we write.
  ctr_c = ctr_i .
  CLEAR line .
  CONCATENATE 'This is a' ctr_c 'line of log.'
  INTO line SEPARATED BY space .
  ctr_i = ctr_i + 1 .
  APPEND line TO itab .

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION.

  METHOD on_finished.

* Start Timer again
    lo_gui_timer-&amp;gt;interval = lv_timeout.
    lo_gui_timer-&amp;gt;run( ).

* cause PAI
    CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code
      EXPORTING
        new_code = 'REFR'.

  ENDMETHOD.                    "on_finished

ENDCLASS.                    "lcl_event_handler&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rich Heilman on Jan 21, 2010 8:59 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2010 13:58:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518516#M1424783</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2010-01-21T13:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: on-the-fly WRITE when processing program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518517#M1424784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was nice...Keep Rocking.&lt;/P&gt;&lt;P&gt;but all ther records are getting displayed when i hit enter and not one by one &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2010 14:49:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518517#M1424784</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-21T14:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: on-the-fly WRITE when processing program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518518#M1424785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich's demo worked for me... here's another example to prove "on-the-fly" writes can work... sorry for format but the 2,500 SDN char limit kills good style!&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
report zjc_sdn.
types:
begin of gtys_step,
step type sytabix,
start type syuzeit,
end type syuzeit,
text type sytitle,
end of gtys_step,
gtyt_step type table of gtys_step.
data:
gt_step type gtyt_step,
g_stop type sap_bool.
at user-command.perform user_command.
start-of-selection.
perform write_report.
set user-command 'ZREFRESH'."1st time
form user_command.
if g_stop = 'X'. exit.endif.
if sy-ucomm = 'ZREFRESH'.  perform do_next_step.  sy-lsind = sy-lsind - 1.  endif.
endform.
form do_next_step.
data:
  l_progress type sytitle, l_delay type sytabix, l_step_number type sytabix, l_top_line type sytabix, ls_step type gtys_step.
if not gt_step[] is initial.
l_top_line = lines( gt_step[] ).
read table gt_step into ls_step index l_top_line.
l_step_number = ls_step-step.
endif.
add 1 to l_step_number.
get time.
clear: ls_step.  ls_step-step = l_step_number.  ls_step-start = sy-uzeit.
write: l_step_number to ls_step-text left-justified.
case l_step_number.
when 1. ls_step-text = 'Fill@ the kettle'. l_delay = 1.
when 2. ls_step-text = 'Boil@ kettle'. l_delay = 5.
when 3. ls_step-text = 'Pour@ water'. l_delay = 1.
when 4. ls_step-text = 'Mash@ tea'. l_delay = 3.
when 5. ls_step-text = 'Add@ milk'. l_delay = 1.
endcase.
l_progress = ls_step-text.
replace '@' with 'ing' into l_progress.
translate l_progress+0(1) to lower case.
concatenate 'Busy' l_progress '...'
  into l_progress separated by space.
call function 'SAPGUI_PROGRESS_INDICATOR'
  exporting  text = l_progress.
call function 'ENQUE_SLEEP'
  exporting seconds = l_delay.
get time.
ls_step-end = sy-uzeit.
replace '@' with 'ed' into ls_step-text.
append ls_step to gt_step.
perform write_report.
call function 'SAPGUI_SET_FUNCTIONCODE'
exporting functioncode = '=ZREFRESH'
exceptions others= 0.
endform.
form write_report.
data: ls_step type gtys_step.
set pf-status '1000REFR'. "=Std + ZREFRESH (F8)
if not gt_step[] is initial.
loop at gt_step into ls_step.
  write: /  'Step', ls_step-step, ls_step-text, 'Started at:', ls_step-start, 'End at:', ls_step-end, at sy-linsz space.
  if ls_step-step ge 5. g_stop = 'X'. endif.
endloop.
if not g_stop is initial. write: / 'Ended'. endif.
else. write: / 'Started...'. endif.
endform.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 04:24:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518518#M1424785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-22T04:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: on-the-fly WRITE when processing program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518519#M1424786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;great tea jonathan...&lt;/P&gt;&lt;P&gt;Loved it.. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 11:43:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-the-fly-write-when-processing-program/m-p/6518519#M1424786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-05T11:43:50Z</dc:date>
    </item>
  </channel>
</rss>

