‎2006 Jul 29 12:05 PM
Hi All,
My internal table has 10 fields.First field with material number,second field idoctype ,third field date processed.fourthfield idoc status,fifthfield idoc number.......Table is sorted in descending.
There can be a multiple entries for a same material number on different dates.I need only the fisrt record of each message type for each material.How it would be possible.
75008845 matmas 22/7/06 53 14532
75008845 matmas 22/7/06 51 14321
75008845 cremas 23/7/06 53 24532
75008845 cremas 22/7/06 51 13452
75008845 zbom 23/7/06 53 12343
75008845 zbom 23/7/06 51 12353
75004321 matmas 23/7/06 53 13432
75004321 cremas 21/7/06 51 12343
75004321 zbom 21/7/06 52 14321
My int.table looks like above,so i need very first record of each material for each message type.frame the logic.
could anybody help?if anyone need more info.Please revert back.
Thanks,
Ponraj.s.
ponraj_rec@yahoo.com
‎2006 Jul 29 12:15 PM
Hi
Use this code
Delete adjacent duplicate entries from itab comparing <field1> <field2>.
In your case field1 is material number and field2 is message type and itab is internal table name.
you can also refer to links
http://help.sap.com/saphelp_nw04/helpdata/en/06/aafd54fc4011d195280000e8353423/content.htm
http://www.sap-img.com/abap/attach-a-search-help-to-the-screen-field.htm
http://sap.ionelburlacu.ro/abap/ABAPperformance.html
http://www.geekinterview.com/question_details/1495
Please reward points for helpful answers.
Reagrds,
Amit.
‎2006 Jul 29 12:15 PM
Hi
Use this code
Delete adjacent duplicate entries from itab comparing <field1> <field2>.
In your case field1 is material number and field2 is message type and itab is internal table name.
you can also refer to links
http://help.sap.com/saphelp_nw04/helpdata/en/06/aafd54fc4011d195280000e8353423/content.htm
http://www.sap-img.com/abap/attach-a-search-help-to-the-screen-field.htm
http://sap.ionelburlacu.ro/abap/ABAPperformance.html
http://www.geekinterview.com/question_details/1495
Please reward points for helpful answers.
Reagrds,
Amit.
‎2006 Jul 29 12:15 PM
‎2006 Jul 29 1:31 PM
Hey,
Use the logic below:
SORT itab BY matnr ASCENDING mstyp ASCENDING date ASCENDING idocno DESCENDING.
DELETE ADJACENT DUPLICATE FROM itab COMPARING matnr msgtyp.
-KIRAN
*Please mark useful answers