You are on page 1of 7

How SAP creates Alerts before expiry of Number range

Ever wondered how to monitor number ranges before reaching the critical limit ? In this blog, I will explain how expiry of
number ranges are alerted in SAP.

Number ranges are used for generating numbers while creating Master data, Transaction documents. Business normally
monitors the document numbers. SAP has a feature to give warning before expiry of number range.

The procedure is simple and explained in few steps with a sample scenario

Transaction code- SNRO holds the key. See figure- 1

Figure-1 : Initial screen for SNRO transaction

Give the Number range Object- RF_ BELEG. The output is as below in Fig-2

Fig-2 : Screen for maintaining Warning % for number range

Here warning % has been set as 30 %. Which means, if the availability of numbers are say 100, while posting 70th document
and afterwards, system gives a message, ( till you change the number range ). Here the transaction is also given for
maintaining the Number range ( FBN1 )

Just see the following example in Fig- 3, I have maintained Number range 01 for 2006 .

Availability – 30 numbers ( from 102000 to 102029) and the current number is 102018.
Fig-3 : Number range status before testing.

After posting the next document, the status is updated as below : Now the number appears as 102019 in Figure- 4

Fig- 4 : Number range status after posting.

While posting the document number 102020 ( 20th document ), system shows a message that number range has reached
critical limit. This is because, out of total range of 30 numbers, 30 % warning means 9 numbers is the critical limit. i.e 102029-
9 = 102020 is the number at which system gives the message. See figure- 5

Figure- 5 : System alert message for critical number range.


Fig- 6 : Document posted after the message.

After the document is posted, see the revised status now.

Fig- 7 : Number range status after posting the document.

System will issue this alert message as in Fig- 5 till you increase the number range or change the warning % .

See how simple and effective it is ….

Number Range Object


By Suresh Kumar Parvathaneni

Creation of a Number range object:

1. Go to transaction SNRO (Simple way to remember is SAP NumberRangeObject).


2. Enter the number range object name and press CREATE.

3. Enter the description, Long text and Number Length domain andWarning % as shown below:

Warning%  Assume that an interval is defined from 1 to 1000. If you want to issue a warning at the number 900, enter 10 (%)
here.

4. Press SAVE. You would get a prompt as shown below:


5. Press YES and assign the object to a local class.

6. Now click on “Number Ranges” button on the application toolbar.

7. Click on “Change Intervals”.


8. Click on “Insert Interval”.

9. Enter the values as shown below:

10. Click “Insert” and then SAVE. The number range object is generated.

Testing the Number Range Object:

We can use the function module, NUMBER_GET_NEXT, to get the next number of any number range object.

Following is a test program to get the next available number of the object created above:

REPORT zsnro_test.

DATA:
NUMBER TYPE I.

CALL FUNCTION 'NUMBER_GET_NEXT'


EXPORTING
nr_range_nr = '01'
object = 'ZDEMO'
IMPORTING
NUMBER = NUMBER
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
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Write :/ 'Next available number is: ', Number.