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

restrict duplicate entry

naveenvishal
Contributor
0 Likes
532

how to restrict duplicate entries to be entered in a table control...

thanx,

naveen vishal

3 REPLIES 3
Read only

naveen1241
Participant
0 Likes
455

hi..

after ur PAI table control loop, write another module.

in tht u can declare one temporary int table and copy the original int table to the temp table.

then sort this new internal table and delete adjacent duplicates comparing your key fields.

if sy-subrc = 0.

give some error msg.

else.

do nothing..

endif.

hope this helps...

regards,

naveen

Read only

uwe_schieferstein
Active Contributor
0 Likes
455

Hello Naveen

You have to evaluate at PAI (i.e. after having entered possible duplicated entries) whether your itab contains duplicates or not.

You see the same behaviour with maintenance views. You can always enter duplicated entries but if you push ENTER or the SAVE button the system throws an error due to the duplicated entries.

Regards

Uwe

Read only

naveenvishal
Contributor
0 Likes
455

well, the solution to it is like this:

a pointer needs to move from 1st row of table control till the current row, for each table control read.

that is, reading the rows only above it, not below ones. That will throw error at appropriate place.

Thanx for msg postings..

Naveen Vishal