2013 Nov 22 4:29 PM
Hi All,
In my report I am displaying two fields ZSEQNO(Sequential number) and BELNR from table ZDOCNUM. I am fetching ZSEQNO and BELNR from table ZDOCNUM. When I execute the report for company code 2500, I am having the below output:
Sequential No. Document No.
00011100001 78454445
00011100002 78454687
When I execute the report for the second time for the same company code my output should be as below:
Sequential No. Document No.
00011100003 78454445
00011100004 78454687
For next run the sequential number should start from 00011100005 and so on. How to achieve this functionality? Please help.
Thanks,
Venkata
Hi All,
In my report I am displaying two fields ZSEQNO(Sequential number) and BELNR from table ZDOCNUM. I am fetching ZSEQNO and BELNR from table ZDOCNUM. When I execute the report for company code 2500, I am having the below output:
Sequential No. Document No.
00011100001 78454445
00011100002 78454687
When I execute the report for the second time for the same company code my output should be as below:
Sequential No. Document No.
00011100003 78454445
00011100004 78454687
For next run the sequential number should start from 00011100005 and so on. How to achieve this functionality? Please help.
Thanks,
Venkata
2013 Nov 22 4:48 PM
Hi Venkat,
You Can Achieve this Using Number range objects.
Go to T-code SNRO . HERE you can create number objects according requirement. call that same number range object in your loop . and modify your internal you will get different sequence numbers .
when ever you run the report.
for You reference this is code .define number range object in SNRO AND use that in you Loop.
Loop AT.
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = '01'
object = 'ZSEQ' "Number Range Object Defined in SNRO
quantity = '1'
* SUBOBJECT = ' '
* TOYEAR = '0000'
ignore_buffer = 'X'
importing
number = l_number
* QUANTITY =
returncode = ld_error " Number generated Sequentially
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.
* Implement suitable error handling here
endif.
********pass every time number generated by that L_NUMBER TO ZSEQUENCE AND MODIFY you internel table .*******
endloop.
Regards,
Hiriyappa.
2013 Nov 22 5:32 PM
Hello
This can be done by using the no. range object, you need to create a no. range object using t code SNRO and provide a starting range of 00011100001(numc11) and interval 99999999999(Numc11)..
Here is one document which can help you for better understanding..
2013 Nov 25 2:10 PM
Hi Chandra Sekhar,
I tried to create number range as in the document. When creating a number range for field ZBELNR(data element ZBELNR) having domain CHAR20 and after clicking on save it is showing me the message as "Domain CHAR20 of data element ZBELNR does not have a value table" . Can we create number range for custom fields and custom domains. Please help me.
Thanks,
Venkata
2013 Nov 25 3:00 PM
2013 Nov 22 5:49 PM
Hi-
Another approach would be adding an additional field (or even fields) in your 'ZDOCNUM' TABLE which indicates whether those documents have considered previously.
Field can be like : ZPROGRAM_RUN type C, set this field value to 'X' every time you run your report. If you want more specific details then you can think of adding date and time fields too.
-Venkat
2013 Nov 25 6:02 AM
Hi venkata,
You can use the concept called Number range in your program,this number range will create numbers automatically when ever you call NUMBER_GET_NEXT by passing the number range object along with it.
Check the following link , this will give u a definite solution to you.
How to Create you own Number Range SNRO - ABAP Development - SCN Wiki
Regards,
Sivaganesh
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |