Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
Showing results for 
Search instead for 
Did you mean: 
Active Contributor

Enterprises which have a global presence do a lot of business across the world in various countries bound by the rules of that particular country.

Take an example of a typical manufacturing company

Its daily operations and business include Procurement of material, sales of goods and services, Product Manufacturing, Financial Transactions and a lot more to put on. SAP ERP system is the right solution for all these kinds of business transactions. Every Business Transaction/MASTER/TRANSACTIONAL data is recorded in SAP system with a unique identifier (Some number or alphanumeric characters). The good thing about this is that we can make a choice of how the number range should start from, end with, whether it should be internal or external. It’s not only restricted to a particular entity like sales order/purchase order, it can be used  to configure for any kind of business transaction and even could be used to generate a unique sequence number for custom data(Like Z transactions to store data in Z tables etc.,)

However there should be careful monitoring on these number ranges and mere negligence would lead to dire consequences especially in Production system.

I have prepared some list of points where we should keep an eye in particular in Production Systems.

Important Repository objects to Keep in Mind while working with Number Ranges

SNRO  - Number Range Transaction Code

NRIV   - Number Range Intervals Database Table

SNUM –Number Range Object Maintenance

Function Modules

NUMBER_GET_BUFFER To Read Buffer information

NUMBER_GET_INFO                Number range: Provides information for a number range number

NUMBER_GET_NEXT                NUmber range: Assigns next free number

NUMBER_GET_NEXT_V1 Assigns next free number(s)

Buffering Problem

Here you can observe Main Memory buffering enabled for Material Number Range Object and Number of numbers in buffer as 10.This means that if you’re calling the number range object for the first time the starting number will be picked up(Say Material Number Range starting from 1000 to 2000).

Material Number 1000 will be created and subsequent numbers 1001, 1002,1003,1004,1005 up to 1010 will be stored in memory buffer. Upon calling the number range object for the next time the sequence that is present in the buffer will be used instead of querying backend database table.

This  could give a better performance but will lead to problems if someone erase the memory buffer  Clearing memory buffer can be done using SM56 and one should be able to understand about the consequences of this activity. This often leads to skipping of number ranges and we could end up with documents which are no longer in sequence


Monitor Number Range utilization

If the number range reaches the upper limit and if it’s not changed before the next document gets created, system will raise an exception which would lead to SM13 update failure and subsequently ST22 dump like below. If we are performing the transaction on a foreground then system will be able to issue a warning when the number range utilization reaches the warning percentage.

Now Let’s Say the documents are created through a Batch Job, unless we monitor the system /incorporate auto alert mechanism to notify about this failure, we will not be aware of this issue.If it occurs in Production system and If we don’t take the necessary action it could lead to bad consequences and effects enterprise business as well

Interval Rolling

This feature given by SAP can be seen below as check box and this Functionality comes into picture when Number Range is completely exhausted. So, In continuation with the previous sub topic of number range utilization, Upon reaching the upper limit we can decide whether the document numbering starts from the beginning again by not enabling the check box. While this seems to be a pretty good option, care should be taken that previous documents already created must be archived/deleted periodically

Otherwise we would encounter the same ST22 Duplicate Records error which we discussed in the previous topic

Keep an Eye on Number ranges for which changes are to be done in Golden client“000”

Generally we have restricted number limit for spools and if it gets used up we will be getting SPOOL_INTERAL_ERROR occurs and system will no longer be able to generate the spool.

The Spool number range should be changed only in golden client “000” and the changes done in any other client wouldn’t be effective

We need to change the SPO_NUM number range , set the upper limit to 99,999 and its good practice to delete the spools regularly so the system uses the number range from the beginning again once it reaches the upper limit

The spool retention period by default is 8 days and spools can be deleted by using RSPO1041 which can be scheduled as a background job using SM37. Below link from will explain you further details in brief .

Please read through

Standard SAP transaction which can be used to check the spool utilization is RZ20

You can follow the below path RZ20 àSAP CCMS Monitor templatesàSpool system

You can observe the percentage utilization and  color legend showing as green which implies that “All is Well”

Never Transport Number Ranges to Production System

Generally any SAP System has a typical landscape of 4 systems

  1. SandboxàDevelopmentàQualityàProduction

While Sandbox and Development systems are purely used for implementation of Repository objects and Unit testing from a developer perspective, Quality system is used for Business User Acceptance testing

The Data in quality system gets refreshed from that of production often but not on a daily basis. In Production Business transactions happen every day and in huge numbers and therefore the data is out-of-sync with a quality system. Even though we maintain the same number ranges across the two systems Initially ,the current number used will not always be the same .

Hence it’s not a good practice to transport number ranges to production. If done so system will trigger SM13 update errors and ST22 Dumps

Unauthorized Access to SNRO transaction

Granting access rights to unauthorized SAP users might lead to inconsistencies in number ranges if they aren’t sure of how to handle number ranges. Suppose if someone changes it by mistake , we can still retrieve the original series using change documents.

  1. This can be accessed using the next screen of SNRO (i.e. once you press the display button on initial screen) .Then follow the menu path GotoàNumber Ranges

Please Note We have an option “Change Documents  available on menu and on tool bar itself, but it only reads the change data of Number range Object attributes (Like Text change or Checkbox change).In order to see the Interval range change documents you need to follow the below path

From the change documents screen you’ll get to know the user , timestamp, old value and new value etc.,. This is the beauty of change documents in SAP

Active Contributor
0 Kudos

Will Add more points if I come across any

Best Regards,


Former Member
0 Kudos


I wanted to know if I change Number range for a material, will it have any consequences? And if any, what are they?

Thanking you in advance.



Active Contributor
0 Kudos

It's not advisable to change Number Ranges often unless suggested by Business.

Also they shouldn't be transported as well

0 Kudos


Anyone has idea for RK_BELEG Number range CCMS alert ?

Warm Regards


Former Member
0 Kudos


I am having an issue with the client.

It is like while creating 10 codes the system took intial
two codes as 9 & 10 and then rest codes was numbered from 1 to 8.


what may be the reason?
0 Kudos
Hi Lakshman,

Very useful blog, wanted to check with you the approach to take if the number range for AENDBELEG is as below, and can expire soon, what options are available if archiving is ruled out.


0 Kudos
Hi Lakshman,


Nice blog,I would like to know if there is way to check if the interval has been rolled on or not.

in my system I have range

000001 to 100000 and current number lets say is 000600, is there a way to know if the number had reached the max limit and then rolled on again ?

Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Lokesh,

I don't know of an alert for the event of "rolling". The standard does not keep historical values of a number range.

Maybe you find the number range in question in the EarlyWatch Alert report? Alas, if a number range has rolled successfully, then it is dropped from the display in the report.

In any case, you could go to the EarlyWatch Alert Workspace, where you find number range information on a new card named "Critical Number Ranges". You must adjust the filters to see rolling number ranges.

HTH and best regards,
Christian Knappke
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Lakshman,

there is a new NRIV monitoring available in the

It includes a prediction on how many weeks or month are left until the numbers are exhausted taking the historic consumption into account.

I would be happy, if you could mention it in your blog, too.

Best regards,

0 Kudos
Hello Christian,


Is there a Best Practice recommendation on whether to reset a number range (roll) or create a new range?   As an example if the RV_BELEG range for SD billing documents is reaching the limit should the invoice range be reused or created new?
0 Kudos
Hello All,

Is there a Best Practice recommendation on whether to reset a number range (roll) or create a new range?   As an example if the RV_BELEG range for SD billing documents is reaching the limit should the invoice range be reused or created new?
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Joanne,

I am not an SD expert. So, please take this with a grain of salt.

I did a note search with the number range object name RV_BELEG and I found this:

2373600 - Increase available SD document numbers via alpha numeric logic in number range services

In the SD component there are a couple of further notes that might help with your question. Alas, I cannot assess their relevance for you.

It depends on the business and on legal requirements if it is possible to reuse old document numbers.Further, old documents must be archived before numbers can be reused.

HTH and best regards,
0 Kudos

I always thought I get NEXT BIGGEST number when using number_get_next. But today, I found out that 2 different calls - made many minutes from each other - and I was the only one making those calls thus only one causing the number range usage, the last call returned a number (lets say 123450) which surprisingly is not 1 greater than the last call (previous call returned 123455), but still within the buffer size. So is it really so, that when my custom "Z" number range object has definition 'Main memory buffering' = X and 'No.Of number in buffer' = 10, and my number_get_next call is executed without the IGNORE_BUFFER option, then it is not guaranteed that my consecutive number_get_next calls are returning always a greater value than the previous call? But instead can get any unused number from the buffer? This is an ECC6 EHP8 system with single application service instance that I am working with. I do understand that in multi application server system setup, the numbers returned by number_get_next are not guaranteed to be consecutive.

Labels in this area