New number range to match with production number
We have a requirement from the customer as below-
BDENR field in the BLPK table get updated every time the production posting happens. The problem here is that if multiple users are accessing the same transaction at the same time, the BDENR number gets duplicated as currently we are using "last entry+1" logic in the z-program which is incorrect.
The requirement now is to use the SAP number range object to achieve the locking mechanism to avoid the duplication.
Now our problem is how the newly created number range should be in sync with the existing numbers in the production as the numbers gets updated on daily basis.
For eg. New number range will be from 1000 to 9999
The latest BDENR in production is for eg. 5000
Using this number range, next number to be updated in BDENR should be 5001 after moving changes to production.
Raymond Giuseppi replied
After transport ( Interval -> Transport) number ranges are overwritten with transported values, you have usually to manually set the current number in SNRO transaction or transport a value with a safety value (here not 5001, but 6000 or 5100 to prevent duplicate keys, accepting gaps in number range)
Hint: you could consider creating a small report that will update NRIV and be executed during import, transport an entry of type XPRA PROG <program_name> so it will execute in mandt 000 during import, you may use CLIENT SPECIFIED options in it.