cancel
Showing results for 
Search instead for 
Did you mean: 

Catch Event in Tansaction

Former Member
0 Kudos

Hello,

we´ve developped an own SAP GUI transaction T (SAP GUI 6.20 is used).

The problem is: There arises an external event which we transfer to SAP server (i.e. SAP server is acting as RFC-server) and call a function module as user X. How can we fire an event to the (running) transaction T of user Y so that we can display that an event occurred (without interaction of the user Y)?

We found class CL_IMC_MODE but no sample code. Is this class able to solve our problem?

Thank you for any help,

Stefan

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183804
Active Contributor
0 Kudos

Hello Stefan,

if Cl_Imc_Mode is no help and if you the event should occur in near future Cl_Gui_Timer may help. But please note using this technique too extensive may prevent sharing work processes and cause frequent round trips ( == app. server load ).

This class seems to me very useful to write monitors. If your RFC-server temporarily stores its state within a db table, shared buffer or shared object ( release 640+ ) you may use this technique to poll the data.

Kind Regards

Klaus


program Test_Timer.


*********************
* local classes
*********************

class lcl_Receiver definition.

  public section.
    methods:
      constructor,
      handle_Timer_Event for event Finished of cl_Gui_Timer.

  private section.
    data:
      f_Timer   type ref to Cl_Gui_Timer,
      f_Counter type i.

endclass.


class lcl_Receiver implementation.

*==================
method Constructor.
*==================

  create object f_Timer.

  set handler me->handle_Timer_Event for f_Timer.

  f_Timer->Interval = 2.
  f_Timer->Run( ).

endmethod.

*=========================
method handle_Timer_Event.
*=========================

  data:
    text_Info  type c length 20 value 'INVOCATION:'.

  text_Info+16(4) = Me->f_Counter.

  add 1 to f_Counter.
  message text_Info type 'S' display like 'I'.
  if ( 10 gt f_Counter ).
    f_Timer->run( ).
  endif.

endmethod.
endclass.

*********************
* report eventing
*********************

start-of-selection.
  perform sub_Main.


**********************
* forms
**********************

*============
form sub_Main.
*============

  data:
    cref_Handler type ref to lcl_Receiver.

  create object cref_Handler.

  write: 'Timer started'.
endform.

Former Member
0 Kudos

Hello Klaus,

thank you for this solution. Unfortunately we´ve a lot of users and the event can happen in 1 minute, 1 hour ... so that we´ll cause too much app. server load working like this.

Kind regards,

Stefan