Skip to Content
Author's profile photo Former Member

Move from pull to push methodology via ABAP Channels and Neptune Software

In early beginning of implementing Neptune Software in the company I work for during POC and playing with possibilities of Neptune Software and SAPUI5 libraries I was asked to implement few boards (big screen TV) for the warehouse which will help people keeping up to date with the work they should do.

In one warehouse, there was multiple screens which was showing in tabular way important information.
Data model which collected all the necessary information for 4 types of boards was bit heavy and took a bit of time to run.
First implementation was with refreshing boards each defined period (60 sec.).
That mean each board was triggering that heavy calculation with the same set of parameters (warehouse number).

It all worked well and users was happy to have such a nice look and feel boards delivered in such a short time possible by Neptune Software and ABAP collector (data model).

After a while we received complains about long time it takes application to refresh data because of heavy logic behind data model.

That’s when my idea came up to try ABAP channels which I checked before but never had chance to use it in productive way.

Bellow you can find step by step creation of simple ABAP Channels required for simple Neptune application which use “push” not “pull” methodology.

You can imagen using that type of programing and ABAP Channels (WebSockets) for any other type of update client from back-end – notification, tiles information, KPI dashboards, graphs etc.

For example, one program run periodically as job collecting data for boards and sending them to registered apps (screens) no matter how many of they are.

Many information about ABAP Channels you can find here:

You can always refer to SAP documentation as well.

Example below is the simplest and with minimum effort to show that it’s working.
Not everything is implemented to the end but to have a clue about it you can re-create that example in your own system.

I assume you are familiar with Neptune Software (/NEPTUNE/DESIGNER etc.) and ABAP (se80, se24 etc).

It’s running on Neptune 4.0 SP02.

ABAP stack: 7.4 SP09.

1. Create ABAP Messaging Channel

Go to transaction SE80.

  • Channels with “/sflight”
  • Message Type ID: TEXT
  •  Activity Scope: S – System

2. Create ABAP Pusch Channel

Generate Class and Service

3. Edit generated class and redefine methods:
* * * * bind the WebSocket connection to the AMC channel
DATA(lo_binding) = i_context->get_binding_manager( ).
lo_binding->bind_amc_message_consumer( i_application_id = ‘YAC_NAD_SFLIGHT_AMC’
i_channel_id = ‘/sflight’ ).
CATCH cx_apc_error INTO DATA(lx_apc_error).
DATA(lv_message) = lx_apc_error->get_text( ).
MESSAGE lx_apc_error->get_text( ) TYPE ‘E’.

– ON_MESSAGE – leave empty

4. Edit created ABAP messaging channel and add created class to authorized programs

5. Create class for Neptune application
Add interface to class: /NEPTUNE/IF_NAD_SERVER

6.  Add public attribute to class

7. Create Neptune application


8. Add created class to Neptune app definition

9. Create simple app with sap.m.table to display data
– bind public attribute defined in the class
– create columns with the wizard to display data

10. Add oPageHidden with Init

// BeforeDisplay
if (sap.n) {

sap.n.Shell.attachBeforeDisplay(function() {


// InitLoad
sap.ui.getCore().attachInit(function() {
setTimeout(function() {
initWS(); // init registration to push channel
}, 100);

In attachInit we calling defined function in the script added in next step

11. Add Functions script to oPageHidden

JavaScript function here register to WebSocket and have defined function when the messaged is pushed by ABAP Channels.
As we defined the ABAP channels to receive simple text we will create later program which will send JSON string to application and here we use it after receiving it to update data model of the table in the Neptune app.

12. Run the app in the browser.
Should look like this.

Run it in 2 separate windows. You can try to run it on different computers etc.

13. Go to transaction SMWS and click second button from the left -> System Wide List

You can see your app registered on the server.

14. Create program which will send data via push channel to registered applications










DATA: lo_producer TYPE REF TO if_amc_message_producer_text,

lv_json TYPE string.

DATA: lt_sflight type FLIGHTTAB.


” selecting data

select * from sflight into table lt_sflight.

” serialization of table to JSON

lv_json = /ui2/cl_json=>serialize(

data = lt_sflight

compress = abap_false

pretty_name = /ui2/cl_json=>pretty_mode-none ).



lo_producer ?= cl_amc_channel_manager=>create_message_producer(

i_application_id = ‘YAC_NAD_SFLIGHT_AMC’

i_channel_id = ‘/sflight’ ).

lo_producer->send( i_message = lv_json ).

CATCH cx_amc_error INTO DATA(lx_amc_error).



Watch magic happening -> your table will be update from the backend via web socket (Push channel) in all the clients.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Shivam Shukla
      Shivam Shukla



      thanks ,