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

Number range function module giving problem

Former Member
0 Likes
4,639

DO 200 TIMES.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = prange

object = pobject

IMPORTING

number = pnumber

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.

enddo.

I have maintained a number range object internal in SNRO and using in the program to get the next numbers and also it will be automatically updated in the sap.

When i do for say 10 times then all the numbers comes in sequence without any gap.

If i say do 200 times, the number sequence is showing gaps ie 1 to 80 its sequence and then there will be a gap and then 150-200 sequence and 300-420 sequence. In between gaps are occuring , Please tell me why so?

If this wont solve the purpose then i need to go for external number range, in this case how should i update the sap number range ie the number range object?is there any function module to update it ? or do i need to maintain a ztable for the number range and update there?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,239

Hi Madan,

check if your number range object is buffered. This would account for the jumps in the number range if your SAP system has multiple application servers. I.e. in that case each application server grabs a range of document numbers and then supplies those numbers from the buffer. Once the buffer is empty, the application server grabs another bunch of numbers. Thus when enabling number range buffering you can have gaps or sometimes also the nice relation higher document number = document created later is no longer true.

Cheers, harald

p.s.: You could switch off the number range buffering (assuming that my explanation is really the cause of your symptom), but that is often not advisable, because it can introduce performance issues (especially when you need to grab lots of numbers). You can observe those problems usually in SM50 with processes hanging on table NRIV...

2 REPLIES 2
Read only

Former Member
0 Likes
1,240

Hi Madan,

check if your number range object is buffered. This would account for the jumps in the number range if your SAP system has multiple application servers. I.e. in that case each application server grabs a range of document numbers and then supplies those numbers from the buffer. Once the buffer is empty, the application server grabs another bunch of numbers. Thus when enabling number range buffering you can have gaps or sometimes also the nice relation higher document number = document created later is no longer true.

Cheers, harald

p.s.: You could switch off the number range buffering (assuming that my explanation is really the cause of your symptom), but that is often not advisable, because it can introduce performance issues (especially when you need to grab lots of numbers). You can observe those problems usually in SM50 with processes hanging on table NRIV...

Read only

Former Member
0 Likes
1,239

Hi,

Try this,

In the Properties of the Number Range Object - in Tcode SNRO,

Buffering Number should be set to zero.

This helps in to stop skipping of numbers at runtime.

Regards,

Sathish