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

Generate ID Automatically

Former Member
0 Likes
2,269

Hi Gurus,

I have a question , That is While entering entries into employee table for the first time,

Is there  any possibility that we can have Employee ID generated automatically.

Suggestions Please.

ThanKx.......Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,594

Hi ,

Using table events we can achieve this thing  .

Steps : Go to table maintenance generator

            environment

            modification

            events

in form routine click f4 and select the appropriate form .

Regards

Siva

6 REPLIES 6
Read only

Private_Member_49934
Product and Topic Expert
Product and Topic Expert
0 Likes
1,594

Yes! why not create the number range object and use the function module NUMBER_GET_NEXT in your program to get the id.

This is how it is done in standard sap.

Read only

Former Member
0 Likes
1,595

Hi ,

Using table events we can achieve this thing  .

Steps : Go to table maintenance generator

            environment

            modification

            events

in form routine click f4 and select the appropriate form .

Regards

Siva

Read only

0 Likes
1,594

HI Guys,

the following procedure can be used in an application.

but forget every application,there is no any application.but instead only one independent table.

single table with no values...entering values for the first time.

I'm imagining like this--->  enter all other data into the table except employee ID....when we save the entries the EMPL ID should be generated and saved automatically.....

Read only

0 Likes
1,594

EVENT 05 + Number ranges or your own logic . Please search in SCN. This has been discussed before.

Read only

0 Likes
1,594

Hi Rohan ,

As mentioned by kesavadas , one way to achieve your requirement is to use a combination of Table maintenance event and number range object.

But please keep this point in  mind that this feature will work only when table maintenance is being used to create entry in the table , in case you want to update the table using a program then it has ti be handled in the program .

Regards

Arun

Read only

0 Likes
1,594

HI Rohan,

Check the table events once then select .the event number 5 in that write logic in that form like this

call function : number_get_next mbe

exporting

number_id = l_number.

employe id = l_number.