Show TOC

Configurations on the SAP Backend System for Pull Oriented ScenariosLocate this document in the navigation structure

Prerequisites

Make sure the following prerequisites are fulfilled:

  • The software component IW_BEP is installed in your system.

  • An RFC destination from the SAP backend system to the SAP Gateway system has been created with transaction SM59. Provide a service user and a password for the destination.

    For more information, see Maintain outbound bgRFC queue from SAP Backend system to the Hub system.

  • An SAP system alias for the SAP 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 Start of the navigation path SAP NetWeaver Next navigation step SAP Gateway Service Enablement Next navigation step  Backend OData Channel  Next navigation step Connection Settings to SAP Gateway Next navigation step SAP Gateway Settings End of the navigation path.

Defining the Metadata
  1. Create a class for metadata definition.

  2. Inherit from the SAP Gateway object/meta model super class /IWBEP/CL_MGW_PUSH_ABS_MODEL.

  3. Redefine method DEFINE() in your class to create your own implementation,

  4. Add SUPER->DEFINE( ) as first statement to your implementation to define the subscription data for your application.

  5. Implement metadata definition as explained in Define your Object Model in the Backend System.

  6. Call method SET_SUBSCRIBABLE( ) for each entity type in your implementation for which you want subscription and notification to be enabled.

Example

Class /IWBEP/CL_MGW_MED_SFLIGHT is delivered as an example implementation of a Subscription/Notification metadata definition.

Creating a Data Provider Class
  1. Create a class for data provisioning.

  2. Inherit from the SAP Gateway data provider super class /IWBEP/CL_MGW_PUSH_ABS_DATA.

  3. Redefine abstract method CHECK_SUBSCRIPTION_AUTHORITY in your class to implement your checks for subscription authorization.

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

  5. Implement the data provider as explained in Define your Runtime Class in the Backend System.

Example

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 Gateway
  1. Call static method /IWBEP/CL_MGW_SUB_REGISTRY=>GET_SUBSCRIPTION_REGISTRY( ) to get the instance of the subscription registry.

  2. Call method GET_SUBSCRIPTIONS( ) of the subscription registry providing the model group name and the collection for the notifications of the current business application.

  3. Call static method /IWBEP/CL_MGW_NOTIF_PUBLISHER=>GET_NOTIFICATION_PUBLISHER() to get the instance of the notification publisher.

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

  5. Call method SEND_NOTIFICATIONS() of the publisher for each notification endpoint.

Example

In the system the ABAP report /IWBEP/R_MGW_PUSH_TEST is available to demonstrate the notification transmission.

Continue with Configurations on the SAP Gateway System for Pull Oriented Scenarios.