Number range reset
I have created a Number Range Object, to get Employee numbers. I my report when the User presses the Button "ADD EMP/Create EMP" I am getting the current number using number range object. So a pop up with current number and details to be entered for the Number like EMP Name, Module etc...,
EMP Number: 00005 (Current number from Number range object)
Emp Name : SAPUSER
Module : ABAP
Its fine if i create the EMP and save it(YES).
Now again i try create a new EMP by clicking ADD EMP/Create EMP button.
WITH OUT CREATING AND CANCEL
EMP Number: 00006 (Current number from Number range object)
Emp Name :
If i select NO, and again try to create EMP Details by clicking ADD EMP/Create EMP button. I am getting the current number to be 00007 missing number 00006.
So i want to reset in the current number to 00006 which displayed earlier & not used.
can any one help me out in this issue.
Raymond Giuseppi replied
You must ignore the number range buffer () AND execute a [ROLLBACK|http://help.sap.com/abapdocu_70/en/ABAPROLLBACK.htm] (*) to release the number range and undo the incrementation.
You could only assign the number during the SAVE operation : when 'SAVE', NUMBER_GET_NEXT with IGNORE_BUFFER set, INSERT table, [COMMIT|http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm] (and send a status TYPE 'S' message with the actual number created.)
(*) [How the Number Range Buffer Works|http://help.sap.com/saphelp_nw04/helpdata/en/95/3d5540b8cdcd01e10000000a155106/frameset.htm]
(**) But beware of [Implicit Database Commits|http://help.sap.com/abapdocu_70/en/ABENDB_COMMIT.htm]