
Prerequisites
Make sure the following prerequisites are fulfilled:
The software component SAP_GWFND is installed in your system.
An RFC destination from the SAP backend system to the SAP NetWeaver Gateway system has been created with transaction SM59. Provide a service user and a password for the destination.
For more information, see Maintaining Outbound bgRFC Queue from SAP Backend System to the Hub System .
An SAP system alias for the SAP NetWeaver Gateway system has been created in the backend system.
For this an IMG activity is available in the system: In transaction SPRO open the SAP Reference IMG and navigate to .
Defining the Metadata
Create a class for metadata definition.
Inherit from the SAP NetWeaver Gateway object/meta model super class /IWBEP/CL_MGW_PUSH_ABS_MODEL.
Redefine method DEFINE() in your class to create your own implementation,
Add SUPER->DEFINE( ) as first statement to your implementation to define the subscription data for your application.
Implement metadata definition.
Call method SET_SUBSCRIBABLE( ) for each entity type in your implementation for which you want subscription and notification to be enabled.
Class /IWBEP/CL_MGW_MED_SFLIGHT is delivered as an example implementation of a Subscription/Notification metadata definition.
Creating a Data Provider Class
Create a class for data provisioning.
Inherit from the SAP NetWeaver Gateway data provider super class /IWBEP/CL_MGW_PUSH_ABS_DATA.
Redefine abstract method CHECK_SUBSCRIPTION_AUTHORITY in your class to implement your checks for subscription authorization.
Redefine methods of interface /IWBEP/IF_MGW_APPL_SRV_RUNTIME in your class to process the operations of your application, for example creation or deletion of an entity.
Implement the data provider.
Class /IWBEP/CL_MGW_RT_SFLIGHT is delivered as an example implementation of a subscription/notification data provider.
Sending Notifications from Backend to Consumer via SAP NetWeaver Gateway
Call static method /IWBEP/CL_MGW_SUB_REGISTRY=>GET_SUBSCRIPTION_REGISTRY( ) to get the instance of the subscription registry.
Call method QUERY_SUBSCRIPTIONS( ) of the subscription registry providing the model group name and the collection for the notifications of the current business application.
Call static method /IWBEP/CL_MGW_NOTIF_PUBLISHER=>GET_NOTIFICATION_PUBLISHER() to get the instance of the notification publisher.
Call method CREATE_NOTIFICATION_ENDPOINTS() of the publisher instance providing the data structure you want to send and the list of subscriptions returned by the registry.
Call method SEND_NOTIFICATIONS() of the publisher for each notification endpoint.
In the system the ABAP report /IWBEP/R_MGW_PUSH_TEST is available to demonstrate the notification transmission.
Continue with Configurations on the SAP NetWeaver Gateway System for Pull Oriented Scenarios.