‎2006 Feb 20 11:09 AM
Hi,
I have assigned a document number range to a sales document type. But I do a lot of simulations of creation of sales orders, contracts etc. They are assigned numbers but are not saved. But the document number is lost. Is there any way, I can renew the document number and assign the same document number to a different new contract or a sales order.
Regards,
Vijay
‎2006 Feb 20 11:15 AM
Hi Vijay,
enter transaction SNRO and choose the object you want to change. Then, in "Change status" you may want to change the actual number of assigned document number.
Or, in the transaction you entered to assign document range to document type (that is, VN01), go to "Change status" and proceed as above.
I hope it helps. BR,
Alvaro
Message was edited by: Alvaro Vidal-Abarca
‎2006 Feb 20 11:16 AM
No, you can only reset the number(only internals) with
SNRO - interval - change current number
‎2006 Feb 20 2:02 PM
If I reassign the contract numbers, would it just ignore the contract numbers already assigned to other contracts, or would it give an error.
‎2006 Feb 20 2:02 PM
exactly Max, I didn't do a BAPI COMMIT. So now how do I retrieve those lost numbers to use them.
‎2006 Feb 21 4:06 PM
‎2006 Feb 21 4:29 PM
Resetting of the current number in the range can be done using transaction SNRO..Enter the number range object and click on the "Number Ranges" button and then inside click on the "Change Status" button...you can reset the current number here...
However, be careful of doing this and make sure there aren't any documents in the system with the values above the number you are resetting it to....
‎2006 Feb 21 4:30 PM
what would happen then if there are documents larger than the number that I set it to?
Regards,
Vijay
‎2006 Feb 21 4:37 PM
then it would cause a problem when the number range hits a number with a document number already existing in the DB to cause key violation...
for ex: take this instance...
- you lost the number 5 becuase of the commit not being made...
- meanwhile some body saved documents online with numbers 6,7,8
- now you are resetting the number range back to 5...
- when document 5 is created no problem...however when the numbers 6,7,8 are used in subsequent save document attempts(could be online/bapi etc...) it is going to fail...
hope i am clear...
‎2006 Feb 21 4:39 PM
yes renjith, but then it should definitely fail shouldn't it. we won't want to override the document numebrs 6,7,8. Would it try the next number till it keeps failing. Say in our instance, it tries to create 6, 7, 8 and then 9. Then doc number 9 would be successfully created wouldn't it. Or will there be some other problems.
Regards,
Vijay
‎2006 Feb 21 4:46 PM
i think (i am 99% sure...) the system does not retry if posting fails(with 6,7,8...)...
thanks,
Renjith
‎2006 Feb 20 11:38 AM
Hi
How have you simulated the creation of order?
If you use the BAPI without to do a commit, the document isn't stored and the number is lost.
Max
‎2006 Feb 21 11:46 PM
The system won't keep trying until it finds the next successful document number. When it fails to create a sales document due to key violations, you could then go set the current number to the next unused document number via SNRO. You could always check into table VBAK and see what is the lastest sales document number saved, and use that to save the current number in SNRO transaction.