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

*Get_Next_Number* function

Former Member
0 Likes
1,041

Currently, I am putting the Get_Next_Number function in a loop.

-


LOOP AT DYN_CODE_TABLE INTO wa_lv.

*Store ID

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = '01'

object = 'ZHERA'

quantity = '1'

IMPORTING

number = l_number.

ENDLOOP.

-


Is it possible for me to set the starting number back to 0 when the loop ends and comes back to the loop again upon execution again?

2 REPLIES 2
Read only

Former Member
0 Likes
668

Juzme,

This function module assigns the next free numbers of a number range. A number is assigned as a default if no larger number is demanded in the parameter QUANTITY. If more than one number is demanded and not enough numbers are available up to the interval limit, the numbers are only assigned up to the interval limit. If the last number was assigned, the first interval number is provided again during the next call.

If you are restting the number range and set the starting number back to 0 when the loop ends and comes back to the loop again upon execution again, the purpose of using this function module will be defeated.

Looks like your scenario does not need a call to this Function module.

Explain exactly your scenario, we'll try to help you.

Hope this helps

Vinodh Balakrishnan

Read only

former_member194669
Active Contributor
0 Likes
668

Restting the number range only possbile thru tranx SNRO.

I have a question if you need to reset the number after loop then

l_number = 1

LOOP AT DYN_CODE_TABLE INTO wa_lv.

l_number = l_number + 1

ENDLOOP.

clear l_number..

is enough, then why you need number range?

a®