2009 Mar 16 8:02 AM
Hi all,
I have a requirement like this. When I do a standard process I need to generate batches depending on the cuts in the cable. I'm doing this using Number Range. After I get the batches I may save the document or may not save it. Suppose my first document generated batches 100,101,103,104. At the end if I dont save and exit for the next document the batches are coming as 105,106 ans so on. However since I didnt save earlier I need from 100. How can I do this?
Thanks&Regards,
Manjula.S
2009 Mar 16 9:17 AM
I am afraid this may not be possible as the FM NUMBER_GET_NEXT gets called and it incements the number range...
So this will happen unless you build in a custom logic where u manually count and decmrent that no..
Hi all,
I have a requirement like this. When I do a standard process I need to generate batches depending on the cuts in the cable. I'm doing this using Number Range. After I get the batches I may save the document or may not save it. Suppose my first document generated batches 100,101,103,104. At the end if I dont save and exit for the next document the batches are coming as 105,106 ans so on. However since I didnt save earlier I need from 100. How can I do this?
Thanks&Regards,
Manjula.S
2009 Mar 16 9:17 AM
I am afraid this may not be possible as the FM NUMBER_GET_NEXT gets called and it incements the number range...
So this will happen unless you build in a custom logic where u manually count and decmrent that no..
2009 Mar 16 9:17 AM
Hi,
you can not recycle numbers from number range. Once you get it, it's wasted and there is no way how to return it back to number range. You can try to use similar technique which is used in SAP. You can assign temporary numbers to your batches such as $1, $2, $3 .... and during saving document you will replace these numbers by numbers from number range.
Cheers
2009 Mar 16 9:23 AM
Hi Anuradha and Martin,
I Thank you both for the replies. Is there any other function module which can do this functionality?
Thanks&Regards,
Manjula.S
2009 Mar 16 9:29 AM
Unfortunately i couldnt find any Fm to decrement a number range interval...You may need to study the NUMBER_GET_NEXT and develop a similar Z function module...
2009 Mar 16 9:49 AM
I don't think so. You have to understand that number ranges take care of concurrency. Hence you can have more application servers, more users running same program and SAP guarantees that you will get each number once. So generally implementing number range with possibility of returning number is really tricky thing and you have to be careful about concurrency. As I said, common approach how to avoid wasting numbers from number range is to use temporary numbers and during saving process replace these numbers by real numbers from number range.
Good luck
2009 Mar 16 10:33 AM
Hi,
As I discussed earlier is there any way by which I can avoid gaps in the number range? Any other alternative is possible for number ranges?
Thanks,
Manjula.S
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |