‎2009 Feb 27 4:29 PM
Dear experts,
Can any one help me to write the code while generating number range in VF01 Sales office wise . Program is RV60AFZZ and I am using the Exit - USEREXIT_NUMBER_RANGE.
‎2009 Feb 27 4:31 PM
Check this:
DATA:
NUMBER TYPE I.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = 'ZDEMO' "created from Tr. SNRO
IMPORTING
NUMBER = NUMBER
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.
Write :/ 'Next available number is: ', Number.
‎2009 Feb 27 4:45 PM
Dear friend,
In this exit we only pass the internal number range number that is of 2 Charecters only I think.
‎2009 Feb 27 4:53 PM
we maintaine all the number range in a Ztable and pass it...
you got to find out which table, or what to use....
SELECT SINGLE * FROM <Ztable> WHERE BUKRS EQ VBRK-BUKRS.
IF SY-SUBRC EQ 0.
US_RANGE_INTERN = <Ztable>-NRNR.
ENDIF.