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

validate key field in custom table

vallamuthu_madheswaran2
Active Contributor
0 Likes
808

Hi Friends,

I having a two columns(ID and Description) in a table.

ID is a field.

My requirement is that if we enter a text in the description then ID should populate with auto generated number. I have written the code in PAI if sy-comm ='SAVE'. Before saving, If i press enter then I am getting the "An entry already exists with the same key".

system takes, first column of key filed is taking as blank. second column of key filed is taking as blank and consider both the KEY field values are same display the message. How to rectify it.

Thanks with Regards,

Vallamuthu M.

.

Hi Friends,

I having a two columns(ID and Description) in a table.

ID is a field.

My requirement is that if we enter a text in the description then ID should populate with auto generated number. I have written the code in PAI if sy-comm ='SAVE'. Before saving, If i press enter then I am getting the "An entry already exists with the same key".

system takes, first column of key filed is taking as blank. second column of key filed is taking as blank and consider both the KEY field values are same display the message. How to rectify it.

Thanks with Regards,

Vallamuthu M.

.

2 REPLIES 2
Read only

Juwin
Active Contributor
0 Likes
682

--- ID should populate with auto generated number ----


Where is this logic coded?


Thanks,

Juwin

Read only

Sandra_Rossi
Active Contributor
0 Likes
682

Please give more information about the context. But I see message SV000 in your screen capture, so it's probably about a table maintenance dialog (TMD)! Did you directly modify the PAI? That's a bad practice. You should first use the TMD events (user exits). Event 21 can be used to fill values before the unicity check is done.