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 range problem in VF01

Former Member
0 Likes
486

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.

3 REPLIES 3
Read only

former_member156446
Active Contributor
0 Likes
429

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.

Read only

0 Likes
429

Dear friend,

In this exit we only pass the internal number range number that is of 2 Charecters only I think.

Read only

0 Likes
429

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.