Skip to Content
Personal Insights
Author's profile photo Sahil Grover

Custom Logic to Implement Flexible Billing Document Numbering

Introduction

This blog post has been written to address common customer query on how to use custom logic to have additional fields in usage decision for Flexible Billing Document Numbering

Business Use Case

Many customers are asking for requirement of having additional fields in usage table to configure Flexible Billing Document Numbering. One of the use cases is to have flexible billing document number based on Plant and Company code combination. Let’s see in the blog post How it can be achieved.

Process Steps

1. Create a new field using ‘Custom Logic’

Enable for UI and Report

 

2. Create the BADI to populate the field at header

 

3. Define Custom Routines for Data Transfer to Billing Documents

4. Define Copying Control for Delivery Document to Billing Document

 

 

Now we have the set up to fill plant at Header level when sales Invoice is created.

5. Define Parameter Catalog for Flexible Billing Document Numbering

6. Define Formulas for Flexible Billing Document Numbering

 

Add

 

 

 

 

7. Define Custom Routines for Flexible Billing Document Numbering

8. Assign Custom Routines to Billing Type

Now when the billing document is created we have number range as per the decision table.

 

Conclusion

This blog post should help you to understand in detail how to use Custom Logic to Implement Flexible Billing Document Numbering

Thanks for reading this blog post, hopefully the blog post was informative

References

https://help.sap.com/docs/SAP_S4HANA_CLOUD/a376cd9ea00d476b96f18dea1247e6a5/a4660117481d46f4b3c54c5555776149.html?q=parameter%20PRIORITY

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Koushik Goguladinne
      Koushik Goguladinne

      Hi Sahil,

      Thank you for the blog. This is very helpful. Was waiting for this blog since GLX. 🙂

      Best Regards,

      Koushik

      Author's profile photo Sahil Grover
      Sahil Grover
      Blog Post Author

      Thanks.

       

      Author's profile photo N Vinoth
      N Vinoth

      Hi Sahil,

       

      Thanks for the blog, it will helpful for our projects.

       

       

      Regards

      Vinoth N

      Author's profile photo Sreekanth Krishnan
      Sreekanth Krishnan

      Hello Sahil,

      We did this configuration but want to revert it as its being tested now. The delete option is disabled. Can you please help with that.

       

      Thanks

      Sreekanth

      Author's profile photo Sahil Grover
      Sahil Grover
      Blog Post Author

      Please raise an incident

      Author's profile photo Rutwik Nagwankar
      Rutwik Nagwankar

      Hi Sahil,

      Thank you for guiding us in this blog on how to implement Plant specific Number Ranges.

      We have an additional requirement, wherein we need Number Ranges specific to Plant and Billing Document type (F2, F8, G2 and L2).

      Having followed the same procedure as above, we ar able to achieve this requirement for F2 and F8.

      However, this fails for G2 and L2 (Credit and Debit Memos). Could you please share your thoughts or guide us on why this might be failing at G2 and L2?

      Requirement -

      Company Code 2000
      Plant 2000 Plant 2101 Plant 2102
      Number Range Prefix Number Range Number Range Start Number Range End Number Range Number Range Start Number Range End Number Range Number Range Start Number Range End
      Invoice F2 ST 01 00000001 07999999 D1 08000000 08999999 T1 09000000 09999999
      Credit Note G2 ST 05 40000000 47999999 D2 48000000 48999999 T2 49000000 49999999
      Debit Note L2 ST 07 50000000 57999999 D3 58000000 58999999 T3 59000000 59999999
      Profroma F8 ST 04 30000000 37999999 D4 38000000 38999999 T4 39000000 39999999

      Highlighted in Italics works well, however, the rest does not.

      Your thoughts?

       

      Kind Regards,

      Rutwik