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 partition

Former Member
0 Likes
1,128

Hi

I have a number range from 00001 to 99999 and i want to partition my nuber rangec into 3 parts.

To use number range in report program i can call function 'NUMBER_GET_NEXT' but how can i partion my number range so that:

00001-20000 is sales order

20001-40000 is purchase order

40001-50000 is receipt order.

Please note i dont have to create a seprate number range for the same.

Regards

Preeti Khurana

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,085

Preeti,

This is possible by using the multiple number range numbers in the transaction SNRO.

For Eg in the INTERVALS:

No. - FROM - TO

01 - 00001-20000 is sales order

02 - 20001-40000 is purchase order

03 - 40001-50000

While retrieving the number using NUMBER_GET_NEXT pass the above number (No. - 01 or 02 or 03) to the importing parameter NR_RANGE_NR to get the correct number range.

In the above case we have created single number range object but have multiple number ranges.

Regards,

Kiran Bobbala

Preeti,

This is possible by using the multiple number range numbers in the transaction SNRO.

For Eg in the INTERVALS:

No. - FROM - TO

01 - 00001-20000 is sales order

02 - 20001-40000 is purchase order

03 - 40001-50000

While retrieving the number using NUMBER_GET_NEXT pass the above number (No. - 01 or 02 or 03) to the importing parameter NR_RANGE_NR to get the correct number range.

In the above case we have created single number range object but have multiple number ranges.

Regards,

Kiran Bobbala

6 REPLIES 6
Read only

Former Member
0 Likes
1,085

Hello

1. Check table NRIV and choose interested you object

2. Call function NUMBER_GET_NEXT with parameter OBJECT = NRIV-OBJECT

Read only

Former Member
0 Likes
1,086

Preeti,

This is possible by using the multiple number range numbers in the transaction SNRO.

For Eg in the INTERVALS:

No. - FROM - TO

01 - 00001-20000 is sales order

02 - 20001-40000 is purchase order

03 - 40001-50000

While retrieving the number using NUMBER_GET_NEXT pass the above number (No. - 01 or 02 or 03) to the importing parameter NR_RANGE_NR to get the correct number range.

In the above case we have created single number range object but have multiple number ranges.

Regards,

Kiran Bobbala

Read only

0 Likes
1,085

Hi Kiran

Thanks alot for quick response.

Please see the steps i will need to do:

1:Will make an entry in trable NRIV for my object which is numc5 in my case.

Total there will be three entries as i want to divide my number range in 3 parts with different NRRANGENR.

What will be the entry in column NRLEVEL?

2:Please suggest how exactly it will be called from the fuction Number_get_next?

Regards

Preeti

Read only

0 Likes
1,085

I have not underrstood properly......follow the below steps to create multiple ranges for a single number range object:

1. Go to Transaction SNRO

2. Enter the Number rangeobject i.e., corresponding othe NRIV-OBJECT field

3. In menubar GOTO->Numberr RANGES

4. Select the CHANGE intervals button

5. In toolbar, select INSERT INTERVAL button

6. In the next screen, enter the Numbr, From and TO fields i.e., in your case it will be 01, 00001, 20000

7. Press INSErt at bottom

8. Follow the steps 5,6,7 for other ranges

9. Save it

For your information, NRLEVEL field hold the current number for Eg: current sales order number...this we need not to maintain, system will maintain.

When you do this entire process it creates an entry in NRIV table.

*******Assuming yu have already created the number range object and only intervals need to be added then follow theabove procedure else create number rangeobject using SNRO and follow the above process.

Pass the NRIV-OBJECT and NRIV-NRRANGENR to the import parameters OBJECT and NR_RANGE_NR to get the next number.

Regards,

Kiran Bobbal

Edited by: kiran Bobbala on Aug 21, 2008 1:31 PM

Read only

0 Likes
1,085

Thanks a lot..

Now i iunderstood the entire process.

Read only

Former Member
0 Likes
1,085

lv_count = range_high - range_low.

lv_count = lv_count + 1.

do lv_count times.

wa_gl-VONKT = wa_repcode-VONKT.

append wa_gl to lt_gl.

wa_repcode-VONKT = wa_repcode-VONKT + 1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = wa_repcode-VONKT

IMPORTING

OUTPUT = wa_repcode-VONKT.

enddo.

it will give u the gl by splitting it from the range and append into an internal table.

U can use 2 more internal table and add some condition and split the range.

eg:

*00001-20000 is sales order

*20001-40000 is purchase order

*40001-50000 is receipt order.

lv_count = wa_repcode-belnr_HIGH - wa_repcode-belnr_low.

lv_count = lv_count + 1.

do lv_count times.

if wa_gl-belnr le 2000.

wa_gl1-belnr = wa_repcode-belnr.

append wa_gl1 to lt_gl1.

else if wa_gl-belnr ge 2001

wa_gl-belnr = wa_repcode-belnr.

if wa_gl2-belnr ge 4001

append wa_gl3 to lt_gl3.

else.

append wa_gl2 to lt_gl3.

endif.

wa_repcode-belnr = wa_repcode-belnr + 1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = wa_repcode-belnr

IMPORTING

OUTPUT = wa_repcode-belnr.

enddo.

Am using the function module to get the order number in 10 digit. U can use the fc according to ur requirement..