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: 

Setting time out.

Former Member
0 Kudos

hi experts,

I am have a selection screen which generates a basic list and i need to let this list available for the user for 3 mins.

if the time expires i need to go back to the selection screen.

how could i program this. i guess there might be any func module.but i dont know the name.

pls help.

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please implement the following program, you can see that it uses the class CL_GUI_TIMER to automatically leave the list after 10 seconds, you can adjust the timeout to whatever you want.



report zrich_0002.

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler DEFINITION
*---------------------------------------------------------------------*
class lcl_event_handler definition.

  public section.

    class-methods: on_finished for event finished of lcl_gui_timer.

endclass.

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler IMPLEMENTATION
*---------------------------------------------------------------------*
class lcl_event_handler implementation.

  method on_finished.

    leave list-processing.

  endmethod.

endclass.

data: gui_timer type ref to cl_gui_timer.
data: event_handler type ref to lcl_event_handler.
data: timeout type i value '10'.    "<--  In Seconds

parameters : p_check type c.


start-of-selection.

  create object gui_timer.

  set handler event_handler->on_finished for gui_timer.

  gui_timer->interval = timeout.
  call method gui_timer->run.

  perform write_list.


*----------------------------------------------------
* FORM  write_list
*----------------------------------------------------
form write_list.

  do 10 times.
    write:/ sy-index.
  enddo.

endform.

Regards,

Rich Heilman

0 Kudos

hi riich,

your solution almost solved my problem, but I need one more help.

I need to exit list only if the user is idle for some time

how can i read that the user is idle and how to do this.

thanks.

0 Kudos

Not sure how you would handle this, my example above was only for your original question.

Regards,

Rich Heilman