‎2008 Mar 31 10:32 AM
how can you find duplicate entries in a column of table control?
‎2008 Mar 31 10:36 AM
HI
You need to sort your itab before passing data to table control.
If you are entering data in your table control then
at flow-logic of screen
PAI
Loop at itab.
module check-duplicate-entry.
endloop.
module check-duplicate-entry.
read table itab with key (compare all keys with itab-key fields)
if sy-subrc = 0.
duplicate entry found.
endif.
Regards
Aditya
‎2008 Mar 31 10:36 AM
HI
You need to sort your itab before passing data to table control.
If you are entering data in your table control then
at flow-logic of screen
PAI
Loop at itab.
module check-duplicate-entry.
endloop.
module check-duplicate-entry.
read table itab with key (compare all keys with itab-key fields)
if sy-subrc = 0.
duplicate entry found.
endif.
Regards
Aditya
‎2008 Mar 31 12:05 PM
Hi,
Before the Table control is assigned Data, use a similar ligic as follows :
TYPES:
BEGIN OF strtab,
carrid TYPE s_carr_id, "------ column whose duplicate entry needs to be found
END OF strtab.
DATA it_tab TYPE TABLE OF strtab.
SELECT carrid FROM spfli "------ your table
INTO CORRESPONDING FIELDS OF TABLE it_tab
GROUP BY carrid HAVING COUNT( * ) > 1.
it_tab will have the values in the column that has duplicate entries.
Cheers,
Remi