12-04-2007 7:52 AM
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?
12-04-2007 8:02 AM
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
12-04-2007 8:06 AM
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
01-30-2008 8:55 AM