2008 Apr 21 5:31 AM
Hi Gurus,
I Am a Bw guy and i have created a table in R/3 ,my problem is i want to create unique record number to each record automaticlly ..like serial no to identify each record uniquely ..how can i do that? it should be generated automatically for a new record.?
Regards,
Rk
Hi Gurus,
I Am a Bw guy and i have created a table in R/3 ,my problem is i want to create unique record number to each record automaticlly ..like serial no to identify each record uniquely ..how can i do that? it should be generated automatically for a new record.?
Regards,
Rk
2008 Apr 21 6:07 AM
make the document number field as primary key field in the database table ,,and then start inserting the data..
2008 Apr 21 6:12 AM
Hi
Assing the field with the primary key, which you want to make as unique and inorder to avoid duplicate numbers.
If you make it like this foe example doc number = 1000.
If an entry already made for 1000, and if you r trying to add another document with same number the system will not allow the duplicate entries.
Thanks and Regards
Arun joseph
2008 Apr 21 6:52 AM
Hi ,
Thanks for your reply,i know that primary key concept,,here i have created a own table in R/3 and i can enter the values for the fields in the table like empid,manid,timein,timeout date ,,,as these are the fields in my table if i want to find a record uniquly i should keep empid,timein and date as the primary key ..then only there can be multiple entry for an employee id,,,,so i want some doc no like kind of keys to be automatically generated for each record without manual entry for each record..how can i do that?
2008 Apr 21 8:16 AM
Hi Karthik,
Try this way to get the next empid automatically.
I hope that it helps u .
Regards,
Venkat.O
DATA:l_pernr TYPE pernr-pernr.
SELECT MAX( pernr )
FROM pa0003
into l_pernr.
IF sy-subrc = 0.
empid = l_pernr + 1. "Here u have to assign to screen field in the PBO if it is module pool program.
WRITE / l_pernr.
ENDIF.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |