CRM and CX Blog Posts by SAP
Stay up-to-date on the latest developments and product news about intelligent customer experience and CRM technologies through blog posts from SAP experts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Jacek_Wawrzynek
Associate
Associate
1,254

289314_GettyImages-1070076238_medium_jpg.jpg

Introduction

Are your SAP Commerce Cloud installations compliant with your licensing agreements? Whether your contracts are based on Gross Merchandise Value (GMV) or order count, ensuring compliance is essential along with accurate order metrics reporting.

Out-of-the-box, SAP Commerce Cloud provides a compliant order processing flow that accurately tracks and reports consumption. However, customizations to this standard flow can lead to deviations that may disrupt proper reporting and compliance. Fortunately, SAP offers this comprehensive documentation on the Help Portal to guide you in maintaining compliance, even with customizations. To even better hadle the topic, this article provides a detailed description of available tools with practical steps for assuring proper usage of OrderService.submitOrder to send consumption reports, and the dedicated ordersmetricsbackoffice extension designed to simplify and streamline compliance tasks.

Order metrics submit strategy

When dealing with custom order processing flows in SAP Commerce Cloud, it is crucial to ensure that these customizations comply with licensing requirements. SAP Commerce Cloud provides a dedicated Spring bean called orderMetricsSubmitOrderStrategy, of type de.hybris.platform.order.strategies.SubmitOrderStrategy which exposes the submitOrder method. This method should be invoked whenever an order is placed in the SAP Commerce Cloud system or in any situation that, from a contract perspective, should be considered as order placement and processing. By calling this method and providing all necessary information about the order, you ensure that your custom flow remains compliant and that order metrics are accurately reported.

Add the following bean injection in your extension's Spring configuration file (myextension/resources/myextension-spring.xml) :

 

<bean id="customOrderProcessor" class="com.mycompany.commerce.order.CustomOrderProcessor">
    <property name="orderMetricsSubmitOrderStrategy" ref="orderMetricsSubmitOrderStrategy"/>
</bean>

 

In the associated Java class, use this bean as follows:

 

import de.hybris.platform.core.model.order.OrderModel;
import de.hybris.platform.order.strategies.SubmitOrderStrategy;

public class CustomOrderProcessor {

    private SubmitOrderStrategy orderMetricsSubmitOrderStrategy;

    public void setOrderMetricsSubmitOrderStrategy(final SubmitOrderStrategy orderMetricsSubmitOrderStrategy) {
        this.orderMetricsSubmitOrderStrategy = orderMetricsSubmitOrderStrategy;
    }

    public void processOrder(final OrderModel order) {
        // Custom order processing logic
        // ...

        // Ensure compliance by reporting the order
        if (orderMetricsSubmitOrderStrategy != null) {
            orderMetricsSubmitOrderStrategy.submitOrder(order);
        }
    }
}

 

You need to bear in mind, that SAP Commerce Suite doesn't provide any definition for orderMetricsSubmitOrderStrategy bean. It's injected in build-time on SAP Commerce Cloud environment and won't be set on your local environment!

You also need to be aware that overriding this bean may break the process and your consumption will not be properly reported!

Enabling Consumption Validation module

Along with orderMetricsSubmitOrderStrategy, you can add a dedicated extension to your installation to validate your reports. There are details about it in the documentation on SAP Help Portal, but I will describe the process here as well.

Activating the ordermetricsbackoffice extension should be your first step, when you start thinking about compliance and efficient order metrics tracking. Learn how to incorporate the extension into your SAP Commerce Cloud project, build it, and deploy it to your designated environment.

Consumption Validation module does not provide information about historical orders. Only those placed on version built and deployed after it was released early August 2024 will be available!

Step 1: Adding the extension to manifest.json

  • Navigate to your project files: Open your SAP Commerce Cloud project directory where the manifest.json file is located.
  • Edit the manifest.json file: Add the ordermetricsbackoffice extension to the extensions section of your manifest file as in this code snippet:

 

{
  "extensions": [
    "ordermetricsbackoffice",
    // other extensions...
  ]
}

 

If you are using localextensions.xml files, you can add it directly there:

 

<hybrisconfig xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='../bin/platform/resources/schemas/extensions.xsd'>
  <extensions>
    <extension name="ordermetricsbackoffice" />
    <!-- other extensions... -->
  </extensions>
</hybrisconfig>

 

  • Save the file: Ensure you save the changes to the manifest.json file.

Step 2: Running a build on SAP Commerce Cloud Portal

  • Access the SAP Commerce Cloud Portal: Log in to the SAP Commerce Cloud Portal using your credentials.
  • Initiate a build:
    • Navigate to the Builds section.
    • Select Create Build to start the build process.
  • Monitor the build:
    • The build process will compile your project including the newly added ordermetricsbackoffice extension.
    • Ensure the build completes successfully without errors.

Step 3: Deploying to a dedicated environment

  • Prepare for deployment:
    • Navigate to the build from previous step in the SAP Commerce Cloud Portal.
  • Create a new deployment:
    • Press "Deploy to Environment" button
    • Choose the target environment where you want to deploy (e.g., Development, Staging, or Production).
  • Deploy the build:
    • Initiate the deployment process by following the portal instructions with system update option enabled.
    • Monitor the deployment to ensure that it completes successfully.
  • Verify the deployment:
    • Access the Backoffice application on the dedicated environment once the deployment is finished.
    • Enable Orchestrator mode and perform Reset everything operation to apply configuration changes from ordermetricsbackoffice extensions.

Managing Access to the Consumption Validation module

The Consumption Validation module in SAP Commerce Cloud is designed to help ensure compliance with license agreements by monitoring order consumption effectively. This module is protected by standard Backoffice access rights management mechanisms. Access is restricted to users with a specific authority, ensuring that only authorized personnel can view and manage consumption data.

The Consumption Validation module requires users to have an authority called consumption. This authority is used to control who can access the module. By default, this authority is assigned to the Backoffice Administrator Role, but it can be modified as necessary.

If you choose to do so, you can change authorized users by modifying apropriate Backoffice Role in User > User Groups view:

  • Log in to SAP Commerce Cloud Backoffice.
  • Go to User > User Groups.
  • Find and select designated role.
  • Select Administration tab.
  • Find Authorities attribute and add consumption to the list using + button.

Once you have a properly configured role, you can assign it to users and/or user groups.

If you prefer automation or bulk updates, use the impex mechanism to assign the necessary authority. Here’s an example of an impex script that adds the consumption authority to a specific user group:

 

# Add new authority to someotherrole
UPDATE BackofficeRole; UID[unique = true]          ; authorities[mode = append]
                     ; someotherrole               ; consumption

 

Harnessing the Power of the Consumption Validation module

The Consumption Validation module provides tools to maintain compliance by monitoring order consumption and providing detailed reports. For users tasked with ensuring the accuracy and compliance of order registrations, the module offers an intuitive interface and actionable insights. Here’s how to make the most of it:

Navigating to Order Details

Once you’re logged into the SAP Commerce Cloud Backoffice, your journey begins at the Orders view, accessible via Order > Orders. This view presents a list of all orders stored within the system. To dive deeper into a specific order, simply search for and select the order you wish to examine. Upon selection, the order’s details will appear in the Editor Area at the bottom panel of the interface.

Within the Editor Area of the selected order, you will notice a "Show Report" button.

Jacek_Wawrzynek_0-1724153943609.png

This button allows you to see the detailed Order Consumption Report associated with the order. The status of this button provides immediate insight into the order’s compliance status:

  • Enabled "Show Report" button: When the "Show Report" button is active, it indicates that an Order Consumption Report is available. Clicking this button will open the report, allowing you to review detailed metrics and data points pertinent to the order’s consumption. This report is essential for verifying compliance and ensuring that the order has been correctly tracked and registered.Jacek_Wawrzynek_1-1724154086828.png
  • Disabled "Show Report" button: If the button is disabled, it means that no report is linked to the order. This often signals an issue with the order registration process, most commonly caused by the failure to properly invoke the OrderService.submitOrder method during the order’s lifecycle. Such instances require immediate investigation to rectify potential compliance lapses.

Utilizing the Consumption Reports View

The Consumption Validation module in SAP Commerce Cloud is designed to foster transparency and ensure that order consumption aligns with licensing agreements. In addition to validating individual orders directly, the module offers an expanded view of all registered consumption reports through a dedicated interface in the Administration Cockpit.

Located on the left-hand side of the Administration Cockpit, within the Explorer Tree, is the Consumption node. This node provides access to a view that lists all registered consumption reports, offering a broader perspective on order consumption activities.

Upon entering the Consumption view, you’re presented with a comprehensive list of all registered consumption reports. This interface allows narrowing down reports by time range. This functionality is crucial for auditing and compliance processes, as it enables users to focus on specific periods.

Jacek_Wawrzynek_2-1724155182729.png

The list provides essential details for each registered report, including:

  • Order ID: The unique identifier of the order.
  • Merchandise Value: Reported value of goods related to the order.
  • Order Date: When the order was placed.
  • Registration Date: When the order was registered in the system.
  • Report Date: The day for which the order's consumption is reported. This value is stated in UTC!
  • Report Status: Indicates if the report was delivered to the SAP consumption system.
  • Delivery Date: When the report was delivered to SAP consumption system.

When you select a specific report from the list, additional details are displayed in the bottom section of the view. This drill-down capability allows users to access granular information about each report, facilitating in-depth analysis and troubleshooting. If any discrepancies or anomalies are detected—such as reports not being delivered to the SAP reporting mechanism—users can take immediate action. This might involve checking the order processing workflows, ensuring that all reports are generated and submitted correctly, or addressing any issues within the OrderService.submitOrder method invocation.

Conclusion

In summary, the Consumption Validation module in SAP Commerce Cloud is a pivotal tool for ensuring compliance and accurate tracking of order consumption. By integrating the ordermetricsbackoffice extension via the manifest.json file, performing a build, and deploying it to a designated environment, organizations can efficiently enable this functionality.

Access to the module is controlled through the standard Backoffice access management, where users with the "consumption" authority can view and utilize the module's features.

Within Backoffice, users can navigate to Order > Orders to validate individual orders, using the "Show Report" action button to access detailed consumption reports. For a broader perspective, the Consumption node in the Administration Cockpit offers a comprehensive view of all registered consumption reports and detailed information about each report. These tools together empower users to maintain alignment with licensing agreements and ensuring the integrity of order registration processes.

By harnessing these capabilities, organizations can streamline their order consumption validation processes, mitigate compliance risks, and uphold operational excellence.

4 Comments