Skip to Content

Pushing Notifications Made Easy!!! : Push a Notification

Now that you are here reading this blog, we assume that you already know how to Create a Subscription-Enabled OData Service.

Before we take a deep dive into the exact steps of pushing Notifications, let’s get the basics right.

  • To receive Notifications, one has to subscribe first.
  • An application on the SAP backend must trigger the push. Gateway provides APIs to create this application easily.
  • The notifications can be received by an online HTTP Destination/Server.


     Creating a Notification Push Application


The whole procedure involves some development activities and some configurations.

Step 1 — Developing a Notification Push Application

    1. Create a program ZR_MGW_PUSHDEMO_TEST which will be using the Gateway APIs for pushing data. You can find the sample code here.Program.JPG
    2. Identify the triggering mechanism for this program. There can be multiple ways of doing this, e.g. BAdI Implementations, Scheduled Jobs, etc. For our Business scenario, we’ll identify a BAdI implementation which will trigger the Push Application. When someone tries to create a SAP User using the transaction SU01, the are some enhancement spots which are triggered. One of the BAdI definitions is ADDRESS_UPDATE, in which we will plug in the code to call the push application whenever a user is created. For this, the method IF_EX_ADDRESS_UPDATE~ADDRESS3_SAVED must be implemented. You can copy the code from here. Capture.JPG

Step 2 : Configuring RFC Destinations for Pushing Notifications

     Please note that these configurations have to be done just once for a system. So, the next time you write a Push application, these configurations are already in place.

    1. Configure bgRFC destinations for asynchronous processing of Notifications. These configurations steps have been mentioned in the documentation links : Maintaining Outbound bgRFC Queue from SAP Backend System to the Hub System and Maintaining Inbound bgRFC Queue on the Hub System. Please note that these settings must be done by the system administrator, as there are certain special authorizations required. For details refer to Configure the bgRFC Supervisor Destination.
    2. Maintain SAP NetWeaver Gateway Connections Settings in the IMG structure shown below.Capture.JPGCapture.JPG  These fields must have the appropriate system details. For example, Destination system – DEV, Client – 100, RFC Destination – DEVCLNT100_BGRFC(This must be the same RFC destination that was created in the previous step)
    3. In the Gateway Hub system, go to transaction SM59 and create a RFC Destination of type “G“(HTTP Connection to External Server). Please note that an appropriate IP address must be used in this destination, which points to the same deliveryAddress which was used while creating the subscription. Also, make sure that the HTTP listener application is switched on and listening to the IP address. Once done, run a connection test which must be a success.Capture.JPGCapture.JPG

          All Done!!! 🙂 Now you can test the Notification Push by trying to create a user from SU01.


          In case everything is fine, you must receive a notification XML as shown below:

                XML Notif.jpg


     Related Information


     Create a Subscription-Enabled OData Service

You must be Logged on to comment or reply to a post.
  • Thanks again, Anirvan, for the continuation for the topic, which I find very helpful and interesting as well.

    Hope there will be many more blogs coming from your side in future 🙂



  • Hi,

    I am not able to establish ‘HTTP Connection to External Server’.

    I used my system IP address for Target host field.

    Can you suggest what i ‘d have missed, if any?



    • Hi Rajender,

      You have to provide your system IP address and the port number(e.g. 8000) in the respective fields while creating the RFC destination of type ‘G’.

      Also, before testing the connection, you have to make sure that the TCP monitor application(HTTP listener) is switched on and it must be listening to the appropriate port of your machine. If it is not switched on, you will get an error ICM_HTTP_CONNECTION_FAILED while trying to test the connectivity.

      Just in case you don’t have any HTTP listener application in your system, you will have to download one from the internet.



      • Hi Anirvan,

        Thank you very much for your helpful suggestions. i have successfully built the HTTP connection to external server for which i had to provide proxy details with system IP address and port number.

        Thanks & Regards

        Rajender Yadav

          • Hi Ramana,

            You need to create a simple service proxy and set the port, IP is automatically taken as local host. Please check its documentation available in the same link.

            Best regards,


          • Hi,

            I am using membrane to test the notification. anyhow RFC type ‘G’ (HTTP Connection to External Serv) is giving error while testing thru SM59..


            I have created RFC – with my system ID address and port # 8000.

            Following error in SMICM:

            *** WARNING => Connect to <desktop IP Address>:8000 failed: NIECONN_REFUSED(-10) {00058d0f} [icxxconn.c 2156]

            I have created proxy – for local host and port 8000.

            Please assist..



          • Hi Rajesh,

            I am also facing the simliar issue when i am using membrane..If you know the solution can you please post here.



  • Hi Anirvan,

    great job on this, I am debugging the ZR_MGW_PUSHDEMO_TEST program and it seems that I have no entires in the table /iwbep/d_mgw_sub.

    What step did I miss to put them into the table? Is it entered through SPRO?



  • Hi Anivan \ Aakash,

    In the program ZR_MGW_PUSHDEMO_TEST when it calls “call_remote_destination” since my rfc is setup for an http connrection rfc destination type = ‘G’ the destination gets set to ‘IWBEP_ODATA_OD_PUSH’ when a call getrs made to

    lo_destination = cl_bgrfc_destination_outbound=>create( lv_destination ).

    an exeception is thrown of ‘CX_BGRFC_INVALID_DESTINATION’

    I can run the http connection successfully from SM59, however it appears it does work with the IWBEP_ODATA_OD_PUSH?


    • Hello Keith,

      Please note that the RFC connection type must be ‘3’ on the backend system. In the step 2 of the blog, the RFC destination DEVCLNT100_BGRFC is in the backend and it is of type 3. This RFC destination has to be configured to connect to the Gateway Hub system and should be able to run bgRFC units. Please go through the configurations mentioned in step 1.

      If the RFC connection in the backend system is of type ‘G’, it tries to connect to a cloud-based Gateway Hub which is not the case in this blog.

      The RFC destination TEST_CONNECTION is in the Gateway Hub system from where it is pushed to the delivery address. This RFC destination must be of type ‘G’ as it connects to external HTTP applications.

      Hope this helps.



      • Arivan,

        Thanks for the reply, we werwe able to correct the issue. The was with ‘IWBEP_ODATA_OD_PUSH’ not being setup correctly.

        This is all working now, thanks for posting this.

        • Thanks Aakash/Keith,

          I am able to proceed further , but with similar issue Keith is facing

          lo_destination = cl_bgrfc_destination_outbound=>create( lv_destination ).

          an exeception is thrown of ‘CX_BGRFC_INVALID_DESTINATION’ for IWBEP_ODATA_OD_PUSH


          Can you please let me know what was the issue and how did you get through it?

          Thanks inadvance


        • Hello Keith,

          Can you please help me how did you get the issue related to IWBEP_ODATA_OD_PUSH resolve as we are also facing the same issue of


          thanks in advance for your help.


          • Thanks Keith,

            when we do connection test on the G type RFC, it comes back with 405 method not allowed.

            while i request BASIS to check the GW_RFC, we are trying to push some workflow notifications to mobile and is there anything else i need to care for?

            I will keep you posted once BASIS corrects the RFC .

            Any thoughts from your side would be of great help

            Thanks for your help


  • Hi Anirvan,

    Well written both Subscription and Notification Blog.

    I have one query,If our system landscape is Hub deployment it’s ok to create bgrfc and external rfc but if the landscape will be embedded deployment ,Can you please explain what are the steps need to do in embedded deployment.



  • Hi,

    Thanks for the blog.

    I have implemented the same and in my case the subscriber is a SICF service. For a single subscriber, it is working fine. When I added another subscriber(other SICF service), instead of pushing the notification to both the subscribers, the notifications is being pushed to only first subscriber but twice. Can you please help.

    And how this RFC destination TEST_CONNECTION is linked to the gateway service or config? Since in my case, there are 2 diff. RFC destinations(pointing to 2 different subscribers) but as told above, the notification is being pushed to only 1st destination twice.

    You can also find detailed version of this problem here.

  • /
    notification debug.PNG
      • Hi Ekansh,

        This header can be used to send any type of additional information related to the payload which cannot be sent through the Entity structure.



          • Ekansh,

            Let’s consider a case similar to the above screenshot you posted. Let’s say, a new characteristic is added to a material in the backend ECC system. There might be a requirement to notify all the subscribers of this change. Hence, a notification is triggered from Gateway.

            Now, if there is a requirement to send email to additional external users to notify about this change, there are two ways of doing that. Either you maintain these external email IDs in the backend so that you trigger emails right away from the ECC system, OR you can send these email IDs through the JSON header(with the notification) so that the consumer takes care of sending these emails. As the number of email IDs can vary, its a greater effort to maintain it in the entity structure and pass it on in the payload. Again, that’s purely a design decision.

            Hope this answers your query.



  • Hi all,

    I am working on an similar requirement of push notification. Just wanted to know how to receive notifications on mobile devices. In the example you used http listener. Are there any similar mechanism for receiving notifications on the mobile devices as well ?

  • Hi Anirvan,

    Thanks for giving us such a good blog. Wisely done. Couple of queries.

    1.If we want to push notifications to mobile devices ,is it possible to this service.

    2.when the user using the application is not online then will the notification sent automatically to the mobile device once they turn online ? Or this notification is missed.

    3.What is the underlying technology that is pushing messages from server to client ?


    Prabaharan Asokan

  • Hi Anirvan,

    Thanks for such a valuable information. My question is. Is it possible to listen those notifications from our regular SAP UI5 application. I know that WEB sockets can be used for that but I am interested if it would be possible with OData push notification.
    Do you have any examples related to consumption of such notification from SAPUI5?

    Thanks in advance,


    • Hi all,

      I am also interested in a way how this kind of notifications can be consumed using a SAPUI5 application. Would be great, if anyone could give some hints…

      Thanks an best regards,


      • Hi Olga/Karsten,

        Did you get any info how this kind of notifications can be consumed using a SAPUI5 application. If yes, please let us know as well.




  • Hi All,

    I am getting an error saying ‘No RFC destination found’. Not sure where I am missing.

    In my system, GW is installed in my ECC system it self.

    I mentioned my Service and collection details correctly.

    I configured my bGRFC destination correctly and mentioned in the settings.

    BgRFC config is also good.

    But I am getting error and my service is not shown in SBGRFCMON.

    Pls help.



  • Is it possible to send Notifications with a whole Entityset (means multiple records) as payload ?
    In the endpoint method I used an internal table as data parameter, but only one record is transfered.

    Thanks in advance