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

Module Pools when save Button

Former Member
0 Likes
1,341

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.

14 REPLIES 14
Read only

faisalatsap
Active Contributor
0 Likes
1,308

Hi, Vinod

What the method you are using for increasing number? Please explain it bit more for better understanding.

Thanks and Regards,

Faisal

Read only

0 Likes
1,308

i m using the call function NUMBER_GET_NEXT

Read only

Former Member
0 Likes
1,308

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.

Read only

0 Likes
1,308

yes as you said that i m stored the document number in a Data base table & i m using the function NUMBER_GET_NEXT.

Read only

0 Likes
1,308

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

Read only

0 Likes
1,308

Hi,

Did you maintain your object number range and how did you use FM???

Read only

0 Likes
1,308

Hi,

Kindly paste a code snippet of your program.

Regards,

Harsh.

Read only

0 Likes
1,308

How to create the Object number range but i have created the OBJECT through SNRO.

i am using the FM name NUMBER_GET_NEXT

Read only

0 Likes
1,308

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

Read only

0 Likes
1,308

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.............

Read only

0 Likes
1,308

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

Read only

Former Member
0 Likes
1,308

Hi,

You can maintain your number range of document in tcode SNRO.

regards,

Read only

sridhar_meesala
Active Contributor
0 Likes
1,308

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.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,308

Which return code did you get from NUMBER_GET_NEXT ?

Regards,

Raymond