There are 3 kinds of table in the SAP CC. Translation Table, Tier Table and Mapping Table.
Translation Table:
- Used to store data required to perform rating
- Can be queried in price plans
- Can be used across multiple charges
- Supports versioning and start/end dates
- Not visible from SAP CRM
- Not override-able on Provider Contract basis
- Price plans cannot write to Translation (or any other) tables. The SAP CC APIs must be used to modify these objects.
Tier Table:
- Defines different output values for different ranges of a numeric input value (similar with the SAP SD scale pricing technique) .
- Output values can be numbers or strings.
- For number output values, different computation modes are available.
- Tier Table management is similar to the Translation Table one (versioning, overriding, sharing…)
- Not visible from SAP CRM
- Not override-able on Provider Contract basis
- Example:
Voice call tiered pricing
The first 30 minutes are charged at $0.10/min.
The following 30 minutes are charged at $0.05/min.
The following minutes are charged at $0.01/min.
A call duration of 80 minutes is charged $4.70.
(30*0.10) + (30*0.05) + (20*0.01)
Mapping Table
- New for SAP CC 3.0
- Viewable from SAP CRM
- A Mapping Table Class defines the table schema.
– A set of input and output column descriptions - A Mapping Table is an instance of a class.
– Each instance is a table data that follows the schema. - Stored in the catalog of the service provider
- Mapping Table management from the UI
– Create, modify, search and delete operations
– Row level operations - Component to execute a table lookup (from the pricing logic)
- Can be created on a product and provider contract basis by SAP CRM and specific instance referenced in price plans
Now that we have the theory over with, let’s do some exercises. Below is the scenario.
You need to create a Charge for the pricing of usage events related to the Call Service. The price depends on the combination of the plan type and the called number prefix as shown below.
Since it’s not a tiered scenario and it is not necessary for the SAP CRM (provisioning system) to access the table, we choose Translation Table to represent the reference data.
Create a new Translation Table called ‘[T01] Call Pricing’. File->New->Translation Table
At the Table Schema tab, in the Input Columns add ‘Plan Type ID’ with description ‘Plan Type User is subscribe to’. Add a second input column ‘Number Prefix’ with description ‘Dialed Number Prefix’.
For the Output Columns add ‘Rate per Minute’ type Number.
Select the Table Instance tab and key in the Translation Table data.
Save the Translation Table in the database.
Let’s next create a Charge and utilize the Translation Table in the Price Plan logic. You will reuse the Charge T[01] Mobile Usage Charge that you have created in the previous chapters.
Choose File->Open->Charge
Choose the Charge T[01] Mobile Usage Charge.
Click on the Charge’s Parameters tab and click the add button.
Add ‘Plan Type ID’ type String with Value ‘Standard’. This Parameter will act like a property or a variable with the initial value ‘Standard’. We can then link the Parameter to the Translation Table input in the Price Plan to get the output rate. In real life (IRL), the CDR or the raw network information will hold such properties and pass it to the SAP CC via mediation.
Remove the Prefix Switching component called Destination Check.
Right click on the Call Usage Rate node, Add Component->Operators->Table Operator
Select the Translation Table T[01]Call Pricing if it is not yet selected.
Fill in the Table Operator name as ‘Lookup in Cell Pricing Table’. In the Table Operator Definition, Select ‘Start With’ for the Comparison Operator, ‘Consumption Date’ for the Reference Date.
In the Mapping of Rating Context view, choose the appropriate Mapping Property as shown below.
Next, add a Numbers comparator to check if the ‘Rate Per Minute’ value is > 0. Where does the ‘Rate Per Minute’ comes from? It comes from the Output Column of the Translation Table.
Choose Property Name ‘Rate per Minute’, Operator ‘Is Greater Than’ Comparison Value ‘0’.
If the ‘Rate Per Minute’ value is > 0, add a Linear function component to generate a fee of the ‘Duration’ multiplied by the ‘Rate per Minute’.
If the ‘Rate Per Minute’ value is < 0 , there has been a problem in the table lookup so add a No access function component and an appropriate error.
Run the Trial Run Price Plan tool and experiment with different input values. Verify that the rated amount is in line with our Price Plan logic design.
You can manipulate any values in the Input Properties.
We have initially gave the Plan Type ID a value of ‘Standard’ in the Parameter of the Charge. We can change it to a different value to test the rest of the combination.
A No Access Function will throw an exception message. IRL, we should define a more detail error message. This message will be routed to the relevant messaging system for error handling. Bear in mind that the Rating and Charging process is done in the background with hundreds or thousands of transaction computed at any given moment.
Save the Charge in the Database.
Accept the default Effective Date and click OK.
Voilà!