
How to simulate the condition technique with BRF+
The SAP condition technique allows you to control decision making via configuration and master data.
It will be a set of condition types, access sequences and condition tables and a vital part of pricing and output determination.
Depending on the complexity of pricing, you could run out of the available condition tables. You might decide in those circumstances to use Business Rule Framework.
The SAP standard condition tables for the price condition type PR00 has the access sequence PR00 with the following condition tables:
- #1: Condition table A005 = Sales organisation, distribution channel, sold-to party, pricing reference material
- #2: Condition table A006 = Sales organisation, distribution channel, price list, document currency, pricing reference material
- #3: Condition table A004 = Sales organisation, distribution channel, pricing reference material
When using hierarchical access, then you do not need three condition tables because you merge them into one. Then you configure the sequence in reading this single table to get the correct pricing master data.
Hierarchical access can be replicated in BRF+ using a single decision table and three rulesets within a function.
The first step within Business Rule Framework is to create a data element for the pricing result for the price condition type PR00.
When you want to return 5 pound sterling per 1 piece, then:
- Rate = 5
- Currency = GBP
The rate and currency are linked when creating a element that is linked to the SAP data dictionary data element KBETR.
In this example we assume that all prices will be per 1 piece.
Then you create decision table with the following columns:
- Sales organisation (VKORG)
- Distribution channel (VTWEG)
- Price list (PLTYP)
- Document currency (WAERS)
- Sold-to party (KUNNR)
- Pricing reference material (MATNR)
- Price (KBETR)
Notice that the last column is the result. There can only be one result that can be returned by the decision table.
You now can fill the decision table with data.
Next step is to create a BRF+ function that will contain three rulesets. Each ruleset will refer to the same decision table, but uses a different key to find a price.
Ruleset #1 looks in the decision table where the Sales organisation, distribution channel, sold-to party and pricing reference material matches the values received in the BRF+ function signature.
If no match was found, then ruleset #2 will try to get a price using sales organisation, distribution channel, price list, document currency and pricing reference material.
When that also failed, then ruleset #3 examines the decision table using the sales organisation, distribution channel and pricing reference material.
Obviously no result will be returned when all rulesets did not find a price.