Replicating Subscription Contracts using SAP Event Mesh

Objective

After completing this lesson, you will be able to replicate a subscription contract from SAP S/4HANA using SAP Event Mesh.

Subscription Contract Replication from SAP S/4HANA using SAP Event Mesh

This integration flow allows you to replicate subscription contract data from SAP S/4HANA to SAP Entitlement Management using SAP Event Mesh.

This ensures that subscription contract information is accurately reflected in SAP Entitlement Management.

Note

Currently, this integration flow only supports the following event types:

  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.StateCreated.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.StateChanged.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.Canceled.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.ChangeRejected.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.ContrQtyChanged.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.Extended.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.ProductChanged.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.Rejected.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.SchedldStChanged.v1

Be sure that you do not subscribe to either of these events:

  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.ChangeActivated.v1
  • sap.s4.beh.subscriptioncontract.v1.SubscriptionContract.Activated.v1

For more information, see: Replicate Subscription Contract from SAP S/4HANA via Event Mesh | SAP Help Portal

Configure Settings in SAP S/4HANA Subscription Order Management (SOM)

  1. Register Inbound Event Customer

    In the V_INBCONSUMR view, register the inbound event consumer.

  2. Perform Inbound Mapping

    In the V_INBOUNDMAP view, perform inbound mapping.

    Specify the following:

    FieldValue
    Consumer IDe.g., EntitlementManagementSystem
    Topicse.g., entitlement.provisioned.v1
    Inbound Payload Structuree.g., CRMS4S_EMS_ENTITLEMENT_EVT_PRV
    Internal Event Classe.g., CL_CRMS4_EMS_ENTITLEMENT_WF
  3. Configure XBE (/IWXBE/CONFIG)

    1. Activate the channels to establish a connection to enterprise messaging and listen to events.

    2. Configure inbound bindings and subscriptions.

    3. Set up the subscription for the topic.

Configure Event Type and Change Process Value Mapping

  1. Map Event Types

    Use value mapping to map SAP S/4HANA standard activated event types to SAP Entitlement Management business event types.

  2. Map Change Processes

    Map SAP S/4HANA standard change processes to your own customized change processes if necessary.

Configure SAP Cloud Integration Settings

  1. Configure the Sender tab as follows:

    1. Set the Sender Adapter Type to AMQP.
    2. Specify the Host, Port, and Path of the SAP Event Mesh service key.
    3. Set the Authentication Method to OAuth2 Client Credentials and provide the Credential Name.
  2. Configure the Receiver tab for SAP S/4HANA as follows:

    1. Set the Receiver Adapter Type to HCIOData.
    2. Provide the address of the SAP S/4HANA OData service for subscription contracts.
    3. Set the Proxy Type to On-Premise.
    4. Specify the Location ID, Authentication Method, and Credential Name.​
  3. Configure the Receiver tab for SAP Entitlement Management as follows:

    1. Set the Receiver Adapter Type to HTTP.
    2. Provide the EMS Entitlement Query v2 API URL.
    3. Set the Authentication Method to OAuth2 Client Credentials and provide the Credential Name.​
  4. On the More tab, configure the Extension Handler Address as follows:

    1. Set the Receiver Adapter Type to ProcessDirect.
    2. For the Extension Integration Flow Entry Point, specify the address: /EMS/ReplicateSubscriptionContractViaEvent_PostExit
  5. On the More tab, set the Extension Implemented field to true to extend the standard integration flow.

  6. On the More tab, maintain the following fields with values from SAP S/4HANA:

    • Customer System
    • Offering System
    • Source System
  7. On the More tab, configure the Entitlement Attribute for Lock/Unlock field.

    Note

    This is required for a Lock/Unlock scenario.

Create SAP Entitlement Management Settings

  1. Create Rule Set for Parent Items

    Define conditions and tasks for creating or updating entitlements.

  2. Create Rule Set for Child Items

    1. Establish relationships under the parent item.

    2. Implement the necessary script to handle the creation and update of child entitlements.

Summary

This integration flow facilitates the replication of subscription contracts from SAP S/4HANA to SAP Entitlement Management using SAP Event Mesh. It ensures that subscription contract data, including state changes and other relevant details, is accurately synchronized to SAP Entitlement Management in a timely fashion.

  1. The process begins with configuring settings in SAP S/4HANA Subscription Order Management (SOM), where inbound event consumers are registered and event mappings are established.
  2. SAP Cloud Integration is then configured to handle the replication, with specific attention to sender and receiver settings, ensuring secure and efficient data transmission.
  3. In SAP Entitlement Management, corresponding settings are created to receive and process the subscription contract data.

    This involves defining communication channels and configuring entitlement generation rules.

The integration supports various event types, such as contract creation and state changes, and allows for customization through value mapping.

By following these steps, businesses can maintain accurate and up-to-date subscription contract information in SAP Entitlement Management, ensuring alignment between subscription contracts and entitlements.

Replicate Subscription Contract from SAP S/4HANA via Event Mesh

Enable SAP Event Mesh in SAP S/4HANA

Configure SAP Event Mesh

Configure SAP Cloud Integration

Create Subscription Contract From S/4HANA

Check Subscription Contract From SAP Entitlement Management System

Summary

Subscribes to subscription-contract events in SAP S/4HANA Subscription Order Management and forwards them to SAP Entitlement Management via Event Mesh.