SAP Number Range Buffer (BC-CST-NU)


The number range buffer is used to increase performance when assigning numbers. Instead of fetching the numbers each time from the database, a single access to the buffer suffices. Only when the buffer is empty, is it refilled from the database (table NRIV).

Use of the buffer has the following benefits:

·        Accessing the main memory is a thousand times quicker than accessing the database. Speed is particularly important for applications that assign numbers frequently.

·        Database accesses are always subject to the database transaction mechanism. Once an application has assigned a number for one user, a second user cannot assign a number until the first user has executed a commit operation on the database. The application blocks further assignment, and the second user has to wait, until the commit has been executed.

·        The number range buffer can also prevent deadlock situations, which may arise from assigning different numbers in a different order.

Since the SAP kernel accesses table NRIV directly for the number range buffer, the structure of the table must never be changed.  This also applies when adding new fields.

Implementation Considerations

You can use the number range buffer in the number range object maintenance (transaction SNRO) (Edit ® Set Buffer ® Main Memory). First you activate the buffering in the main memory for a number range object.  Then you have to specify how many numbers you want to reserve in the buffer for the respective object. This value depends on how much demand for numbers an application has. Values between ten and one thousand are normal. In extreme cases you can also enter ten thousand or more. The maximum level of the buffer does not depend on how many numbers are buffered for an interval.

Be aware that when the buffer is used gaps in document numbers may occur (see How the Number Range Buffer Works). Make sure that this does not cause any legal problems in the application you are using.


For general information on using number ranges and number range objects see Number Ranges.


For information on the functions and administration of the number range buffer see:

How the Number Range Buffer Works

Administration of the Number Range Buffer