All about CI billing – Billing Process, Subprocess, Selection Variant and Grouping Variant with Aggregation
The below post shows how the selection variant of a billing process helps in finding correct set of BITs to be taken further for the billing process and the grouping variant helps to put which set of selected BITs to be put together into billing units and do the aggregation inside each billing unit.
By default for the same header data, all of it BITs can be put together into a single billing unit but the customizing helps not only how to merge but also how to split the BITs into different billing documents.
The billable item class- CUSG
The subprocess- TELC
Assigning subprocess to the bit class.
The billable items types- TCAL, TDAT & TMSG
Assigning billable item type to the subprocess.
The source transaction type.
The debit and credit- main & sub transactions for the subprocess and billable item type.
Before doing the bill process, let see the billing type and billing item type and assignment.
The billing type- BTTE
Here we will not use any custom billing item type but will use- 0INVBILL .
Let’s assign the same billing item type to the billable item type.
Let’s see the billing process and the selection & grouping variant.
Here the selection variant- SVTE . The selection variant helps to pick up the BITs for the billing depending on the selection criteria mentioned in the variant.
The assigned BIT class- CUSG [ here we can assign multiple BIT classes but for start with take only one BIT class].
The billable item type for the bit class of the selection variant. Once of the billable item type are EXCLUDED.
For now the source transaction type is initial in the selection variant.
The selection variant helps in selecting the matching BITs where as the grouping variant determines which all bits can be put together into separate billing units and creates billing doc per billing unit and again in each billing document how the BITs can be aggregated.
In Grouping Variant, first is the grouping characteristics. For simplicity here we will consider SOURCE TRANSACTION ID- SRCTAID .
The grouping variant is GVTE.
The assigned characteristic is source transaction id. It has two sections billing unit and aggregation behavior.
The billing process- BPTE
Here we have taken a single subprocess. Multiple subprocess can be assigned to a single billing process but in that case the billing split happens for the subprocess.
The billing process with subprocess, selection variant, grouping variant and the billing type.
With above steps we are ready for the checking of selection and grouping.
->1: Lets check the selection variant.
Lets create few bits for the same subprocess, same bit class but with different billable item type .
Here the BIT Monitor.
Let’s check how selection variant works with the single billing doc creation transaction.- FKKBIX_S
The current selection variant.
The selection picks all 3 BITS as it matches to bit class and billable item type maintained in selection variant.
Let’s make the one of the billable item type- TMSG as excluded.
Now the billing – picks all BITs except when billable item type= TMSG
We can also delete- one billable item class – TDAT from the selection variant.
Out of 3 billable item class , one is not added to the selection variant, one is excluded.
Now when billing is executed for the billing process- it picks only one BIT out of 3 satisfying the selection variant.
let’s delete all billable item type for the BIT class of the selection variant.
Now it picks all 3 bits in the billing selection process as the selection is made on basic of the BIT class as we have not specified any billable item type under BIT class.
Now currently we have only BIT class assigned to the selection variant but no billable item type under the bit class but let’s now assign source transaction type 01 under the BIT class.
The BIT monitor contains below 5 BITs , 3 BITs with source transaction type- 01 and others with source transaction type- 02.
The billing now picks 3 bits with source transaction type- 01 satisfying the selection variant.
let’s make source transaction type- 01 as excluded in the selection variant.
The billing process now excludes 3 bits with source transaction type- 01 and selects the rest 2 BITs.
Now lets add 01 & 02 source transaction type to the selection variant.
The billing process now picks all BITs with BIT class- CUSG and source transaction type- 01 or 02.
Upto now we get to know on a basic level how selection variant helps to pick the required set of BITs out of the pool of BITs for the billing process. Now lets check the Grouping Variant.
Before this – currently the selection variant set up is as below- It has 3 billable item type and source transaction type- 01 & 02 under the BIT class- CUSG.
The grouping variant – GVTE contains the SOURCE TRANSACTION ID: SRCTAID as the grouping characteristics.
There are two different parts:
1-> Billing Unit- It determines with all selected BITs can be put into a single billing unit/billing document.
2-> Aggregation Behavior- It works within a billing unit, how the BITs selected for a single billing unit can be aggregated. Aggregation mains works with numerical fields. Like adding the amounts if the currency is same or adding the quantity if the unit is same .. Like follows.
Execute the billing transaction.
With the help of selection variant of the billing process, picks the below shown 4 BITs.
It sets the same billing unit to all the 4 BITs as the source transaction ID is same for all BITs which is the grouping characteristics.
Select execute button.
Choose display billing document.
With aggregation behavior, it add up the amount as all 4 bits have the same currency and also adds up the quantity.
let;s check below case- Below are the bits with same source transaction ID but with 2 different currencies.
Execute billing for the billing process- The selection variant selects below BITs for the billing.
As all bits have same source transaction ID, they are assigned the same billing unit.
As the currency are different, the BITs split into two billing items and in each item the aggregation happened for amount, quantity.
Lets check another case- below are the BIT monitor with 2 set of BITs having different source transaction ID.
The billing process- selction variant picks below bits for billing.
Now it assign two billing units the BITs as the grouping characteristics- source transaction ID varies.
It tries to create 2 billing document.
For the first billing document, the items split as they have different currencies and then aggregation happens for each item.
The second billing doc is created for another source transaction ID where all BITs are combined to for a single billing item and aggregated the amount as all BITs have same currency and also quantity is aggregated.
Nice ! looking more topics on hybris billing