Settings on SAP Gateway system include:
Subscribing for Storing Notifications in the SAP Gateway System
Pulling the Notification Stored in the SAP Gateway System
Go through the section OData for SAP Products below, before you could proceed with the SAP Gateway system settings.
The service NOTIFICATIONSTORE is generated under two different ICF nodes:
/sap/opu/sdata/iwfnd/NOTIFICATIONSTORE — Services generated under the ICF Node sdata supports notification pull only on those services, which were configured under ICF node sdata.
If the user subscribes for a collection requesting to store notifications, which is configured under the ICF node sdata then the user can pull the stored notifications only using the service generated under ICF node /sap/opu/sdata/iwfnd/NOTIFICATIONSTORE.
/sap/opu/odata/iwfnd/NOTIFICATIONSTORE — Services generated under the ICF node odata supports notification pull only on those services, which were configured under ICF node odata.
If the user subscribes for a collection requesting to store notifications, which is configured under the ICF node odata then the user can pull the persisted notifications only using the service generated under ICF The service NOTIFICATIONSTORE is generated under two different ICF nodes
Make sure that you have the service 'NOTIFICATIONSTORE' activated on your SAP Gateway Hub system.
Standard Mode
Below is the service document URL:
http://<hostname>:<port>/sap/opu/odata/iwfnd/RMTSAMPLEFLIGHT/SubscriptionCollection
In this example, the user has subscribed to changes on FlightCollection. But the notifications reside in the SAP Gateway system and pulled by consumers when required.
Sample code for OData for SAP Products – Standard Mode
Request POST /iwfnd/RMTSAMPLEFLIGHT/SubscriptionCollection HTTP/1.1Host: <host>:<port> accept: application/atom+xmlcontent-type: application/atom+xmlContent-Length: 634 X-Requested-With: XMLHttpRequest <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData"> <atom:author> <atom:name></atom:name> </atom:author> <atom:title>My sub</atom:title> <atom:updated/> <atom:content type="application/xml"> <m:properties> <d:ID>1</d:ID> <!-- Dummy Key, Server will generate the key --> <d:deliveryAddress>http://<host>:<port></d:deliveryaddress> <d:persistNotifications m:Type="Edm.Boolean">false</d:persistNotifications> <d:collection>FlightCollection</d:collection> <d:filter m:null="true" /> <d:select m:null="true" /> </m:properties> </atom:content> </atom:entry |
Compatibility Mode SP 02
Below is the service document URL:
http://<hostname>:<port>/sap/opu/sdata/iwfnd/RMTSAMPLEFLIGHT/SubscriptionCollection
In this example, the user has subscribed to changes on FlightCollection. But the notifications reside in the SAP Gateway system and pulled by consumers when required.
Sample code for OData for SAP Products – Compatibility Mode SP 02
Request POST /iwfnd/RMTSAMPLEFLIGHT/SubscriptionCollection HTTP/1.1 Host: <host>:<port> accept: application/atom+xml content-type: application/atom+xml Content-Length: 634 X-Requested-With: XMLHttpRequest <?xml version="1.0" encoding="utf-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom"> <atom:id/> <atom:title>Subscription for sample user</atom:title> <atom:author/> <atom:updated/> <atom:content type="application/xml"> <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"> <d:collection>FlightCollection</d:collection> <d:persistNotifications>true</d:persistNotifications> <d:filter></d:filter> <d:select>*</d:select> </m:properties> </atom:content> </atom:entry> |
To pull the notifications that are stored in SAP Gateway system perform a HTTP(s) GET on entity set NotificationCollection defined in service document NOTIFICATIONSTORE. The service document, NOTIFICATIONSTORE is enhanced to support few other functionalities, see, Pulling the Notifications Stored — Enhancements for more information.
Standard Mode
Below is the Service document URL:
http://<hostname>:<port>/sap/opu/odata/iwfnd/NOTIFICATIONSTORE/NotificationCollection?$format=xmlsap-client=<client number>
To retrieve all notifications that were created after 2011-10-03T10:00:00Z
Sample code for OData for SAP Products – Standard Mode
Request GET /iwfnd/NOTIFICATIONSTORE/NotificationCollection?$filter=updated ge '20111003100000' HTTP/1.1 Host: <host>:<port> accept: application/atom+xml,application/xml Response HTTP/1.1 200 OK Content-Length: 658 Last-Modified: Mon, 03 Oct 2010 21:10:15 GMT Content-Type: application/xml;type=feed;charset=utf-8 Content-Encoding:gzip; dataserviceversion:2.0; <?xml version="1.0" encoding="utf-8" ?> <atom:feed xml:base="http://<host>:<port>/sap/opu/odata/ xmlns:atom=http://www.w3.org/2005/Atom xmlns:d=http://schemas.microsoft.com/ado/2007/08/dataservices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <atom:author> <atom:name/> </atom:author> <atom:id>http://<host>:<port>/sap/opu/odata/iwfnd/NOTIFICATIONSTORE/NotificationCollection </atom:id> <atom:link href="NotificationCollection" rel="self" title="NotificationCollection"/> <atom:title type="text">NotificationCollection</atom:title> <atom:updated>2011-12-09T04:36:17Z</atom:updated> <atom:entry> <atom:category term="NOTIFICATIONSTORE.Notification" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/> <atom:content type="application/xml"> <m:properties> <d:NotificationID>005056A509B11ED185E9754E9039D87D</d:NotificationID> <d:changeType>created</d:changeType> <d:collection>FlightCollection</d:collection> <d:entriesOfInterest>1</d:entriesOfInterest> </m:properties> </atom:content> <atom:id>http://<host>:<port>/sap/opu/odata/iwfnd/NOTIFICATIONSTORE/NotificationCollection('005056A509B11ED185E9754E9039D87D') </atom:id> <atom:link href="iwfnd/NOTIFICATIONSTORE/NotificationCollection('005056A509B11ED185E9754E9039D87D')" rel="self" title="Notification"/> <atom:link href="iwfnd/RMTSAMPLEFLIGHT/FlightCollection(carrid='AC',connid='0820',fldate=datetime'2002-12-20T00%3A00%3A00')" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/via" type="application/atom+xml;type=entry"/> <atom:title xml:lang="EN" type="text">CUD OF FLIGHT E</atom:title> <atom:updated>2011-11-25T09:55:39Z</atom:updated> </atom:entry> </atom:feed> |
Compatibility Mode SP 02
Below is the Service document URL:
http://<hostname>:<port>/sap/opu/sdata/iwfnd/NOTIFICATIONSTORE/NotificationCollection?$format=xmlsap-client=<client number>
To retrieve all notifications that were created after 2011-10-03T10:00:00Z
Sample code for OData for SAP Products – Compatibility Mode SP 02
Request GET /iwfnd/NOTIFICATIONSTORE/NotificationCollection?$filter=updated ge '20111003100000' HTTP/1.1 Host: <host>:<port> accept: application/atom+xml,application/xml Response HTTP/1.1 200 OK Content-Length: 658 Last-Modified: Mon, 03 Oct 2010 21:10:15 GMT Content-Type: application/xml;charset=utf-8 Content-Encoding:gzip; dataserviceversion:2.0; x-sap-odata-extension-version:0.9 <?xml version="1.0" encoding="utf-8" ?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http:// schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap= "http://www.sap.com/Protocols/SAPData"> <atom:id>http://<host>:<port>/sap/opu/sdata/iwfnd/NOTIFICATIONSTORE/ NotificationCollection<atom:id> <atom:link href="http://<host>:<port>/sap/opu/sdata/iwfnd/NOTIFICATIONSTORE/ NotificationCollection" rel="self" type="application/atom+xml;type=feed" /> <atom:title>NotificationCollection</atom:title> <atom:updated>2011-10-03T12:40:33Z</atom:updated> <atom:entry> <atom:category term="NOTIFICATIONSTORE.Notification" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/> <atom:author /> <atom:content type="application/xml"> <m:properties> <d:NotificationID>005056A509B11ED0BBB68AB8FF4351CF</d:NotificationID> <d:collection>FlightCollection</d:collection> <d:changeType>created</d:changeType> <d:entriesOfInterest>1</d:entriesOfInterest> </m:properties> </atom:content> <atom:id>http://<host>:<port>/sap/opu/sdata/iwfnd/NOTIFICATIONSTORE/ NotificationCollection(NotificationID= '005056A509B11ED0BBB68AB8FF4351CF')</atom:id> <atom:link href="http://<host>:<port>/sap/opu/sdata/iwfnd/NOTIFICATIONSTORE/ NotificationCollection(NotificationID= '005056A509B11ED0BBB68AB8FF4351CF')" rel="self" type="application/atom+xml;type=entry" /> <atom:link href="http://<host>:<port>/sap/opu/sdata/iwfnd/RMTSAMPLEFLIGHT/ FlightCollection(carrid='AA',connid='0017',fldate='20100704')" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/via" type= "application/atom+xml;type=entry" /> <atom:title>CUD OF FLIGHT E</atom:title> <atom:updated>2011-10-03T11:39:20</atom:updated> </atom:entry> </atom:feed> |
Only the logged in users notifications are retrieved.
Back to Configurations on the SAP Backend System for Pull Oriented Scenarios.