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: 

Problem with generating of numbers NUMBER_GET_NEXT

Former Member
0 Kudos

Hi,

I need to generate numbers for Project-Id. I've created a number range object (SNRO) NR_PROID (Settings: number length domain: numc10, No. of numbers in buffer: 10) with interval 01: 0000000001 - 9999999999, current number 100.

I use it in the FM NUMBER_GET_NEXT:

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

NR_RANGE_NR = '01'

OBJECT = 'NR_PROID'

IMPORTING

NUMBER = PROJID_TEMP

EXCEPTIONS

INTERVAL_NOT_FOUND = 1

NUMBER_RANGE_NOT_INTERN = 2

OBJECT_NOT_FOUND = 3

QUANTITY_IS_0 = 4

QUANTITY_IS_NOT_1 = 5

INTERVAL_OVERFLOW = 6

BUFFER_OVERFLOW = 7

OTHERS = 8.

But I always get numbers from 0 to 9, and then 0, 1, ...9 again. Each time increases the current number of the object's interval (10 numbers).

However if I test the FM NUMBER_GET_NEXT with my object NR_PROID (SE37) it works fine.

Does anybody know, what the reason could be?

Thank you in advance.

Irina

Edited by: Irina Ziegler on Feb 6, 2008 10:08 PM

Edited by: Irina Ziegler on Feb 6, 2008 10:08 PM

5 REPLIES 5

Former Member
0 Kudos

Hi Irina,

If you mean the number range is skipping 10 numbers in between runs then its because of the buffering in the number range.

To avoid the buffer influencing the number range, pass

'X' to the function module parameter: IGNORE_BUFFER.

This should resolve the problem.

Cheers,

Aditya

0 Kudos

Hi,

if I add IGNORE_BUFFER = 'X' to my code, I get always the same number - '1'. Without IGNORE_BUFFER I get numbers from 0 to 9. What I need, are numbers beginning with the current number or higher (for example, if I have in the interval of the number range object current number 100, then my next number should be 101 etc.).

Irina

0 Kudos

Ok. I am not certain what the problem is now, however can presume it's something like it takes 9 as upper limit and once reached rolls back to start from lower limit, i.e. 0.

Can you try one shot.

There is a checkbox No interval rolling in the number range object (SNRO). By default this checkbox is unchecked, can you check mark ('X') this checkbox and then check your application.

0 Kudos

I've tried it, but the result is the same

0 Kudos

It works now

The problem was that I defined projid_temp TYPE N, and it could contain only one digit.