Advance SAPUI5 – 2- Push Notification in SAP – ABAP Push Channel, ABAP Messaging Channel in SAPUI5 – a Real Time Interaction

14
11950

As you know, nowadays most of the popular applications we are using are based on the real time notification as a main service. Real time update is the demand of the hour and every organization is moving in this direction to be ahead in the competition.

Real Time Notifications provide the end users and stake holders  the latest up-to-date information about application data and state, without having the need to use the refresh button to get the updated data from the backend system.

In this article, we would learn how to create our first Real Time Client Server Communication using ABAP Push Channel (APC) and ABAP Messaging Channel (AMC). We would show you all the required components of this architecture and you can implement a working example using the step by step process.

[docxpresso file=”https://sapyard.com/wp-content/uploads/2019/01/Push-Notification-in-SAP.odt”]

We hope, you know how to create a simple OData Service and redefine the method USERSET_GET_ENTITYSET.

If you are new to OData, please take this Free End to End Video Training on SAP OData and Netweaver Gateway.

method USERSET_GET_ENTITYSET.
data ls_user type zuser.
data lt_user type TABLE OF zuser.
select * from ZUSER into CORRESPONDING FIELDS OF TABLE LT_USER.

  MOVE-CORRESPONDING LT_USER TO ET_ENTITYSET.

endmethod.

Also CheckHow to Create your First OData Service

Please find attached the SAPUI5 Application. You can upload it and play around with it.

If you do all the steps mentioned above, you should be successful in creating your first Push Notification using SAP ABAP. Just like the one we created below.

SAP is innovating fast and we have lots of areas to catch up. If you have done anything interesting, which you want to share, please email us at mail@sapyard.com.

If you have any issue developing this Push Notification, do write your queries in the comments section and we would try our best to answer.

We have a very active Telegram (App) SAP Technical Group with more than 3650+ SAP Technical Practitioners from 6 Continents of the SAP World. Please join it using below link.
Telegram SAP Technical Discuss Group. You need to install the Telegram App first on your mobile device. Once you have it on your mobile, you can join the group and also access it from the Web on your computer and laptop.

Authors: Fares Letaief & Ramzi Abdallah

Free SAP ABAP for HANA Training Tutorials Exercises:

14 COMMENTS

  1. I implemented and the UI5 app is showing the records only after pushing refresh, I’m having trouble with the push. In your example you say to redefine the IF_APC_WSP_EXT_PCP~ON_MESSAGE method but I don’t see in the example what code it should it be refined to? I’m so close but yet so far away lol can you help point me in a direction to better trouble shoot.

  2. It is useless if you don’t explain “WHY” “WHAT” before “HOW”. People are here to understand the concepts and real time examples in depth, not to copy paste the code.

  3. Hi Ramzi,

    Can we use ABAP push channel to send Notification to Middleware like Software AG.
    If so how to establish communication between SAP and Middle ware

    Regards
    Deepthi

  4. Hi Ramzi,

    Thanks for your effort. Very useful tutorial.
    I did all these steps but I get this error in my SAPUI5 application.

    WebSocket connection to ‘wss://webidetesting****-fiori.dispatcher.int.sap.eu2.hana.ondemand.com/sap/bc/apc/sap/ztest_apc’ failed: Error during WebSocket handshake: Unexpected response code: 403

    can you help me please it’s very urgent.

    Best regards.

  5. Hi Ramzi Abdallah,

    Good explanation but can you please let me know in which case you have implemented it .because while creating sales order or any data related to business through frontend sapui5 with odata how could you add you notification packet between this.

  6. Hi.

    Excuse my English. I’m doing every single step, but if I dont have SAPUI5…I can connect any js script to this websocket? There is any kind of security?

    Thanks.

  7. SAPYard is known for explaining more on the “Why” part of the solution then “How” of it. Could you please explain the architecture and design of this also.

  8. Nice tutorial.
    Could you please extend it to cover a scenario when notification is sent from one SAP system to some other web service/API ?

  9. I’m trying to test your code but I can’t connect to the WebSocket using cloud platform connector to our on-premise server. It gives me an error.
    “failed: Error during WebSocket handshake: Unexpected response code: 404”
    It appears that socketHostURI += “//” + hostLocation.host is not giving the correct URI on this configuration.

    Any suggestions?
    Thanks in advance and thank you for the article.

  10. how user is determined ?? How to send notification to particular user ?? …is this will send notification to mobile also?

LEAVE A REPLY

Please enter your comment!
Please enter your name here