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

generate a number

Former Member
0 Likes
1,273

Hi Gurus,

I want to auto generate a number for my custom screen like PO number or SO number in standard.

Is there any function module for this.

thanks,

nikki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,197

Hi Nikki,

Create a custom number range from transaction SNRO. Define the interval you want e.g. 000000 to 999999 and then in your program use the function module NUMBER_GET_NEXT to get the next running number from this created number range.

Hope this helps.

Regards,

Aditya

Hi Gurus,

I want to auto generate a number for my custom screen like PO number or SO number in standard.

Is there any function module for this.

thanks,

nikki

3 REPLIES 3
Read only

Former Member
0 Likes
1,197

Hi nikki,

To generate a number wt u can do is declare a variable and increment it whenever a new PO or SO is to be created i guess for this no need of any function module.

Regards,

Ravi G

Read only

Former Member
0 Likes
1,198

Hi Nikki,

Create a custom number range from transaction SNRO. Define the interval you want e.g. 000000 to 999999 and then in your program use the function module NUMBER_GET_NEXT to get the next running number from this created number range.

Hope this helps.

Regards,

Aditya

Read only

Former Member
0 Likes
1,197

Hi nikki,

But why do u need a Funcion Module for this if it is in standard for PO or SO , It will trigger from SNRO .

Explicitly if u need to use in ur program u need to use this Function module .

See for this u need to use Function Module:- 'NUMBER_GET_NEXT' .

Before that u need to maintain object and sub object for the numebr generation which is normally done by the functional consultants .

They do this configuration in Tcode SNRO .

Collect the parameters for this FM from the object .

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

NR_RANGE_NR = '01'

OBJECT = 'XXXXXX''

QUANTITY = 'X'

SUBOBJECT = 'XXXX-FIELD'

TOYEAR = '0000'

IGNORE_BUFFER = ' '

IMPORTING

NUMBER = INTERNAL TABLE

Internal table will hold the number of the sequence.

For ur case when the configuration is done in SNRO that will inturn pick the number in sequence So no need of Function Module.

Reward if Useful

Thanks,

swaroop