The 'What' part - "Notifications", you must be familiar with this word if you have used iPhones/BlackBerry or any other smartphones and even Facebook!!! Excited to see the notifications from your friends and family!!! How cool would it be to receive notifications regarding SAP Business Processes in your daily office work? Managers, wouldn't it be cool to get an employee's leave request on your mobile instead of getting it in the mail client in your laptop? It must be great to do some office activities from the mobile while having no access to your machine, e.g. in the departmental store, in the shopping mall, etc.
So the next question, how do we do it?? You know, it's really easy and cool!!! Just follow a few steps mentioned below and you'll be done in no time. Well, that's not absolutely true!!! It'll take some time, but not much. :smile:
Before we start, let's have a quick introduction of the SAP NetWeaver Gateway Subscription & Notification framework.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It's important to understand that Subscription & Notification are two different functions in Gateway. The below picture shows the difference in a nutshell.
It exactly works like subscribing for a newsletter. Once you subscribe for it, you receive it. Similarly, in case of a Gateway service, you have to subscribe to a Collection in order to get notified about the Business Process. But that's not the whole story. We'll see what else needs to be done in the steps to come. Stay tuned!!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Let's understand the use case in brief. In an organization, an Admin user wants to keep track of all the new SAP usernames being created/changed/deleted in a system. He doesn't want to login to the system everyday and check for any new users. Instead, he wants to get notified the moment a user is created/changed/deleted.
He thinks it would be great for him to get these alerts in his iPhone. So, he asks for an application which will connect to the Gateway system and get this information to his mobile device. Now, let's see what needs to be done in the Gateway system in order to get this working for the Admin.
The development activities for this scenario have been split into two steps:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Step 1 -- Creating Model & Data Provider classes
Let's create a new OData Service for the above mentioned business scenario, which will be enabled for subscription.
Step 2 -- Configuring the OData Service
Once the above steps are completed, maintain the model & service group in the IMG path shown below:
In the Gateway Hub system, activate the above service as shown below.
Activate the service ZPUSHDEMOSRV by clicking on it.
The OData service is now ready to be used for Query & Read operations. :smile: The table below gives the URLs for various operations supported.
Operations | URLs |
---|---|
Service Document | http://<hostname>:<port>/sap/opu/odata/sap/ZPUSHDEMOSRV/?$format=xml |
Metadata | http://<hostname>:<port>/sap/opu/odata/sap/ZPUSHDEMOSRV/$metadata |
Query | http://<hostname>:<port>/sap/opu/odata/sap/ZPUSHDEMOSRV/UserCollection |
Read | http://<hostname>:<port>/sap/opu/odata/sap/ZPUSHDEMOSRV/UserCollection('A.M') |
The service document (see below) shows that the 'UserCollection' is made subscribable and also you can see two new entities added to the service document (SubscriptionCollection and NotificationCollection).
Now, once you are done with the above steps, you can start with subscribing for a Collection. Nothing much to do here, just a regular HTTP POST as shown below. The sample request body can be found here.
Please note that we will be using a HTTP listener application for receiving the notifications. Hence, the deliveryAddress used while subscribing should be the IP address from the application.
Once you have fired the call, the response is a subscription for this service as shown below.
With this, you have become one of the subscribers for the 'ZPUSHDEMOSRV' SAP NetWeaver Gateway service. Let's see what else needs to be done for receiving notifications in the next blog - Create a Notification Push Application!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Related Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
8 | |
7 | |
7 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |