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

Internal tables.

Former Member
0 Likes
495

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
460

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.

3 REPLIES 3
Read only

Former Member
0 Likes
461

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.

Read only

Former Member
0 Likes
460

Hi

Please use:

Delete Adjacent Duplicate entries from Itab comparing Field1 Field2.

You can refer to the following SDN link

Regards

Inder

Read only

Former Member
0 Likes
460

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