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: 

Function to generate unique number which can be inserted into the table..

Former Member
0 Kudos

Hi all...

Suppose i am creating Z-table of and suppose emp_number is primery key.... If i want to create employee no which is not there in table....is there any inbuilt function to generate unique no to insert into the table as primery key?

..Thanks..

..Ashish

4 REPLIES 4

Former Member
0 Kudos

Define a number range and use that to supply unique numbers.

Have a look at transaction SNR0

Former Member
0 Kudos

Hi,

The Following Link shows how to create Number range:

http://www.saptechnical.com/Tutorials/ABAP/SNRO/SNRO.htm

Thanks,

Sree.

Edited by: t sree on Oct 4, 2008 3:32 PM

Former Member
0 Kudos

Hi,

On one way you can create unique number by selecting the maximum employee number before creation of a record and then increment one to assign to the new record.

The other way you can create a number range in tcode SNRO and use FM NUMBER_GET_NEXT to get the next number from the number range.

Search SDN with NUMBER_GET_NEXT, you will get example codes.

Regards

Karthik D

Former Member
0 Kudos

Thanks