Introduction:
Have you ever come across a business requirement to have different Billing Document number Prefixes/Number ranges as per Country/Company code.
Good news! This blog illustrates the steps to configure S/4HANA Flexible Billing Document Numbering to meet custom business requirements for determining billing document numbers based on set conditions (e.g. Company code and Billing Type)
As a business expert, you can smoothly implement it and experience great functionality within CPF.
The following steps take you through all the required configuration steps:
- Create Number range Prefixes and Number range Intervals
- Create a CPF formula based on the decision table that contains defined numbering rules
- Define Custom Routines for Flexible Billing Document Numbering and assign it your CPF formula
- Assign Custom Routines to Billing Types
Configuration can also be done with a few clicks in the
Manage Your Solution app (from Implementation Cockpit tab)
Customizing for Sales and Distribution:
1. Under Define Number Ranges for Billing Documents, create number ranges. If Prefix is required, define them in the
Define Number Range Prefixes for SD Documents activity (same path as previous activity)
Example : Prefix = BA / Number range = 01

2. Under , create a CPF formula (including a decision table) to define Formulas for Flexible Billing Document Numbering as per business requirements and make a note of your formula ID
Example: Formula ID =_Flex_Billing_Formula
Assign desired parameters in your Formula


Define Decision Table with mapping of desired parameters to numbering rule
3. Under Define Custom Routines for Flexible Billing Document Numbering, define a Routine number
Example: Routine Number 300001 defined and assigned to formula _Flex_Billing_Formula
Assign a Routine number to your formula by selecting the implementation type Configurable Parameters and Formulas (CPF) and entering the formula ID as the enhancement ID

select the billing document type for which Flexible Billing Numbering is required and enter the routine number
Example: Routine 300001 assigned to Billing type ZF1 
Conclusion:
On generating a billing document, the system calls the assigned CPF formula to show custom Billing Numbering.
Example: Billing document number BA0000002 was created successfully with the prefix BA
Happy viewing!
Thank you for reading this blog post, p
lease feel free to share your feedback or collaboration in the comments section below.
If you enjoyed this article, share it with your friends and colleagues!
Related Links on SAP Help Portal:
Flexible Billing Document Numbering
Using Configurable Parameters and Formulas (CPF) to Implement Flexible Billing Document Numbering