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

Avoiding duplicate entry in an internal table

Former Member
0 Likes
586

Hi friends,

I want to avoid duplicate validation for a particula key in an internal table .I am updating the table in PAI module . I am using a method to update the table so when it is getting updated I cannot valiadte the data , after updating only I have to validate if there is any duplicate entry or not , iF duplicate then I have to show an errror msg . when I am using the method check_changed_data from cl_gui_alv_grid , Is there any chance to validate the date and them change into internal table ?

Thanks in advance .

4 REPLIES 4
Read only

Subhankar
Active Contributor
0 Likes
542

Hi...

1 . Sort the internal table with the field for which U want to catch the duplicate entry..

2. Use AT NEW statement. With in the AT NEW statement use your normal functionality.

3. After ENDAT means duplicate entry appear ... U can track it as a ERROR record.

Read only

Former Member
0 Likes
542

Hi..

use the code of method in a sub-routine or put it in FM

it will be easier way out..

regards

vivek

Read only

Former Member
0 Likes
542

Hi..

First sort ur internal table.

Then put loop on this..

use on change of....statment..

ie

sort itab.

loop at itab.

on change of itab-kunnr.

....

....

....

....

endon.

endloop.

Rgds,

Read only

Former Member
0 Likes
542

thanks