Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

document numbers

Former Member
0 Likes
1,526

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

12 REPLIES 12
Read only

Former Member
0 Likes
1,475

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

Read only

andreas_mann3
Active Contributor
0 Likes
1,475

No, you can only reset the number(only internals) with

SNRO - interval - change current number

Read only

0 Likes
1,475

If I reassign the contract numbers, would it just ignore the contract numbers already assigned to other contracts, or would it give an error.

Read only

0 Likes
1,475

exactly Max, I didn't do a BAPI COMMIT. So now how do I retrieve those lost numbers to use them.

Read only

0 Likes
1,475

Any help on this guys?

Regards,

Vijay

Read only

0 Likes
1,475

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....

Read only

0 Likes
1,475

what would happen then if there are documents larger than the number that I set it to?

Regards,

Vijay

Read only

0 Likes
1,475

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...

Read only

0 Likes
1,475

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

Read only

0 Likes
1,475

i think (i am 99% sure...) the system does not retry if posting fails(with 6,7,8...)...

thanks,

Renjith

Read only

Former Member
0 Likes
1,475

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

Read only

Former Member
0 Likes
1,475

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.