Create decision table type business rules to calculate bonus percentage based on eligibility dates and assignment factor of bonus plan custom business object.
🎓beginner⏱20 min.ABAP ExtensibilityBeginnerSAP Business Technology PlatformSAP S 4hana Cloud
You will learn
โHow to create decision table based business rules Rule entity is the technical representation of a simple business rule to be applied to a business case. It defines a business logic that, once evaluated against live data, leads to a decision. A rule includes one or more conditions, and outputs that triggered upon satisfaction of the condition or conditions. Rules can be adapted to the increasing complexity of business cases by combining any number of rules to a rule set.Rule can be of different type like decision table rule or text rule.
Name: ELIGIBLE_BONUS_PERCENTAGE or any name of your choice
Type: Decision Table
Click Create.
enter rule props
In the Details tab, enter the following values:
Label: Bonus Percentage Eligibility Rule or any label of your choice
Description: Calculate minimum bonus percentage based on custom business object of S/4HANA (which is: bonus plan) or any description of your choice
enter rule props
Step 2Configure decision table settings
+
Switch to Decision Table tab.
Click Settings.
open decision table setting
In the Decision Table Settings popup, enter the following values and expressions:
To add Condition expression, go to the condition expression cell and press Ctrl + SPACE and then choose the value from the context help as given in the table below.
To add Fixed Operator, select the given operator from the drop down list.
To add a new row, click + at end of each row.
Condition Expressions
Fixed Operator
BONUS_PLAN_TT.VALIDITY_START_DATE
>
BONUS_PLAN_TT.VALIDITY_END_DATE
<
BONUS_PLAN_TT.LOW_BONUS_ASSIGN_FACTOR
IN
decision table setting
decision table setting
In the Result type, clickresultto add the output columns to the decision table.
Click Apply.
set result
Decision table gets created with the selected condition columns and result column.
There will also be one additional empty row added to the decision table.
You can also Save the decision table. Then you need to click Edit to continue editing the decision table.
view decision table
Step 3Define conditions and result expressions
+
In the row, select the cell for each condition and use in-place rule authoring to enter the given values.
To enter the expression do the following:
Select the cell.
Press CTRL + SPACE.
From the options, select Fixed Value > Select date.
Choose a date from date picker.
Click OK.
edit condition expression
edit condition expression
edit condition expression
Depending upon the condition or result data type and operator, the options for rule authoring would change. For example, if the fixed operator is IN then you get options like [, ], .., fixed value, and so forth.
edit condition expression
Condition Expression
Values
BONUS_PLAN_TT.VALIDITY_START_DATE
‘2019-01-01’
BONUS_PLAN_TT.VALIDITY_END_DATE
‘2019-12-31’
BONUS_PLAN_TT.LOW_BONUS_ASSIGN_FACTOR
[1 .. 10]
PERCENTAGE_VALUE
15
Filled decision table row looks like this:
edited condition expressions
Select the row and click Copy Row.
copy row
Select the row and click Paste Row.
paste row
Repeat copy & paste row and enter condition & result expression values so that the decision table look as shown in the screenshot.
Creating 4-5 rows is not mandatory. You can just create one single row. This is to give you an experience with different modelling options with decision table.
all decision table rows
Step 4Activate decision table
+
Once you are done editing, click Activate to save and activate the decision table.
all decision table rows
If the decision table activation is successful, then the status will change to Active.
Share feedback on this tutorial or join the conversation in SAP Community.
Submit detailed feedbackDiscuss in Community
Steps
Step 1 of 4
1. Create decision table2. Configure decision table settings3. Define conditions and result expressions4. Activate decision table
Joule
AI Notice
Joule is an AI assistant. Generative AI may produce inaccurate, incomplete, or biased information. Always verify important details before acting on them.
Conversations are sent to SAP-hosted large language models for processing. Do not include personal data, credentials, or confidential information in your messages.
Joule's responses are based on the SAP tutorial catalog and may not reflect the latest product changes. For authoritative guidance, consult the linked tutorials and official SAP documentation.