‎2009 Feb 04 5:49 AM
Hi,
I want remove all the duplicate rows from internal table comparing all the fields. my internal table has following fields.
internal table -> it_final
partner.
industry.
is_competitor.
is_prospect.
is_consumer.
is_customer.
customer_since.
is_rented.
nielsen_id.
classific.
account_group.
I want to remove duplicates only if all the above fields have same data in a row and not a single field contains duplicate data.
Pls help
Regards,
Santosh
‎2009 Feb 05 7:03 AM
Hi,
SORT IT_TAB BY partner industry is_competitor is_prospect is_consumer is_customer
customer_since is_rented nielsen_id classific account_group.
DELETE ADJACENT DUPLICATES FROM IT_ITAB COMPARING ALL FIELDS.
Regards,
Mon Magallanes
‎2009 Feb 04 5:51 AM
Hello,
First sort the internal table by the key fields and then delete the duplicates.
SORT IT_TAB BY PARTNER INDUSTRY and so on.
DELETE ADJACENT DUPLICATES FROM IT_ITAB COMPARING ALL FIELDS.Regards,
Shailaja
‎2009 Feb 04 5:52 AM
‎2009 Feb 04 5:52 AM
Hi santosh,
You can use following to remove all duplicates..
DELETE ADJACENT DUPLICATES FROM it_final COMPARING ALL FIELDS.
‎2009 Feb 04 5:52 AM
Hi,
Sort <internal table>.
DELETE ADJACENT DUPLICATES FROM internaL TALBLE NAME COMPARING ALL FIELDS
HOPE IT WILL HELP YOU
THANKS
ARUN KAYAL
Edited by: Arun Kayal on Feb 4, 2009 6:55 AM
‎2009 Feb 04 5:52 AM
I dont think you will get any such kind of scenarios where entire
record is same.
Anyhow use this for that purpose.
delete adjacent duplicates from itab comparing all fields.
‎2009 Feb 04 5:52 AM
Hi,
Try like this....
Sort <internal table>.
delete adjacent duplicates from <internaltable> comparing all fields.
Hope it will helps
‎2009 Feb 04 5:53 AM
Did U tried with
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS
‎2009 Feb 04 5:53 AM
Hi Santosh,
There are many similar thread for the same issue in SCN.
Please search.
READ HELP ON DELETE ADJACENT DUPLICATES FROM itab.
Regards,
Nitin.
‎2009 Feb 04 5:53 AM
Hi santhosh,
use
DELETE ADJACENT DUPLICATES FROM it_final COMPARING <field_name>
‎2009 Feb 04 5:55 AM
‎2009 Feb 04 5:56 AM
Hi,
Use:-
To delete comparing all fields.
sort itab by field1 field2 field3. "and so on for using all fields
delete adjacent duplicates from itab comparing all fields.
To delete comparing only one field
sort itab by field1.
delete adjacent duplicates from itab comparing field1.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
‎2009 Feb 04 6:12 AM
Hi,
Test the following Sample Code hope will solve out your problem,
TYPES: BEGIN OF t_test,
s_number TYPE i,
name1(10),
name2(10),
END OF t_test.
data: it_test TYPE STANDARD TABLE OF t_test WITH HEADER LINE.
it_test-s_number = 1.
it_test-name1 = 'AAA'.
it_test-name2 = 'AAA'.
append it_test to it_test.
it_test-s_number = 2.
it_test-name1 = 'AAA'.
it_test-name2 = 'AAA'.
append it_test to it_test.
it_test-s_number = 2.
it_test-name1 = 'AAA'.
it_test-name2 = 'AAA'.
append it_test to it_test.
it_test-s_number = 3.
it_test-name1 = 'AAA'.
it_test-name2 = 'BBB'.
append it_test to it_test.
it_test-s_number = 4.
it_test-name1 = 'AAA'.
it_test-name2 = 'BBB'.
append it_test to it_test.
it_test-s_number = 5.
it_test-name1 = 'AAA'.
it_test-name2 = 'BBB'.
append it_test to it_test.
SORT it_test by s_number name1 name2.
DELETE ADJACENT DUPLICATES FROM it_test COMPARING ALL FIELDS.\
Kind Regards,
Faisal
‎2009 Feb 05 6:54 AM
hi,
According to my understanding of ur requirement u want to delete duplicate rows in every field.
say records are:
A LMN XYZ
AA PQR XYZ
then these records shd be deleted as field3 has duplicate entries.
internal table -> it_final
partner.
industry.
is_competitor.
is_prospect.
is_consumer.
is_customer.
customer_since.
is_rented.
nielsen_id.
classific.
account_group.
can do the following:
data:
t_fieldname type string occurs 10 with header line.
t_fieldname = 'PARTNER'.
append t_fieldname.
likewise append all the fieldnames into t_fieldname industry is_competitor so on....
sort it_final by partner industry is_competitor is_prospect is_consumer is_customer customer_since
is_rented nielsen_id classific account_group.
loop at t_fieldname.
delete adjacent duplicates from it_final comparing t_fieldname.
endloop.
it checks each field and deletes the adj duplicate rec.
Regards,
Mdi.Deeba Najam.
‎2009 Feb 05 7:02 AM
Sort the internal table first based on the fields
and use delete adjascent command with the fields
‎2009 Feb 05 7:03 AM
Hi,
SORT IT_TAB BY partner industry is_competitor is_prospect is_consumer is_customer
customer_since is_rented nielsen_id classific account_group.
DELETE ADJACENT DUPLICATES FROM IT_ITAB COMPARING ALL FIELDS.
Regards,
Mon Magallanes
‎2009 Feb 05 8:38 AM
Hi Santosh,
If you got to remove absolutely duplicate entries from an internal table,
first sort the table and
DELETE ADJACENT FROM IT_TAB COMPARING ALL FIELDS.
But in case, you do not have to delete the entries, but to avoid duplication of display, then either give AT NEW FIELDNAME within the LOOP, or use ON CHANGE OF IT_TAB-FIELDNAME.
Thankyou,
Zahack
‎2009 Feb 05 7:17 AM
Hi,
You can achieve it by sorting the table with all the fields and delete adjacent duplicates .
SORT <table-name> by<field-name or mention all field names> .
DELETE adjacent duplicates FROM <table-name> comparing ALL fields.
Regards,
Rajani
‎2009 Feb 05 7:24 AM
Im blind, cant read and write properly and cant comprehend things that easily too. so im not sure if the question has been answered yet or not. so here is my answer:
I think what you need to do is SORT the internal table and then use the DELETE ADJACENT DUPLICATES statment on the internal table.
Im not really sure if this will solve your problem. You might want to wait for a few more replies to get a confirmation and then close the thread.
Please dont forget to do the needful too.
pk
‎2009 Feb 05 7:57 AM
My vote is also for deleting adjacent duplicates from the internal table comparing the fields which should be the same, and I also want to pay less taxes and those people living under the bridge near the railway station should be given a home and a warm blanket.
Next please...
‎2009 Feb 05 12:01 PM
In addition to the warm blanket, I want points baby, POINTS!!
‎2009 Feb 05 12:23 PM
>
> In addition to the warm blanket, I want points baby, POINTS!!
Do you want them urgently?
‎2009 Feb 05 1:09 PM
Hi Jerry,
If there are enough votes for "delete adjacent duplicates from i_tab comparing all fields", then I will take out a SAP Netweaver Subscription to become a Premium user, in which case I can award d o u b l e p o i n t s and will throw in a tin of bullybeef as well if you vote today still!
Don't fall for any short-term u r g e n t 2 -point promises!
Cheers,
Julius
‎2009 Feb 05 1:17 PM
Who is assigning these points remove the points and delete the question?:)
‎2009 Feb 05 1:51 PM
‎2009 Feb 05 1:55 PM
SORT forum BY garbage.
DELETE ADJACENT DUPLICATES FROM forum COMPARING garbage.
‎2009 Feb 05 2:01 PM
SORT garbage BY forum.
DELETE ADJACENT DUPLICATES FROM garbage COMPARING forum.
‎2009 Feb 05 2:02 PM
‎2009 Feb 05 2:09 PM
This thread looks like one to me. Why else would everyone be casting their votes?
Hang on! Could this be a Pointocracy run by Guestocrats?
‎2009 Feb 05 8:42 AM
Hi,
First sort the ITAB. Then delete adjacent duplicates
Sort itab.
delete adjacent duplicates from itab comparing all fields.
Regards,
Jyothi CH.
‎2009 Feb 05 11:57 AM
Good evening guys we must not ask basic questions and even if any one paste it we must not answer them.Remember this point even if you are having 0 points but following rules is more important.Just show Abap forums are the best.
If you feel that you made a mistake remove points and close your question.Remember the rules for them.
Hello santosh dont assign marks remove marks is what i am saying if you do it you will have value in the forum. I hope you are understanding the point.Remove the marks and ask for deletion of your question.
PS: people are making fun if you do it