Skip to Content

Create a Custom Rule with SAP Customer Order Sourcing

0 %
Create a Custom Rule with SAP Customer Order Sourcing

Create a Custom Rule with SAP Customer Order Sourcing

February 18, 2021
Created by
January 28, 2021
Learn how to create a custom rule from start to finish with SAP Customer Order Sourcing.

You will learn

  • How to create a custom attribute via the SAP Customer Order Sourcing API
  • How to create a custom rule using the custom attribute
QR code


In this tutorial you learn create a custom rule in SAP Customer Order Sourcing from start to finish.

Custom Rules allow you to extend the rule based sourcing according to your needs.

Step 1: Add custom attribute via SAP Customer Order Sourcing API
  1. Navigate to SAP Customer Order Sourcing on SAP API Business Hub, and login with your email address.

  2. Select your trial environment, probably named trial_test.

  3. On the left side, choose Attributes.

  4. Open POST/attributes and choose Try Out.

  5. Copy the following attribute information and paste it into the body:

      "extensionType": "SOURCE",
      "name": "sustainabilityrating",
      "description": "Sustainability rating of sources.",
      "type": "DOUBLE",
      "defaultValue": 50

    To later use the attribute sustainabilityrating, you have to include it when uploading sources. See the following example:

    {"items": [
      "sourceId": "dc1",
      "sourceName": "Berlin",
      "sourceType": "DC",
      "availableToSellDataProvider": "COS",
      "attributes": {
        "sustainabilityrating": 77
      "sourceCoordinates": {
        "latitude": 52.5170365,
        "longitude": 13.3888599
Log on to answer question
Step 2: Create a custom rule
  1. In the SAP Business Technology Platform trial space, enter your trial account.

  2. Navigate to your subaccount, probably named trial.

  3. In the navigation pane, open Service Marketplace.

    Search for SAP Customer Order Sourcing.

  4. Open the SAP Customer Order Service tile, choose Go to Application, and log in.

  5. Open the Strategy Builder app and open an existing strategy or create a new one via +.

  6. Under Rules click Manage.

  7. In the Manage Rules view, create a new rule by clicking +.

    For the rule, set the following:

    Field Name Value
    Name Highest Sustainability Rating
    Description The focus of this rule is to deliver products only from the source with the highest (best) sustainability rating.
    Numeric Attribute sustainabilityrating
    Comparator Highest Value

    Save the rule.

You are now able to use the custom rule in the Strategy Builder.

For sourcing to properly work, you must upload sources that include the sustainability rating attribute.

For more information on how to upload source data, see Step 4 of tutorial Create Personalized Sourcing Strategies Depending on Location and Priorities.

You uploaded the sustainabilityrating attribute and created the corresponding custom rule. You didn't include the sustainabilityrating in any of the sources. Can you effectively use the newly created custom rule?

Additional Information

Next Steps

Back to top