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 ranges

Former Member
0 Likes
641

Hi Experts,

What is the use of FM 'Number_get_next'.

my program gets short dump bez of timout when

running below FM

call function 'NUMBER_GET_NEXT'

exporting

nr_range_nr = '01'

object = 'ZIBWEXTRCT'

importing

number = zwarrext.

pls advice

Hi Experts,

What is the use of FM 'Number_get_next'.

my program gets short dump bez of timout when

running below FM

call function 'NUMBER_GET_NEXT'

exporting

nr_range_nr = '01'

object = 'ZIBWEXTRCT'

importing

number = zwarrext.

pls advice

4 REPLIES 4
Read only

Former Member
0 Likes
604

Hello Karthik,

The use of the FM 'NUMBER_GET_NEXT' is to get the next number for the particular object.

For ex: there is an employee with number 1000. So from the number get next we will get as 1001.

This is the case for sales order .

Any information required plz let me know

Kiran I

Read only

Former Member
0 Likes
604

Hi,

Use of FM NUMBER_GET_NEXT is to get the next unique number in a number range. Use tcode SNRO for maintaining number ranges.

For example document no. should be in range of 1000 to 9999.

The present number is 1234 the next number should be 1235. If you use this FM you will get the next unique number.

Thanks,

Sriram POnna.

Read only

Former Member
0 Likes
604

Can you provide more details displayed in the dump?

Also you can check if there is any next number available in the object you have specified. Maybe the entire range has been utilized.

Read only

Former Member
0 Likes
604

hi

good

for finding next document number available in a specific range (for FI

documents) we use function module NUMBER_GET_NEXT, and pass the number

returned from it to specific fm for creating FI document.

check this code and use accordingly.

NUMBER_GET_NEXT Get the next unique number in a number range. Use tcode SNRO for maintaining number ranges.

call function 'NUMBER_RANGE_ENQUEUE'

exporting

object = 'ZOWNNO' "Create with SNUM

exceptions

foreign_lock = 1

object_not_found = 2

system_failure = 3

others = 4.

if sy-subrc ne 0.

message e086 with 'Lock error' sy-subrc.

endif.

call function 'NUMBER_GET_NEXT'

exporting

nr_range_nr = wnorange

object = 'ZOWNNO'

subobject = wsubobj

importing

number = wdocno "Number generated by SAP

exceptions

interval_not_found = 1

number_range_not_intern = 2

object_not_found = 3

quantity_is_0 = 4

quantity_is_not_1 = 5

internal_overflow = 6

others = 7.

if sy-subrc ne 0.

message e086 with 'Number Range' sy-subrc.

endif.

call function 'NUMBER_RANGE_DEQUEUE'

exporting

object = 'ZOWNNO'.

if sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

thanks

mrutyun^