‎2007 Feb 17 9:56 AM
Hi
I have to write a program witch will refresh it's screen depending on a external event. In my case the external event is processed by a ABAP-Class/ABAP-Methode on the same application server but in an other context. So my idea was to set up an event handler but it didn't work.
Cause it has to work as a prototype, now I write the data in a Z-table and the program with the UI pulls that table any 1 second. I'd like to now if there are other possibilities to solve such problems. One of my ideas was to set up a shared object which fires a event when new data will arrive. But i read in a blog from Thomas Jung that this is not possible ( /people/thomas.jung3/blog/2004/12/09/netweaver-for-the-holidays-a-lession-in-sharing-abap-shared-memory )
Every input is appreciated !
Kind regards
Herbert
‎2007 Feb 17 8:20 PM
Hi Herbert,
I don't have a different solution other than what you are doing now.
However I will just dump my thoughts on this here.
i had similar requirement. With my earlier java experience and for a fact that sap has oo model, i had jumped to a conclusion that publish and subscribe pattern is possible in abap. i learnt while working on this that sap oo objects are not global instances but are only part of session.
Anyway, (similar to your solution), i used cl_gui_timer class and triggered an okcode periodically to check db. On rollout, i really didn't like this design. Because every 5 minutes, hourglass comes up and users loses control on current actions on sapgui.
I was thinking of a solution like below:
a) Design a new activex control in VB(lets call 'Event Communicator') that embeds a timer and bapi activex control.
b) From abap program, i will place this EventCom on a hidden docking container.
c) Time Interval, sap logon details will be passed to EventCom from ABAP.
d) EvenCom will utilize bapi activex control and will check sap(in an rfc call) for database value periodically.
e) If it 'finds' an event, a message text will be displayed or it can call back abap to trigger an okcode.
In summary, implement a way to make a parallel rfc call from gui w/o disturbing user actions. If rfc call detects an event then trigger an okcode on current session.
May be I am overdesigning it but I still want to do it when time permits.
Since SAP now supports shared (global) instances, may it is just a matter of time before global publish and subscribe pattern on object instances is supported.
‎2007 Feb 17 8:20 PM
Hi Herbert,
I don't have a different solution other than what you are doing now.
However I will just dump my thoughts on this here.
i had similar requirement. With my earlier java experience and for a fact that sap has oo model, i had jumped to a conclusion that publish and subscribe pattern is possible in abap. i learnt while working on this that sap oo objects are not global instances but are only part of session.
Anyway, (similar to your solution), i used cl_gui_timer class and triggered an okcode periodically to check db. On rollout, i really didn't like this design. Because every 5 minutes, hourglass comes up and users loses control on current actions on sapgui.
I was thinking of a solution like below:
a) Design a new activex control in VB(lets call 'Event Communicator') that embeds a timer and bapi activex control.
b) From abap program, i will place this EventCom on a hidden docking container.
c) Time Interval, sap logon details will be passed to EventCom from ABAP.
d) EvenCom will utilize bapi activex control and will check sap(in an rfc call) for database value periodically.
e) If it 'finds' an event, a message text will be displayed or it can call back abap to trigger an okcode.
In summary, implement a way to make a parallel rfc call from gui w/o disturbing user actions. If rfc call detects an event then trigger an okcode on current session.
May be I am overdesigning it but I still want to do it when time permits.
Since SAP now supports shared (global) instances, may it is just a matter of time before global publish and subscribe pattern on object instances is supported.
‎2007 Feb 17 9:01 PM
Hi Venu
thank you for your input. I also run cl_gui_timer class, but similar to you I am not very satisfied with the ongoing select every second. At least it works ...
Good idea with that VB-Control, i will discuss it with a college.
Any more ideas are welcome !
Regards
Herbert
‎2007 May 18 12:57 PM
Other ways to do this might be to use locks (e.g. all observers set optimistic locks, the observable object sets an optimistic lock and promotes it to an exclusive lock when data has changed -> all others locks are discarded, the observers regularly read their own lock, as soon as the lock is gone, they know that something has happened) or shared memory or shared objects instead of the database table based method you described here. I reckon those alternatives would be less resource consuming, however, they still include polling.
Are you still using the approach you described here, or have you come up with a better solution? There has got to be a way to do this using an interrupt based approach instead of polling.