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

Doubt in document no Generation

Former Member
0 Likes
377

hi Guys,

Right now i am working in Dialog Programming.Material is transfered from PointA to PointB and at PointB they are scanning the material using the barcode scanner.

Once they scanned all the material and save i should create a Document No ( between a range of 40000-49999).

I need clarrifiacation on how to generate the document number ??*

is there any function module to read last document no ??

Regards,

Karthik.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
349

Hi,

data  : gexno(10).
call function 'NUMBER_GET_NEXT'
                exporting
                  nr_range_nr             = '01'
                  object                  = 'ZGPNO'
                importing
                  number                  = gexno
                exceptions
                  interval_not_found      = 1
                  number_range_not_intern = 2
                  objec
                  t_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.

tcode for creating Number range oblect : SNRO

CREATE OBLECT EX : ZGPNO

Create Number ranges as u wish like

ex.

01 - 400000 - 499999

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 11, 2008 5:45 PM

1 REPLY 1
Read only

Former Member
0 Likes
350

Hi,

data  : gexno(10).
call function 'NUMBER_GET_NEXT'
                exporting
                  nr_range_nr             = '01'
                  object                  = 'ZGPNO'
                importing
                  number                  = gexno
                exceptions
                  interval_not_found      = 1
                  number_range_not_intern = 2
                  objec
                  t_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.

tcode for creating Number range oblect : SNRO

CREATE OBLECT EX : ZGPNO

Create Number ranges as u wish like

ex.

01 - 400000 - 499999

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 11, 2008 5:45 PM