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

Help on number range!

Former Member
0 Likes
3,241

Hallo guys,

I have questions on number range.

the FM 'NUMBER_GET_NEXT' has an import parameter:NR_RANGE_NR

what it means.I checked the transaction 'SNRO',but still not clear about this.

Furthermore,is there any FM that can get the defined number range information:such as 'NR_RANGE_NR','from number', 'current number' etc.

Thanks!

Best Regards,

Liying

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,430

'NR_RANGE_NR' is the number range that must be maintained in tcode SNUM.

CHECK THIS .. FOR MORE DETAILS http://www.sap-img.com/ge003.htm

Hallo guys,

I have questions on number range.

the FM 'NUMBER_GET_NEXT' has an import parameter:NR_RANGE_NR

what it means.I checked the transaction 'SNRO',but still not clear about this.

Furthermore,is there any FM that can get the defined number range information:such as 'NR_RANGE_NR','from number', 'current number' etc.

Thanks!

Best Regards,

Liying

13 REPLIES 13
Read only

Former Member
0 Likes
2,430

Hi

Try: NUMBER_GET_INFO

Max

Read only

Former Member
0 Likes
2,430

Hi liying,

1. OBJECT -


> Number Range

One---> Many

2. This is the hierarcy

3. For each object, there can be multiple

number ragne.

4. IN SNRO,

click on edit,

a new screen will come,

click on 'Number Ranges'

then press 'Intervals'.

5. U will be able to see all intervals.

This interval needs to be / may need to be

hardcoded in the program

depending upon the scenario.

regards,

amit m.

Message was edited by: Amit Mittal

Read only

0 Likes
2,430

Hi,

thanks for your info.

To max bianchi,

actully I want to get parameter 'NR_RANGE_NR' as output.The FM you gave is the one requirs this parameter.So it is not the one I want:-(

To Amit Mittal ,

what did you mean ?Actually I want to know what is 'NR_RANGE_NR'(Number range number:what does this mean),what the value '01' or '02' mean?How can I get the value of this parameter via any FM,or if it possible?

Any ideas?

Thanks

B.R.

Liying

Read only

0 Likes
2,430

Thanks Vijay Babu Dudla and Ashok Kumar Prithiviraj ,

I think I get the point!

Read only

0 Likes
2,430

Hi

If you want to know NR_RANGE_NR you give us more informations.

That parameter depends on the process you're analyzing, so you have to know the object of number runge.

For example:

If you want to know the number range for FI document, you need read the master table of FI type document (field T003-NUMKR).

So there isn't a fm can have that parameter as output.

You can try to read directly NRIV table.

Max

Read only

0 Likes
2,430

Hi Max,

so that means the value for 'NR_RANGE_NR' can not be set freely,it depends on process.

If I set the value '01' to it instead of the correc one '02',what will happen?

I have little idea about this.

Actually I just want to assign a sequence field for my table,in order to let it be unique I use number range.

Thanks

B.R.

Liying

Read only

0 Likes
2,430

Hi

Not exactly!

See the key of NRIV table:

- OBJECT: it means the process where a certain number range has to be used. For example: RV_BELEG is for sales orders.

- SUBOBJECT: it means the other object to allow several ranges for the same process.

For exaple in FI: it can define several number ranges in order of company code.

OBJECT = RF_BELEG

SUBOBJECT = Company code

So you have to know these two data because they define the process where your range has to be used.

After you can freely define NR_RANGE_NR.

If you need to use an your own number range, you have to create an your object and, if it needs, subobject.

Max

Read only

0 Likes
2,430

Hi Wang,

'NR_RANGE_NR' is the key which determines what number range u want to pick up ur number from.

eg, goto transaction SNRO, enter RV_BELEG as object -->Number Range --> Intervals --> u ll see a screen with some ranges. The first column ( No. ) is the NR_RANGE_NR value that this function module takes as input. U also see From number, To number & Current number. These values are attributed to this particular no. So, the current number holds the latest no. in the number range and when u call this FM NUmber_get_next with the 'NR_RANGE_NR' value, it throws up the next number.

hope i explained u a bit abt the concept.

Regards,

Bikash

Read only

Former Member
0 Likes
2,430

Hi,

In FM documentation it is clearly Mentioned ...

please read the FM documentation..

Number range number

The number range number clearly identifies a number range interval for an object/sub-object. For types 1 and 4, the number range number is allocated manually via the maintenance dialog. For types 2, 3 and 5 to 8, the allocation is automatic: The number range number is assigned to the elements via the group table.


DATA: RC         LIKE INRI-RETURNCODE,
      NUMBER(10) TYPE C.

   CALL FUNCTION 'NUMBER_GET_NEXT'
        EXPORTING OBJECT          = 'HUGO'
                    NR_RANGE_NR     = '01'
        IMPORTING RETURNCODE      = RC
                    NUMBER          = NUMBER.

   CASE RC.
     WHEN ' '.
*      everything o.k.
     WHEN '1'.
*      the assigned number lies in the critical area.
     WHEN '2'.
*      this was the last number, next time the first number
*       will be assigned
   ENDCASE.

Regards

vijay

Read only

Former Member
0 Likes
2,431

'NR_RANGE_NR' is the number range that must be maintained in tcode SNUM.

CHECK THIS .. FOR MORE DETAILS http://www.sap-img.com/ge003.htm

Read only

Former Member
0 Likes
2,430

Hello Liying,

NR_RANGE_NR is used when u have multiple number ranges running for different intervals. For e.g

u have diferent customer account groups like sold to party, Bill to party etc. For each customer account group you can have a separate number range running. So 01 for sold to party 02 for bill to party etc... so when u are generating next number u will have to specify whichnumber range to use and thia is where this field is used.. so if you are creating next number for Sold to party u will pass 01 to this field in FM.

Abhijit

Read only

Former Member
0 Likes
2,430

If u want to use it for ur own number range what u can do is create an entry in SNRO with ur own object name and create Number range for 01. You can then pass this number to the FM.

Read only

0 Likes
2,430

Thanks guys!

I got the point!

B.R.

Liying