Reason and Prerequisites
The reorganization of the buffers of an interval means that entries that are still active in the buffer tables (NRIV_LOKAL and NRIVSHADOW) are moved to documentation tables (NRIV_RESTE or NRIV_DOCU) for documentation purposes.
In the case of SM56 buffer entries, they are simply lost.
An entry in the buffer table is active if the number level (NRLEVEL) is smaller than the upper buffer limit (TONUMBER).
When is Reorganization needed?
- After the buffering method being changed to a different buffering method;
- See Note 1030400 - NR: Change of buffering type
- When the interval limits are changed (From Number or To Number);
- When the current number level is changed (NR Status);
- If intervals are year-dependent and an interval for a new year is inserted and an interval for year 9999 already exists.
Why is Reorganization necessary?
A reorganization can become necessary for various reasons:
- Changes were made to the buffering type or the interval limits;
- Intervals were overwritten by a transport;
- Manual changes were made to the number range status in transaction SNRO/SNUM;
- The table has too many entries and needs to be reorganized;
- There are inconsistencies or duprecs appearing due to wrong entries on the buffers/tables.
Will reorganization cause gaps?
In reorganization for parallel and local buffering, the used buffers are deleted from the table NRIVSHADOW (or NRIV_LOKAL) and unused buffers are moved to the documentation tables NRIV_DOCU (or NRIV_RESTE), respectively.
This will cause gaps. The non-assigned numbers can be documented using the program RSSNR0S1.
In reorganization for main memory buffering, the remaining numbers are removed from SM56 buffer and lost.
The non-assigned numbers cannot be documented.
See Note 504875 - Buffering number ranges. With this buffering method, gaps are expected (gaps may exist and cannot be documented).
How to reorganize?
If the interval is used up, you can use transaction SNUM to reorganize NRIV_LOKAL.
For this, choose the following menu option in transaction SNRO: "Range -> Reorganize".
As a result, all the buffers of NRIV_LOKAL for the interval are transferred to the table NRIV_RESTE and remain documented.
If the interval is not used up, the reorganization is more complex. In this case, proceed as follows:
- First, ensure that no numbers are used during the execution;
- Make a note of the current number level (NRIV-NRLEVEL);
- Set NRLEVEL to the highest value (corresponds to TONUMMER).
- Choose "Range -> Reorganize". In this case, all the processes can be documented.
- Set the NRLEVEL value in the interval to its original state (of which you previously made a note).
NOTE: Buffering type ‘P’ (extended local buffering) is not supported any more. It still works as long as the instance does not exceed the maximum length of 17 characters.
The successor of this buffering type is the Parallel Buffering; you should change the buffering type.
The non-used numbers remaining in the 'old' buffers (in table NRIV_LOKAL) will not be used any more. They can be documented with report RSSNR0S1 (documented gaps).
You can execute program NK_REORGANIZE, specify the object and run the report.
Find more information in SAP Note 1244898 - NR: Reorganization of local buffers for interval
NOTE: Report NK_REORGANIZE can be executed in two different ways
- Reorganizing with option 'Used Buffers', means that Ranges that have already been used up [NRLevel is equal than the upper buffer limit ToNumber] will be removed from NRIVSHADOW.
This will not cause any data loss.
Reorganizing with option 'All buffers' could cause data loss.
>> With option "All buffers(test)": buffers which still contain numbers, will be displayed on a list; but the buffers will not be removed from table NRIVSHADOW.
>> With option "All buffers(production)": these buffers which contain numbers, will be moved from NRIVSHADOW to NRIV_DOCU. This will cause gaps, that can be displayed afterwards using report RSSNR0S1
Main Memory buffering
In this case, you do not need to reorganize using transaction SNRO. See SAP Note 741698 - NR: Reorganization of buffers
Instead, use transaction SM56 to reset the number range buffer:
-> Call transaction SM56.
-> Choose the menu option "Number Range Buffer -> Reset".
A dialog box in which you can enter all the information is displayed.
->Enter object name.
Caution: The generic entry is blank, not '*'.
You must also set the "Global Reset" indicator so that all instances are reset.
Objects with main memory buffering: 741698 - NR: Reorganization of buffers
Objects with local or parallel buffering: 1244898 - NR: Reorganization of local buffers for intervals
2787435 - Number Range Objects inconsistencies [Troubleshooting]