Skip to Content

Create Rule Service and Ruleset

Create and activate ruleset and rule service artefacts as part of Bonus Plan Percentage Calculation rules project.
You will learn
  • How to create rule service which is the deployable entity of business rules
  • How to create ruleset to bundle rules with same output
ArchanaShuklaArchana ShuklaSeptember 28, 2022
Created by
ArchanaShukla
May 15, 2019
Contributors
ArchanaShukla
jmmargo

Rule Service is an interface or an end point that enables an application to invoke a decision logic. In an online transaction or workflow, rule service is invoked by passing any relevant input from an application to the rule service in a stateless manner.

Ruleset is a logical collection of rules that helps you group business rules that govern a specific function. A ruleset links a rule or group of rules to a rule service.

For more information, you can read the help documentation:

Rule service

Ruleset

  • Step 1
    1. Switch to Rule Services tab in Manage Rules Application.

    2. Click + to create the rule service.

      add rule service
    3. In the Details tab, enter the following rule service details:

      • Name as BONUS_PERCENTAGE_S4H or any name of your choice.

      • Label: Bonus Percentage Rule Service or any label of your choice.

      • Description: Calculates minimum bonus percentage for Custom Business Object of S/4HANA or any description of you choice.

      Label and Description are optional fields.

      define rule service props
    4. Switch to Vocabulary tab.

    5. Click + and add the following rows one after the other.

    6. Select the following values from the drop down:

      Name Usage
      BONUS_PLAN_TT Input
      PERCENTAGE Result
      define vocabulary
    7. Switch to Annotations tab.

    8. Click + to add annotation to rule service.

    9. From the options, choose ABAP on HANA.

      define annotation
    10. Click Activate button to save and activate the changes.

      activate rule service

      If activation is successful, then you will see the status of the rule service as Active.

      activated rule service
    11. Click the rules project breadcrumb link to return to the project page.

      switch to project
  • Step 2
    1. Switch to Rulesets tab.

    2. Click + to add ruleset.

      add ruleset
    3. In the Details tab, enter the following values for the ruleset properties:

      • Name: BONUS_PERCENTAGE_COLLECTION or any name of your choice.

      • Label: Bonus Percentage Collection Ruleset or any label of your choice.

      • Description: Executes all business rules to compute the Maximum Bonus Percentage allowed based on Custom Business Object of S/4HANA or any description of your choice.

    4. In Rule Service field, choose a rule service from already defined rule services.

      add ruleset props
    5. Switch to Rules tab.

    6. Click + to add the rule to ruleset.

    7. Select the rule from the list.

      add rules
    8. Once you complete editing, click Activate to save and activate ruleset.

      define vocabulary

      If activation is successful, then you will see the status of the rule service as Active.

      activated rule service
  • Step 3

    Which is the deployable rule model in SAP Cloud Platform Business Rules?

  • Step 4

    What is the annotation defined in rule service for S/4HANA Cloud system?

  • Step 5

    Which among the following can be configured in ruleset?

Back to top