且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

测试SAP BRF+ ruleset

更新时间:2022-08-19 08:57:24

Created by Jerry Wang, last modified on Oct 01, 2014

使用wiki"使用代码创建BRF ruleset"提到的report 创建ruleset,里面包含了两个ruleset variable, 这两个rule variable的初始化分别由calc. cust. discount和calc. pro. discount这两个decision table来完成。



Decision table的rule 维护如下

如果customer是“sap”,item是“ballpen”,则customer discount值为0.15


如果customer是“sap”,item是“pencil”,则customer discount值为0.12


如果不满足以上两个条件,则无discount


这里的column customer, item和Customer Discount都是function的context里定义的变量。

测试SAP BRF+ ruleset

点击Simulation button:

测试SAP BRF+ ruleset

选择Interpretation Mode:

测试SAP BRF+ ruleset

点Execute button.

测试SAP BRF+ ruleset


因为customer=sap, item=pencil, 满足decision table里的entry,因此customer_discount为0.12


promotion=sun, item = pencil, 不满足decision table里的任何一条entry,因此promotion_discount为0.


所以rule里的if 条件不满足,因此price将按照customer discount进行计算: final price = 10 / ( 1 + 0.12 ) = 8.93

测试SAP BRF+ ruleset

如果使用"Execute and Display Processing Steps", 能够看到BRF+ 每一步具体的执行步骤:

测试SAP BRF+ ruleset

65