Business Example
In the context of the Cloud Selection service, which offers three services, namely CPU, RAM, and Bandwidth, you encounter a need for reusing the same pricing logic multiple times. For this, SAP Convergent Charging introduces the concept of Pricing Macros. These macros allow for the management and maintenance of common calculation formulae for price plans and refill logic, making the process more efficient and easier to handle.
Features of a Pricing Macro
Pricing Macros, resembling price plans and represented using a multilevel tree structure, are small reusable modules capable of retaining and applying calculation formulas. They possess the flexibility to calculate an amount and generate output properties, thus streamlining the process of managing price plans and allowance logic. Moreover, these macros can be used in any charge and can also be employed within other pricing macros, leading to a cascading effect. Beyond reducing redundancies in price plans, macros can be used to merge branches of price plans back into one branch.
Macros Can Be Used in Two Ways
There Are Two Ways in Which Pricing Macros Can Be Utilized:
- As a Macro Rating Function, where the macro generates the final amount directly.
- As a Macro Operator, where the macro performs some logic and returns the results to the calling price plan for further computation.
Hint
- The output properties of a pricing macro have to be updated explicitly.
You cannot change the signature of a pricing macro (meaning its input or output properties) once it has been saved to the database. To change an existing macro, open it as a copy, modify it, and save it to the database using a different name. Then replace all usages of the old macro by the new one.
A macro must contain a function to be complete from a syntax point of view. Use the "Free" function if you don't intend to calculate a price, but rather use the macro as an operator.
While the signature of a macro stays stable after it has been stored in the CC database, the calculation logic it contains remains completely flexible and can be changed as you like. Keep in mind that a new version is created each time you modify the logic.
Design Process Steps for Pricing Macros

In the SAP Convergent Charging system, the design process for Pricing Macros involves several steps. Each numbered step correlates to the preceding figure:
- A new Pricing Macro is created.
- The definition of rating context properties for the macro's input.
- The definition of generated properties for its output.
- The logic for the macro is then configured using the pricing components.
- Configured with the logic is the Out Property Update component, used to assign a value to a generated property.
The final step entails instantiating the pricing macro in the pricing logic using the correct operator.
Process Steps in the Price Plan

Each numbered step correlates to the preceding figure: When implementing the pricing logic in the price plan, the process involves:
- Choosing, or right-clicking where the Pricing Macro logic is needed and adding a Macro Operator.
- The definition tab of the Macro Operator must be configured.
- Select the Pricing Macro to use.
- Map the properties of choice to the entry columns of the table.
- Additionally, in the case of operator usage, the computed amount property name needs to be set to a specific value, and the output property names must be defined. Data returned from the table during processing is then available in the tree structure after the mapping table comparator.
Now that you have been introduced to pricing Macros, what their design process steps are, and how they are implemented in the price plan, let’s look at a business example. Through this business example, you will create a pricing macro for a price table lookup. You will then create a charge with pricing macro and table (usage charge for CPU with counter). Let’s get started!