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

automatic number generator for module pool programmes while saving

Former Member
0 Likes
2,249

Hi all,

While doing module pool Programming, After completion of data entered into screen fields, while saving it should generate automatic serial number in an ascending order.

Right now i am following this logic.

fetch the data from database and sort in descending order and increase one number and populate in to that particular field . Then i am showing sucessfull message that order has created with serial number has created.

<b>For this functionality any function module is available in sap. if available please let me know..</b>

Thanks in avance.

praveen

1 ACCEPTED SOLUTION
Read only

vinod_gunaware2
Active Contributor
0 Likes
1,342

use <b>GET_NEXT_NUMBERS</b>regards

vinod

7 REPLIES 7
Read only

vinod_gunaware2
Active Contributor
0 Likes
1,343

use <b>GET_NEXT_NUMBERS</b>regards

vinod

Read only

Former Member
0 Likes
1,342

Hi praveen,

Use the Function nodule GET_NEXT_NUMBERS

pass the first number , second and last number ...

Hope it would solve the purpose....

Read only

Former Member
0 Likes
1,342

Hi Praveen,

use the FM GET_JOB_NUMBER it Generate a new job number

without giving any number as input..

even when you quit and execute the program..

you'll get a unique number..

regards

satesh

Read only

0 Likes
1,342

thanks for the FM name,

but how do we reset the FM at certain point.

help is much appreciated.

thanks in advance.

Regards

Rahul.

Read only

Former Member
0 Likes
1,342

Hi,

use this FM <b>NUMBER_GET_NEXT</b>, create your own number range using SNRO transaction.

Regards

Vijay

Read only

Former Member
0 Likes
1,342

Hi praveen,

you can use the below procedure.

first create the an number range object using SNRO tcode

see the below example assuming ZGE057 as the number range object.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

NR_RANGE_NR = '01'

OBJECT = 'ZGE057'

  • QUANTITY = '1'

SUBOBJECT = '0001'

  • TOYEAR = '0000'

  • IGNORE_BUFFER = ' '

IMPORTING

NUMBER = P_LCL_TEXT_KEY

  • QUANTITY =

  • RETURNCODE =

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

Former Member
0 Likes
1,342

Hi praveen,

you can use the below procedure.

first create the an number range object using SNRO tcode

see the below example assuming ZGE057 as the number range object.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

NR_RANGE_NR = '01'

OBJECT = 'ZGE057'

  • QUANTITY = '1'

SUBOBJECT = '0001'

  • TOYEAR = '0000'

  • IGNORE_BUFFER = ' '

IMPORTING

NUMBER = P_LCL_TEXT_KEY

  • QUANTITY =

  • RETURNCODE =

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards

Anil Kumar K