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: 

How I can create unique key numeric field of the table

Former Member
0 Kudos

Dear ALL,

I need create the table with unique key numeric field.

Could you tell me How I can create this table (maybe I must use number range).

Then I need create the view for entry new record in this table.

Thanks a lot.

6 REPLIES 6

Former Member
0 Kudos

I hope u r talking about creating a key in a z* table

You can use the datatype NUMC and specify the length of the field. You can create it by clicking on 'Predefined Type' and directly enter NUMC and length of the field or Create a domain.. assign it to a data element.. and then assign the data element to the field you have created

Check this field as 'KEY' in the table

Former Member
0 Kudos

Igor,

Yes you will have to use the number range. But however, you will have to manually, get the next number and update the table while updatig the other rows.

You can create a number range in SNRO transaction.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

Hello Igor,

When u create any table with primary key, it will always create uniqe entries as duplicates are not allowd. However u can use number range to create numeric values for this field, as in case of purchase order or material.

former_member181962
Active Contributor
0 Kudos

Hi,

The FM, NUMBER_GET_NEXT may be useful to you.

Regards,

Ravi

Former Member
0 Kudos

I think that it is possible use number range automatically...

Former Member
0 Kudos

Hello Igor,

It will not come automatically, u will have to create a number range object and use this object to generate next number which will be populated into the field of the table which is key.

U can use get_next_number Fm to generate the next number.