Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
19,733

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.
    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.

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.  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.

          All Done!!! :smile: 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:

               

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     Related Information

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     Create a Subscription-Enabled OData Service

47 Comments
CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos

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 :smile:

Cheers,

Carlos

Former Member
0 Kudos

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?

Regards,

Rajender

Former Member
0 Kudos

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.

Thanks,

Anirvan.

Former Member
0 Kudos

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

Former Member
0 Kudos

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?

thanks

Keith

former_member195242
Active Participant
0 Kudos

Hi Keith,

You need to create a subscription first before sending notification! Have you checked the first part of the blog - Pushing Notifications Made Easy!!! : How to Subscribe? .

Best Regards,

Aakash

Former Member
0 Kudos

Hi Anirvan,

You know what that appears to be the issue... I am working through some authorzation issues at the moment but once those are resolved I should be good to go.

thanks for your help.

Keith

Former Member
0 Kudos

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?

thanks

Former Member
0 Kudos

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.

Regards,

Anirvan.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hello Everyone,

A very informative video has been posted on YouTube channel related to the same topic. Please check the link below:

http://www.youtube.com/watch?v=PxKZV0AAhD8

Regards,

Anirvan.

Former Member
0 Kudos

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

Keith,

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

Thanks inadvance

Sandeep


Former Member
0 Kudos

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

CX_BGRFC_INVALID_DESTINATION

thanks in advance for your help.

Sandeep

Former Member
0 Kudos

Sandeep,

From what I remember the issue was on the basis side that the destination was not setup correctly as a HTTP destination.

Former Member
0 Kudos

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

Sandeep

0 Kudos

Hi,

Can you please let me know where I can download  http listener software. Any link please...

former_member195242
Active Participant
0 Kudos

Hi Ramana,

You can use the Membrane monitor (open source):

http://www.membrane-soa.org/soap-monitor/

Best regards,

Aakash

0 Kudos

Aakash,

I did not see any port listening options. Can you please   let me where I can add my IP and port to see my payload notifications

former_member195242
Active Participant
0 Kudos

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,

Aakash


SyambabuAllu
Contributor
0 Kudos

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.

Thanks,

Syam

Former Member
0 Kudos

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..

ERROR -  ICM_HTTP_CONNECTION_REFUSED

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..

Regards,

Rajesh

SyambabuAllu
Contributor
0 Kudos

Hi Rajesh,

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

Thanks,

Syam

Former Member
0 Kudos

Hi Syam,

I am looking for solution in forum.. will update the tread once its resolved..

Regards,

Rajesh

Former Member
0 Kudos

Hi Anirvan,

I am trying to implement the push notification as mentioned in your blog. But I am not able to execute the zprogram. The call to external rfc is not made.  I have also posted it in the forumPush Notification implementation

Kindly help where I should look for.

Thanks,

Laawanya

former_member196593
Participant
0 Kudos

Tutorial is very nice. It will be helpful if you provide the link for HTTP listener.

former_member195242
Active Participant
0 Kudos

Hi Srithar,

Please check my replies above. I have provided a link to Membrane monitor.

Thanks,

Aakash

EkanshCapgemini
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Please provide the link of HTTP Listener you are using, I tried membrane but was not successful.

Former Member
0 Kudos

Hi shefali.chopkar,

Please check the below link which will download ZIP file , you have to extarct and run the http trace .

http://httptrace.sourceforge.net/httptrace.zip

Refer the below link for more  details :

www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20cea26b-8675-2f10-fa96-d4875f49b05b?ove...

EkanshCapgemini
Active Contributor
0 Kudos

Solved.

EkanshCapgemini
Active Contributor
0 Kudos

Hi,

What is the purpose of JSON_Header(attached image) while it is not present in received notification XML.

Former Member
0 Kudos

Hello, I tried with this HTTPTrace, but it never shows up any trace, can you help me how to get trace? I am posting my notification on delivery address like http://xyz.com:8080, what should be values for ListenPort,TunnelHost,TunnelPort? or any other way to get trace?

EkanshCapgemini
Active Contributor
0 Kudos

Anyone?

Former Member
0 Kudos

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 ?

Former Member
0 Kudos

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.

Regards,

Anirvan.

Former Member
0 Kudos

Hi Varun,

You need to use a Mobility platform like SMP to be able to do that. SMP will receive the notification and route it to the subscriber(mobile device).

Regards,

Anirvan.

EkanshCapgemini
Active Contributor
0 Kudos

Hi Anivaran,

Can you provide a use case for this?

Regards,

Ekansh

Former Member
0 Kudos

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.

Regards,

Anirvan.

Former Member
0 Kudos

Thanks Anirvan for your inputs.

former_member184739
Contributor
0 Kudos

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 ?

Regards

Prabaharan Asokan

former_member184739
Contributor
0 Kudos

Hi Anirvan,

Did you get a chance to see below and help me on the same ? Thanks

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Prabaharan,

the functionalities you are looking for are provided by the SAP Mobile Platform.

Best Regards,

Andre

0 Kudos

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,

Olga

Karsten_Schaser
Product and Topic Expert
Product and Topic Expert
0 Kudos

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,

Karsten

Former Member
0 Kudos

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.

Thanks

seenu

marko_espig2
Explorer
0 Kudos

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
marko

0 Kudos
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.

Thanks,

Pradip

 
Labels in this area