Application Development and Automation 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: 
Read only

auto generate numeric value for a column

Former Member
0 Likes
724

Hi abapers,

I have a column called recording number which is of numeric type.

I want to auto generate values for this column of my table.

How can this be achieved.

Regards,

Aditya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
617

Hi,

Use the FM : NUMBER_GET_NEXT and You can select the relevant object from the table TNRO that has the numeric type(NUMC) with the relevant number of characters(size).

For eg: to get 8 digit number use the object : DARLSICH (make sure that what ever object u use should have a transction code assigned to it in TNRO table)..

Regards

SHiva

2 REPLIES 2
Read only

Former Member
0 Likes
617

Hi,

This is completely depends on the requirement.

Lets say, if you are updating new records through some custom program by building an internal table, then take some initial value to the record number.

Now in the loop increment the record number by one, as long as you append the records, it will be new.

Or else if you need functionality similar to the document number generation in SAP, then go for the function module NUMBER_GET_NEXT functionality. But I don't think you need this...........

Regards,

Santhosh

Read only

Former Member
0 Likes
618

Hi,

Use the FM : NUMBER_GET_NEXT and You can select the relevant object from the table TNRO that has the numeric type(NUMC) with the relevant number of characters(size).

For eg: to get 8 digit number use the object : DARLSICH (make sure that what ever object u use should have a transction code assigned to it in TNRO table)..

Regards

SHiva