Skip to Content

Progress Indicator being removed

I have an application where the user is required to read an external document displayed in an HTML Viewer. I've scratched my head over how to determine if they have read it and have come to the conclusion that you can't as such. What I am now doing is disabling all functionality apart from scrolling in the HTML viewer and waiting 2 minutes, displaying a progress indicator every 1.2 seconds or so. ( ie 100 * 1.2 = 120 2 minutes plus a full stopwatch).

However, when I use the cl_gui_Timer class it appears to generate a PAI during the timer finished event and instantly clears the progress indicator from the screen. When I change that to a remote call to ENQUE_SLEEP when the at end of task method is called (which calls the cl_Progress_Indicator=>Progress_Indicate method I get a short dump RPERF_ILLEGAL_STATEMENT telling me that the function SAPGUI_PROGRESS_INDICATOR was probably called in a field or conversion exit (???) (SPI Is called by the method above).

So, does anyone know of another technique to get a timer displayed on the screen which does not result in a short dump or a PAI ??

Thanks,

Regards

Rich

ps: Trying to select a primary tag is not working - all matching tags are displayed as lines....

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 20, 2017 at 12:36 PM
    PARAMETERS counter TYPE i.
    
    CLASS lcl_app DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS on_timer_finished FOR EVENT finished OF cl_gui_timer.
        CLASS-DATA mcounter TYPE i.
    ENDCLASS."
    
    DATA go_app TYPE REF TO lcl_app.
    DATA go_timer TYPE REF TO cl_gui_timer.
    
    AT SELECTION-SCREEN OUTPUT.
      counter = lcl_app=>mcounter.
    
    INITIALIZATION.
      DATA start_time TYPE timestampl.
      GET TIME STAMP FIELD start_time.
    
      CREATE OBJECT go_app.
      CREATE OBJECT go_timer.
      SET HANDLER go_app->on_timer_finished FOR go_timer.
      go_timer->interval = 1. "seconds
      go_timer->run( ).
    
    AT SELECTION-SCREEN ON EXIT-COMMAND.
      SET HANDLER go_app->on_timer_finished FOR go_timer ACTIVATION ''.
      FREE go_timer.
      FREE go_app.
    
    CLASS lcl_app IMPLEMENTATION.
      METHOD on_timer_finished.
        mcounter = mcounter + 1.
        go_timer->run( ).
        cl_gui_cfw=>set_new_ok_code( new_code = '=' ). " ENTER (trigger PAI)
      ENDMETHOD."
    ENDCLASS."
    
    Add comment
    10|10000 characters needed characters exceeded