Skip to Content
Jun 12, 2014 at 06:14 AM

Picking only one record from duplicate entries in internal table based on conditions


Hello All,

I have a requirement where ,If I have an internal table as shown below.

Header 1 Header 2 Header 3 Header 4 A B 10 C D E 3 F A B 5 C D E 6 F

For duplicate values comparing header 1,2,4 I should select only the one with max value for header3 and delete the other duplicates

i.e the output should be like

Header 1 Header 2 Header 3 Header 4 AB 10 C D E 6 F

I have tried sorting the internal table by header1 ,2,4 and then deleting adjacent duplicates but it wont work .

Any suggestions on how to solve this?? Do I need to use control break statements.