Skip to Content

Introduction to ABAP Channels


Most ABAP applications use polling techniques to achieve an event-driven communication.For pushing an event from an ABAP backend to a browser based user agent like SAPUI5, Web Dynpro, Business Server Pages (BSP) or WebGUI, a polling in multi-seconds interval is frequently used. This is a quite system resource consuming technique. In SAPGUI usually the timer control is used to detect an event in the ABAP backend system. ABAP Channels technology targets to replace such inefficient eventing based on polling techniques through push notifications based on publish-subscribe infrastructure and WebSockets in ABAP.

In which situations you will benefit from ABAP Channels? This blog describes the typical business usage scenarios: Say Goodbye to Polling: Real-time events in ABAP with ABAP Channels.



ABAP Channels infrastructure was delivered with SAP NetWeaver AS ABAP 7.40 support package 2 (SP2) for simple tests and prototyping and released with 7.40 support package 5 (SP5). 
The basic idea of the ABAP Channels (see Figure 1) is the native support of interactive and collaborative scenarios based on event-driven architecture. The scope of ABAP Channels consists of the following communication channels:

  • ABAP Push Channel for bi-directional communication with user agents via WebSockets in ABAP. In the Figure 1 the documents tagged with letter “P” mark the ABAP Push Channel communication paths.
  • Publish/subscribe infrastructure for exchange of messages between either user sessions (Session C => Session A) or user session and user agents
    (Session C => User Agent B) residing on different application servers via ABAP Messaging Channels. In the Figure 1 the documents tagged with letter
    “M” mark the ABAP Messaging Channels communication paths.

Figure1: ABAP Channels support real-time eventing in ABAP

The ABAP Channels support the following use cases:

  • ABAP Push Channel(APC) The WebSocket integration in ABAP.
  • ABAP Messaging Channel(AMC): Eventing framework for message exchange between different ABAP sessions based on publish/subscribe channels.
  • Collaboration scenario: UsingAPC and AMC to push messages from ABAP sessions to WebSocket clients by binding publish/subscribe channels to a WebSocket connection.
                                          Figure 2: ABAP Channels use cases in ABAP

General recommendations for usage of ABAP Channels

SAP recommendations for a common programming model for use of ABAP channels are:

  1. Use one WebSocket connection for collaboration scenario
  2. Use SAP Push Channel Protocol (PCP) messaging protocol                                   

Use one WebSocket connection for collaboration

For collaboration scenarios which take use of WebSocket (ABAP Push Channel), it is recommended to share – whenever possible – a single WebSocket connection per client (e.g. browsertab/UI application) for consumption of different types of frequently updated content (feed): e.g. changes applied to a business object, or notification regarding incoming external information (news, weather, sport, chat, activation/deactivation of logs, traces, debugging, etc.).

This is because:

  • This will avoid the unnecessary creation of parallel WebSocket connections for each feed, which is a limited resource at the both communication sides i.e. at the client and the server.
  • Any additional WebSocket connection leads to performance degradation due to WebSocket protocol specific network traffic (e.g. due to keeping alive ping-pongs packages). Furthermore the lifecycle handling of the WebSockets leads to additional complexity at both communication sides.
  • Moreover the situation will worsen when in the UI dependencies between different feeds exist, e.g. because a UI area contains an aggregation of information provided by different feed providers.

Figure 3 shows roughly how the messages are exchanged between an UI application running in a browser and using WebSocket connection (ABAP Push Channel) to ABAP sessions. The ABAP Messaging Channels (AMC 1… 4) are bound to the ABAP Push Chanel (APC). Either the UI Client can act as feed producer sending notifications about business object changes on UI to the subscribed WebSocket clients (Sessions 1…4) or vice versa: ABAP Sessions can publish messages about business object changes to their respective AMCs and they will be pushed by APC to the subscribed WebSocket clients (UI areas of business objects BO 1…4)

Figure 3: One WebSocket Connection (APC) for collaboration scenario


Use common messaging protocol Push Channel Protocol (PCP)

Starting with AS ABAP 7.40, SP05 it is recommended to send and receive messages in ABAP Channels in format of SAP’s own Push Channel Protocol (PCP).

The Push Channel Protocol (PCP) is a message based protocol with message format similar to a HTTP message format.

The proposal of having a common messaging protocol is also valid for most of well-known service oriented infrastructures, e.g. SOA, REST or OData based services. This enables an application developer to publish and consume the services in the same way. Furthermore with this strategy an extension of the provided services is possible, as additional optional fields/metadata can be added to the existing message without breaking the downport compatibility rules.

In context of ABAP Channels the consumption of different feeds by a single WebSocket connection requires a common higher protocol and message type on top of WebSocket for those feeds which are pushed from server. This is necessary because in the WebSocket message handling at the UI client side should be a unique and reliable way to identify the different message types and to assign the appropriate consumer UI area. In worst case if the feeds do not share the same protocol and each feed provider sends different message type, e.g. feed <f1> sends its messages as a kind of custom XML document, feed <f2> as JSON and feed <f3> as binary, it would be hardly possible to process the messages in a simple and reliable way in the WebSocket message handling. 

More about how to exchange messages in ABAP Channels with PCP will be published soon on SCN.


Using ABAP Channels

More detailed information about how to use ABAP Channels in the following series of blogs by Masoud Aghadavoodi Jolfaei

For live demonstration and step-by-step implementation guidance take a look at our ABAP Channels Video Tutorials.

For tangible examples in the system see also the blog ABAP Channels Examples.

See also FAQ – ABAP Channels.

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

    I hope that this is the right place to post my question?

    We want to create a Socket.IO client Lib to connect from Application Server to another Host that runs Socket.IO Server. Socket.IO is either a Websocket based communication or a XHR Polling based communication (repeating HTTP Requests).

    Well for creating a ressource saving library, websockets are the better to go with. I already saw that there is an interface existing for websocket client connections IF_APC_WS_CLIENT, that probably is similar to the if_http_client interface for HTTP requests.

    As long as I do not find any futher documumentation on this ( IF_APC_WS_CLIENT, CL_APC_WS_CLIENT class and interface ) on SCN or Internet, what do I have to say to our SAP Server Administrator? Which version do I need that he is going to upgrade our Test System. NW 7.5 or EHP 8 (Q1/2016). Will this version contain any documentation (for example RFC configuration SM59) for it, or will just be the plain class without any examples? Will it support only ws protocol or also wss (websocket secure) similar to http and https. I want to avoid that our sytem administrator installs NW 7.5, and we are still missing the needed classes/interfaces.

    Thanks in advance for a response.

    • Hi Michael,

      you can use AMC in Dynpro-based applications.

      The APC was developed as prototype as SAPGUI Push Channel as well (with AS ABAP 740 SP8 and SAPGUI 740) but not released for productive usage in the SAPGUI. For installation and support strategy of SAPGUI refer to note "147519 - Maintenance strategy / deadlines for SAP GUI".

      Best Regards,


        • Hi Michael,

          the SAPGUI Push Channel prototype can be used only for test purposes and there are currently no plans for productization.

          I just copy&paste here the step-by-step usage of SAPGUI Push Channel provided by Masoud within the comments to the blog Say Goodbye to Polling: Real-time eventing in ABAP with ABAP Channels

          With SPC it is possible to update SAPGUI controls or the whole SAPGUI screen as well, e.g. after receiving notifications via SPC from different back-end sessions. Furthermore there is a user-specific switch which is off by default to avoid the productive usage by developers and customers. We provided also in the 740 SP8 a simple test report for SPC. If your test environment fulfills the above-mentioned requirements, i.e. using ABAP Application Server 740 SP8 and SAPGUI 740, then you can activate the switch by maintaining the user specific SET/GET parameter “SAPGUI_PUSH_CHANNEL = X”  in the own user profile. For running a test report with SPC just carries out the following instructions:

          1. Activation the SAPGUI Push Channel switch for tests: Choose in the menu bar of a SAPGUI mode the entry “System -> User Profile -> Own Data”. Than enter in the created SAPGUI alternative session the tab “Parameters” and enter the table column “Set/Get parameter ID” the value “SAPGUI_PUSH_CHANNEL” and under “Parameter value” the value “X”, i.e. “SAPGUI_PUSH_CHANNEL = X”.
          2. Now run the test report RS_AMC_RECEIVE_MESSAGE (which acts as a SPC consumer) with the following parameter values:
            • Application ID: ECHO
            • Channel ID: /sapgui/ping
            • Checkbox SAPGUI as consumer: activate
            • Choose “List processing” option

                 Additionally execute the report RS_AMC_SEND_MESSAGE in a second SAPGUI    session (to send a message to the SPC session) with the following parameters:

              • Application ID: ECHO
              • Channel ID: /sapgui/ping
              • Message content: whatever you want as text, e.g. Hi there !

                   After execution of the RS_AMC_SEND_MESSAGE report you will get a popup      prompted on the first SAPGUI session executing the report    RS_AMC_RECEIVE_MESSAGE without any interaction, i.e. without double clicking the list. This shows how the SAPGUI screen gets updated automatically with the content of the received data using SPC.

              Best Regards,


      • Hi Olga,

        is it possible, even in ABAP 7.5, to send Messages to specific Users or only to specific channels?

        I would like to implement notifications in UI5 to inform a user about an backend event.



        • Hi Simon,

          to a spcefic channel. You can take use of a channel with activity scope "client" and determine the SHA1 hash value of sy-uname (user name), e.g. based on the function module “CALCULATE_HASH_FOR_CHAR”,  to use this as channel extension id and thus as "target user specific channel" to send a message to a specific user, based on the assumption that the target user accesses a report which act as AMC consumer for the above-mentioned channel.

          Please keep in mind that from security point of view you should use a client specific channel and do not use 1:1 the user id (i.e. sy-uname) as extension but rather apply a canonical transformation, e.g. SH1 hash of user id, to user id to create  the extension id. The security constrains based on the fact, that the AMC channels are used in log and traces (i.e. not only in application server but also in HTTP(S) proxies and reverse proxies and browser logs) if the channel is bound to a WebSocket connection (based on APC application).



      • Hello Olga,

        What can be the implications of using APC/AMC when events start happening very often? For instance I’m using mixed APC/AMC scenario for informing the technicians about the some errors (e.g. IDOC postings) and, suddenly, the errors start happening very often.

        Any best practice for such scenarios?

        Thanks, Dima

        • Hi Dmitrii,

          there exists a limitation for the number of AMC channels bound to WebSocket connections which can be adjusted using profile parameter, but for pushing messages to UI (WebSocket client) there exists (more or less) no limits for the number of messages transferred to the WebSocket client. Our tests, partly based on loadrunner, show that it is very hard to reach those (theoretical) limits. Just try to simulate the "heavy load" situation in your development system and if you would see any issues regarding dropping of message just let us know.



      • Dear Olga,

        I just had a quick look at one of the videos.

        What I am trying to work out is how to code the UI5 JavaScript part to send messages back to the SAP system.

        All the examples on the web (a) send messages out from SAP to UI5 and (b) focus 1005 on the ABAP part and ignore the web part.

        Thus I was happy to see that in the video the front end part was mentioned, however briefly.

        In fact most "old school" ABAP developers would not have much trouble with coding in ABAP, but have a lot of trouble coding in JavaScript, so I wonder why this part is always glossed over by anyone writing on the subject.

        I have taken a screenshot of the ON_INIT method from the video, it is naturally very blurry but I will try to copy it to one of my own applications to see how I go.

        Is there anywhere you can recommend on the web where there is an example of the JavaScript coding needed to establish the web socket connection and send a message?

        The concept is really simple, but the syntax , and the exact place to put the code is not as obvious to ABAP people as it may appear to web developers.

        Cheersy Cheers


      • Hi,
        I am updating a Table using Program - A and using an ALV Report Program - B to display the data of the Table.
        Using message channel sender in Program A when saving in the Table and
        Using message channel receiver in the ALV Report Program B to refresh the ALV.
        I am using statement - Wait for Messaging Channel, but its interrupting the program and no functions can be performed in the ALV during the waiting time.
        As per the example of Chat program, the screen is active even while waiting for messages.
        Can such be performed in the receiver message Program ALV Report B for dynamic refresh ?
        Waiting for an early response.
        Thanks and Regards,