Skip to Content

SAP has developed, a few years ago, a way to push events (messages) from server to client without having the end user click any button or do any action.

The main purpose of this feature was to have a chat application between Portal users.

This method is called RTMF.

RTMF is a j2ee servlet which loads javascript files to the browser which polls the server every interval of time (Usually 3 seconds).

Since RTMF is deprecated and due to performance reasons, there are 2 alternatives for the same type of functionality:


  1. HTML5 websocket which can be read more about here:
    http://en.wikipedia.org/wiki/WebSocket
  2. SAP WebDynpro “TimedTrigger” element.


In this blog, I’ll explain how to use the 2nd option.

In order to have a push channel in your WebDynpro application, you simply add the TimedTrigger element to your view (don’t worry, the element is not visible when the application is running).

/wp-content/uploads/2014/11/timetrigger_577512.png

In the properties of the element, set the delay time (polling interval) to a desired time, for example 2 seconds.


The element also has an “enabled” property which can be bind to a Boolean attribute so you can switch on and off the polling to the server.


In the “events” tab of the element, create an event handler for the onAction event.

This handler will be called every 2 seconds and in that method you can implement the logic that you want to perform.

/wp-content/uploads/2014/11/code_577540.png

The biggest advantage of the TimedTrigger element is that you can have your heavy and long running logic run in the background while the UI is not stuck waiting for a response about the long running operation.


I’ve created a sample WD application which is an empty view that only has a timedTrigger element set to 2 senconds and recorded the HTTP requests with HTTPWatch and this is the result:

/wp-content/uploads/2014/11/http_577539.png

As seen, every 2 seconds, a request is being sent to the server, to the application I have created.


You should know that there is another type of WD element which offers the same functionality called MessageBasedTrigger.

This element is using RTMF as the framework that delivers data from server to client, but since RTMF is deprecated, you should not use it as well.


Hope this blog will help you in your development of WD applications.


Official documentation for TimedTrigger:
http://help.sap.com/saphelp_erp60_sp/helpdata/EN/da/a6884121a41c09e10000000a155106/frameset.htm

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Maya Amit

    Hi Erez,

    Interesting blog!

    The question is whether this TimeTriggered control is really a replacement to
    RTMF? – it seems that it’s just a timer which is triggered every interval.

    It misses the functionality of
    delivering messages from client to server –which is the assent of the RTMF.

    Did I understand correctly?

    Thanks,

    Maya

    (0) 
    1. Erez Neiderman Post author

      Hi Maya,

      It can defiantly replace RTMF, depends on the logic you are implementing in the WD application.

      You can use JMS which is the real framework for delivering messages between clusters and users.

      Instead of implementing the onMessage() method of RTMF, you just implement the same logic in the WD method that is being polled.

      (0) 

Leave a Reply