‎2010 Aug 16 7:58 AM
Hi
i am creating the module pool but when save button document number is Generated like that 1,2.............so on
but save the button only document number 1 saved after that new entry is posted then document number is 2.
but the documnet number 2 is not showing. this is showing only 1 number.
Number is not increase.....
Pls give me the solution.
‎2010 Aug 16 8:05 AM
Hi, Vinod
What the method you are using for increasing number? Please explain it bit more for better understanding.
Thanks and Regards,
Faisal
‎2010 Aug 16 8:14 AM
‎2010 Aug 16 8:06 AM
Hi,
What i understand what you have written is:
On pressing save button some document number should be generated starting from 1. But when you running program second time document number is not incresing.
If this is hapening then problem is each time you are running program the value of document number resets as it is new rn for the program. You need to save the document number in a table then increment the last entry on pressing of save button.
if what i understood is wrong then kindly tell me.
Regards,
Harsh.
‎2010 Aug 16 8:17 AM
yes as you said that i m stored the document number in a Data base table & i m using the function NUMBER_GET_NEXT.
‎2010 Aug 16 8:28 AM
Hi Vinod,
This may sound trivial, Have you tried, If it works when the function module NUMBER_GET_NEXT is executed in SE37.
Thanks
Sujay
‎2010 Aug 16 8:32 AM
Hi,
Did you maintain your object number range and how did you use FM???
‎2010 Aug 16 8:36 AM
Hi,
Kindly paste a code snippet of your program.
Regards,
Harsh.
‎2010 Aug 16 8:37 AM
How to create the Object number range but i have created the OBJECT through SNRO.
i am using the FM name NUMBER_GET_NEXT
‎2010 Aug 16 8:42 AM
Hi,
Follow Steps Bellow.
1. Run T-Code SNRO
2. Give the name of your Object
3. Above to your number range object name field, you can see the button with name Number ranges Click this
4. From here you will see three buttons
5. Check the button Internals
6. Now Click the button Add Interval (Shift + F1) to Add Intervals
Hope you will get idea, Please Reply if any Issue,
Thanks and Regards,
Faisal
‎2010 Aug 16 9:12 AM
Yes i have create the Object & Range define .
after that i call the FM name NUMBER_GET_NEXT but Problem is Same documnet number is not increasing.............
‎2010 Aug 16 9:42 AM
In your code, put a break-point after
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = <nr>
object = <object>
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.and check sy-subrc value.
If (and only if) sy-subrc = 0, check buffering, (first read [Note 639754 - When is a number finally assigned?|https://service.sap.com/sap/support/notes/639754]) you may need to perform a db-commit/commit work.
Regards,
Raymond
‎2010 Aug 16 8:08 AM
Hi,
You can maintain your number range of document in tcode SNRO.
regards,
‎2010 Aug 16 8:17 AM
Hi,
You can add the following code to increment the document number every time.
select max( document_no )
from <database_table>
into <field1>.
document_no= ( document_no+ 1 ).Thanks,
Sri.
‎2010 Aug 16 8:32 AM