cancel
Showing results for 
Search instead for 
Did you mean: 

Secuential field

jorgehuedo
Explorer
0 Kudos

Hi experts!

I'm making a new Z table and I need a secuential field in it. Do u know if is there any kind of element in SAP to define a field as auto secuential?

It would be somtething like this:

1

2

3

4

5

6

7

Or I have to calculate the value of the field when I want to insert a register?.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Jorge,

Create a number range and interval using transaction SNRO. Use function module NUMBER_GET_NEXT to get the next free number in sequence and use that number while the record is being created and saved.

Answers (5)

Answers (5)

jorgehuedo
Explorer
0 Kudos

Thanks for all I have solved the problem

Former Member
0 Kudos

Hi Jorge,

You can use the number ranges for the field for which you want to have a sequential number range. But remember you will have to ensure while inserting records in this table, you actually should use the function Module 'NUMBER_GET_NEXT'.

The transaction where you need to create a number range object is SNRO. Here you create a number range object refering to the dataelement and then you can define number range values as well. And while populating this table all that you need to do is call the number_get_next function module to get the next sequential number and pass it to the field.

If you are looking to do it automatically without using the SNRO and without coding it, then the answer is no.

Hope this helps.

Regards,

Srikanth

Former Member
0 Kudos

Hi Jorge,

You have to increment the field.There is no element which does that.

Former Member
0 Kudos

Hi,

Secuential is not possible in SAP.you can define number range and interval.

What is your purpose exactly by having this.

Lanka

jorgehuedo
Explorer
0 Kudos

Thanks for all Now i'll try it

Message was edited by: Jorge Huedo

Former Member
0 Kudos

Hi Horge,

I dont think there could be a table without a key(In SAP). You will surely have a key. What is your exact requirement?

Regards,

Srikanth

Former Member
0 Kudos

AFAIK this is not possible with SAP. You should work with number ranges instead.

Or calculating the ids by yourself of course.

Regards

Rene

Message was edited by: Rene Guenther