Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Progress Indicator being removed

former_member182550
Active Contributor
0 Kudos

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....

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
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."
2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos
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."

0 Kudos

Hi Sandra,

Thanks for that. I ended up doing something along these lines as well, even trying to use FM PROGRESS_POPUP.

Regards,

Rich