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

How a document number is Generated.

Former Member
0 Likes
14,233

Hi,

When I park a document using FV60, how the document number is generated?

I want to know the program name and function(subroutine) which will generate this number.

If any one knows please let me know.

It will be very helpful.

Thank you in advance,

With Regards,

Vimal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,852

SAP uses number ranges. So you need to find out the number range object and interval (transaction SNRO).

With function NUMBER_GET_NEXT a new number is taken from the number range object and interval.

3 REPLIES 3
Read only

Former Member
0 Likes
2,853

SAP uses number ranges. So you need to find out the number range object and interval (transaction SNRO).

With function NUMBER_GET_NEXT a new number is taken from the number range object and interval.

Read only

0 Likes
2,852

You will find the call in function PRELIMINARY_POSTING_FB01 which in turn calls RF_GET_DOCUMENT_NUMBER. The number range object is RF_BELEG. Normally, I would tell posters to use SE30 to find it but SE30 doesn't do a very good job of capturing the FV60 transaction completely.

Read only

Former Member
0 Likes
2,852

Hi Vimal,

Try below logic!!!!!!

Create your number range through transaction (SNRO / SNUM). Over there in the domain level pass the variable (say vbeln) and give your interval.

Now in your report where you want to generate a new document number, use the FM NUMBER_GET_NEXT .



DATA: l_no  TYPE inri-nrrangenr,
            l_obj TYPE inri-object    VALUE 'ZSDIDA'.

   CALL FUNCTION 'NUMBER_GET_NEXT'
     EXPORTING
       nr_range_nr             = l_no
       object                  = l_obj
     IMPORTING
       number                  = g_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.

Over here l_no is the range sl no. & l_obj is the name of range which is created through transaction SNRO/SNUM.

Hope this will help you to resolve the issue & close the thread.

BR,

Vinit