Application Development 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: 

Number range

Former Member
0 Kudos

I have created a number range object Z*** .

i want to use this number range object to get new task ID . Can any one please guide me in this regard.

I have find a function module.

CALL FUNCTION 'NUMBER_GET_NEXT'

will it be sufficient?

3 REPLIES 3

Former Member
0 Kudos

Hi,

Define the interval ranges and then,create a table with the primary key as the field with same domain or data element, and before saving use this function module to get the current number and insert it in the table.

regards,

Santosh Thorat

Former Member
0 Kudos

Hi

Create the Number Range Object using SNRO tcode

and define/maintain the number ranges for that object using SNUM tcode

and then use the fun module NUMBER_GET_NEXT in the code to get the next continuous numbers for that field

see the sample code

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = '01'

object = 'ZDOCNUM'

  • QUANTITY = '1'

  • SUBOBJECT = ' '

  • TOYEAR = '0000'

  • IGNORE_BUFFER = ' '

IMPORTING

number = v_docno

  • QUANTITY =

  • RETURNCODE =

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.

Regards

Anji

Former Member
0 Kudos

Thanks every one