Application Development 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: 

Number range reset

Former Member
0 Kudos

Hello Experts,

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

Eg:

CREATING

EMP Number: 00005 (Current number from Number range object)

Emp Name : SAPUSER

Module : ABAP

YES NO

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 :

Module :

YES NO

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.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI,

Thats how number ranges work if you are using function module "NUMBER_GET_NEXT" try setting IGNORE_BUFFER = "X" to use numbers that might not have actually been used.

regards,

Himanshu

6 REPLIES 6

Former Member
0 Kudos

HI,

Thats how number ranges work if you are using function module "NUMBER_GET_NEXT" try setting IGNORE_BUFFER = "X" to use numbers that might not have actually been used.

regards,

Himanshu

0 Kudos

HI,

Yes I am using the FM 'NUMBER_GET_NEXT' but by setting IGNORE_BUFFER = 'X'. It stilling getting incremented.. its not working.

0 Kudos

hi ,

use the function module 'Confirm_to_ok' and return the answer,it ll be eithr 1 or 0,if teh value is oen call the function module .number_get_next if its zero reset the values...

thank you

0 Kudos

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

Regards,

Raymond

(*) [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]

0 Kudos

Got the solution..

Thanks for all the replies......

Former Member
0 Kudos

Hi,

do not display the new number in the screen, only the fields that need to be entered by the user. You should only get the next number when the user has pressed SAVE. After successful save inform the user of the newly created customer.

If you really need to display the new customer number before save, you should get the number before the call to the screen'.

Hope this helps.

Roy