2007 Dec 28 4:14 AM
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
2007 Dec 28 4:18 AM
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
2007 Dec 28 4:16 AM
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
2007 Dec 28 4:18 AM
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
2007 Dec 28 4:32 AM
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