Application Development 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: 

Creating a function module to auto generate an unique form id

Former Member
0 Kudos

hi, i'm currently working on a form submission process. I'm facing trouble creating a function module to create an auto generate unique form id.

i know something about the number range object to generate the next number. But i need to include the year with the generated id like YYYY_XXXX (X - to be the number generated).

Anyway in achieving it? Could anyone provide the steps?

Thanks alot in advance!!!

8 REPLIES 8

mvoros
Active Contributor
0 Kudos

Hi,

you can define your own number range which will be distinguished according to fiscal year. Then you can simply define a number interval for each fiscal year as from number 2010000001 to number 201099999 and so on. So you will call standard function NUMBER_GET_NEXT and you will pass current year using parameter TOYEAR to get next number. Have a look at [SAP documentation|http://help.sap.com/saphelp_erp2005/helpdata/EN/2a/fa02e3493111d182b70000e829fbfe/frameset.htm].

Cheers

former_member1245113
Active Contributor
0 Kudos

Hi,

Use NUMBER_GET_NEX FM to generate a number and find the Year you want either from system date or Fiscal Year( which ever is required by you and then Concatenate them together with an Underscore in between)

Cheerz

Ram

Former Member
0 Kudos

Hi

Goto SNRO T code and create one number range object.

use this FM NUMBER_GET_NEXT to get tht number in your program.

Take the sy-datum field write an offset to get year into one field.

now concatenate the year and number which u get from the above FM and dsiplay

Regards

Azeez

Former Member
0 Kudos

hi,

thanks for the help...but as i'm very new to abap programing...is there any step-by-step guide that i can refer to?

thanks & Regards,

leesyy_90

Former Member
0 Kudos

hi,

thanks for the help...but as i'm very new to abap programing...is there any step-by-step guide that i can refer to?

thanks & Regards,

leesyy_90

Former Member
0 Kudos

hi,

thanks for the help...but as i'm very new to abap programing...is there any step-by-step guide that i can refer to?

thanks & Regards,

leesyy_90

Former Member
0 Kudos

hi,

thanks for the help...but as i'm very new to abap programing...is there any step-by-step guide that i can refer to?

thanks & Regards,

leesyy_90

0 Kudos

Hi,

check following link to understand how does generating numbers from number intervals work:

[ How the Number Range Buffer Works|http://help.sap.com/saphelp_nw04/helpdata/en/95/3d5540b8cdcd01e10000000a155106/content.htm]

and also check: [Maintaining Number Ranges|http://help.sap.com/erp2005_ehp_04/helpdata/EN/1f/8311204bc511d189750000e8322d00/content.htm]

You can find useful step-by-step guide here: [How to Create you own Number Range ? (SNRO) |http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=50004015]

And as You are a very new to ABAP, search also [BC - ABAP Programming|http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCABA/BCABA.pdf] for CONCATENATE statement. But You will find much more here.

Regards,

Adrian