Skip to Content
Author's profile photo Alessandro Spadoni

Abap and Websockets : real-time functionalities with Abap Pusher (on Sap Code Exchange )

In this blog i want to describe my new project on Sap Code Exchange : Abap Pusher ( )
With Abap Pusher we can use Html5 websockets for adding realtime functionalities in Abap World.

What is a WebSocket?

(from )
WebSocket is a technology providing for bi-directional, full-duplex communications channels, over a single Transmission Control Protocol (TCP) socket. It is designed to be implemented in web browser and web servers but it can be used by any client or server application

What is Pusher?

Pusher ( , docs here ) is a simple hosted API for quickly, easily and securely adding realtime bi-directional functionality via WebSockets to web and mobile apps, or any other Internet connected device.

Pusher web service will send our messages to all connected clients that have subscribed our channel (using Html5 WebSockets protocol).

What is Abap Pusher?

Abap Pusher is an abap project for publishing/triggering events from ABAP using  Pusher REST API . In these way we can push realtime events from Abap to Browsers or any other connected clients without using Ajax,long polling..etc…. Server will push the messages to all clients.
Pusher provides many client libraries (Javascript , iOs , Android , Ruby , Arduino ,..).In my examples  I used Javascript library ( ).

Main class is ZCL_PUSHER

A simple Example.

First of all we need a Pusher account : there are many plans but the “Sandbox” Free plan (20 max connection) is good for our demo purposes.
Exploring Pusher dashboard, we can create “Apps” (an app called “Main” is created by default ) and on tab “Api Access” we found App_id , Key Token and Secret Token.
These 3 parameters are mandatory to create a ZCL_PUSHER instance. The message can be in any format but Pusher recommends  JSON;we can create JSON Strings using Json Abap Document Class by Uwe Fetzer (

You can optionally specify socket id to avoid duplicates (see )

Server Side (Abap)

Trigger an event ( PROG ZDEMO_PUSHER )

Client Side (Javascript )

So I can connect to my simple page from Chrome and Ipod Touch (iOs , Safari).

Both clients are connected to Pusher websocket.

Now i execute ZDEMO_PUSHER and this is the result!

This solution can be very useful in all “Real Time” situations , for example a simple application that displays realtime stock levels to the customers. (watch this video  ).
This is a simple example using a channel that doesn’t need authentication (Public channels ).

I will write another blog about “private” channels,prefixed with “private-“, “presence” channels ,prefixed with “presence-“ (useful for Chat apps) and Pusher WebHooks.

update 5.11.2012

This is the link to the 2nd part about “Private Channels that needs an Authorization” :

This is a simple video recorded for Sap Inside Track Milan about Public Channels:


Abap Pusher

Pusher docs

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Sergio Ferrari
      Sergio Ferrari
      Alessandro you rock!
      Waiting for a standard SAP implementation of WebSocket (e.g. in a new kernel and SICF handler) your implementation seems very useful.

      I think that the integration between SAP and other powerful products/services represents really the spirit of the SCN Community


      Author's profile photo Alessandro Spadoni
      Alessandro Spadoni
      Blog Post Author
      Thank you Sergio!
      I hope we'll have the opportunity to exchange ideas about this and other stuff in the next italian Sap Inside Track! 🙂
      Author's profile photo Sascha Wenninger
      Sascha Wenninger
      +1! Very cool blog Alessandro!

      Marrying up some of the cutting-edge solutions from the "real world" of IT with existing SAP solutions is what we need more of - especially when it means SAP customers can make use of this right now, without upgrading their backend to the latest version or buying more licencses.

      Well done!


      Author's profile photo Hendrik Brandes
      Hendrik Brandes
      Hello Alessandro,

      very very cool! Although it is not implemented directly in the SICF/Kernel, it should be a solution for enabling first webapps with websocket-requirements. I am looking forward it!

      Kind regards,

      Author's profile photo Former Member
      Former Member
      Thanks for sharing!

      While giving it a quick try I instantly found out about an instance of HTML/JS features I love sooo much. Usually you instantiate a websocket object with 'WebSocket(address)', but in Firefox you instantiate the same with 'MozWebSocket(address)'. But hey, don't we all know that - just a little browser detection script and a switch and everything is cool ;-))


      Author's profile photo Alessandro Spadoni
      Alessandro Spadoni
      Blog Post Author
      Thank you Anton!
      In my examples i didn't worry about websocket browser support , Pusher client javascript library does this work for us.

      In pusher.js there is a workaround to emulate native WebSocket API proxying via a flash object.
      Check these links

      Author's profile photo Naimesh Patel
      Naimesh Patel
      Cool Stuff...! Nice to know about the "Pusher".

      Naimesh Patel

      Author's profile photo Guillaume GARCIA
      Guillaume GARCIA
      Thanks for sharing
      Author's profile photo Graham Robinson
      Graham Robinson
      Thanks for this blog. Websockets are becoming and increasingly important feature that modern servers should all support IMO.

      I continue to encourage SAP to build websockets support into the ICM. Let's hope it happens soon.

      Graham Robbo

      Author's profile photo Former Member
      Former Member

      Thanks for shariing that!

      Author's profile photo Former Member
      Former Member

      Hello Mr.Spadoni,

      i'm very interested in your ABAP Pusher implementation. Unfortunatly code exchange is closed. I read about ABAP Pusher in the documentation of Netwaever 7.40. Probably that corresponds to your Pusher?

      But our Netweaver ist still 7.31, is there any implementation availabe for that release?

      Thank you in advance and best wishes

      Torsten Manhardt

      Author's profile photo Alessandro Spadoni
      Alessandro Spadoni
      Blog Post Author

      Hi Torsten,

      the ABAP Push Channel on 7.4 is not related to abap pusher , but it's the SAP Standard way to manage Web Sockets in Abap WAS,differently my Abap Pusher project was an Abap library to use the SAAS.

      Now there is a SAP standard implementation integrated to Abap , my abap pusher project is no longer maintained (no time and other projects 🙂 ) but if you want to try it , the code-exchange project was migrated to assembla. Here is the link to download it

      You need SAPLINK to import the nugg file