Skip to Content
Product Information
Author's profile photo Benjamin Stoesser

How to Implement Flexible Billing Document Numbering with Configurable Parameters and Formulas (CPF) – Video Tutorial

Did you know that you can define rules that the system uses to determine number range intervals and number range prefixes for the numbering of newly created billing documents?

These rules evaluate header fields of the billing document that is being created to dynamically determine the resulting document number.
Custom number range intervals and prefixes can be useful if you want to make the origin of an invoice recognizable at a glance (for example, invoice UK123456 vs invoice US923456). They can also help to fulfill legal invoicing requirements that exist in some countries.

Flexible billing document numbering was previously only possible through the implementation of ABAP custom logic (via Business Add-Ins, AKA BAdIs).
Thanks to the Configurable Parameters and Formulas (CPF) framework, you can now set it up with just a few clicks across a handful of configuration steps in the Manage Your Solution app.

The following two-part video tutorial takes you through all the necessary steps:

  • Overview of the example target implementation
  • Creating your number range intervals and number range prefixes
  • Creating your CPF formula, including the decision table that contains the numbering rules
  • Making the required configurations to link your formula to specific billing document types through use of a custom routine
  • Testing the new implementation by creating billing documents with specific attributes to trigger some of the implemented rules, then check whether they are applied correctly

You can watch the videos below. Happy viewing!


Related Links on SAP Help Portal:

Flexible Billing Document Numbering

Using Configurable Parameters and Formulas (CPF) to Implement Flexible Billing Document Numbering

Assigned Tags

      16 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nancy Guo
      Nancy Guo

      Thank you for sharing! The functionality is clearly explained!

      Author's profile photo Andrew Saunders
      Andrew Saunders

      This is absolutely brilliant Ben. Thanks!

      Author's profile photo Benjamin Stoesser
      Benjamin Stoesser
      Blog Post Author

      Thanks! Hope it's helpful!

      Author's profile photo Andrew Saunders
      Andrew Saunders

      Hi Ben,

      The decision table seems like a very functional-friendly way to stipulate the priorities compared to writing code to stipulate this which I think I see more often around custom routines/logic/formula.

      Are decision tables like this for configuration new at all or has this always been around?

      Author's profile photo Benjamin Stoesser
      Benjamin Stoesser
      Blog Post Author

      Hi Andrew,

      I can't comment definitively for the whole of SAP S/4HANA, but it's the only decision table in configuration that I'm currently aware of.

      Author's profile photo Katalin Csengodi
      Katalin Csengodi

      I like to have videos explaining the functionalities. Thank you Ben 🙂

      Author's profile photo Horatiu-Valentin Dita
      Horatiu-Valentin Dita

      Hello,

      Thank you for this!

      How can I make the conditions also yearly dependent? To configure different number ranges per Company codes and per years...

       

      Author's profile photo Benjamin Stoesser
      Benjamin Stoesser
      Blog Post Author

      Hi there,

      unfortunately this is currently not natively supported. If you are a customer, I would encourage you to create a feature request for this topic on the Customer Influence Portal.

      Alternatively, it should be possible to achieve this by creating a custom billing document field via extensibility, using a BAdI implementation (BAdI "Custom Data Transfer for Billing Documents") to automatically fíll this field with the current year, and then include this custom field in your decision table.

      Best,
      Ben

      Author's profile photo Dhanush M
      Dhanush M

      Hi,

      I followed the same as suggested but i am getting this error :

      {
      	"message": "HTTP request failed",
      	"headers": [],
      	"statusCode": 500,
      	"statusText": "",
      	"responseText": "ICC_NUMBERING/012No no. range assigned to co. code 3310, place of bus. DXB, doc.class AIN on06.04.2023" }
      
      Note: I checked in CBC, systme is picking my number range however the document no is not reflecting in quality while creating billing document.
      
      I have taken this number range for 3310 company code:
      
      
      Author's profile photo Benjamin Stoesser
      Benjamin Stoesser
      Blog Post Author

      Hi,

      Sorry to see you are having this issue.
      if the problem persists, please open a ticket with SAP support.

      Author's profile photo Izabelle Lopes
      Izabelle Lopes

      This blog is very detailed! Thanks a lot, Ben

      Author's profile photo Sankar Balu
      Sankar Balu

      Thanks for sharing ,Benjamin.
      Solution works fine for sales billing documents . Can we use this solution for Direct FI invoices? Ie Sundry invoices. Eg; DR accounting doc type. If so how can we assign the routine to accounting document type?

      thanks

      Sankar

      Author's profile photo Benjamin Stoesser
      Benjamin Stoesser
      Blog Post Author

      Hi Sankar,

      sorry, but unfortunately this functionality only supports billing documents create by Sales Billing (formerly SD Billing).

      Best,
      Ben

      Author's profile photo Sankar Balu
      Sankar Balu

      Thanks Ben for your quick response. Just wondering on the reason to have accounting document type as one of the condition in the decision table. Can you pls help advise ?

      Thanks

      Sankar

      Author's profile photo Benjamin Stoesser
      Benjamin Stoesser
      Blog Post Author

      Hi,

      The accounting document type (to be created during posting) is an attribute of a billing document.

      I believe some customers have use cases where they want to determine specific types of billing document numbers based on the journal entry (AKA accounting document) type that will be created for the billing document later.

      Best,
      Ben

      Author's profile photo Sankar Balu
      Sankar Balu

      Thank you again, Ben .

       

      Thanks

      Sankar