Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8538

Re: Only Delete duplicate Matnr

$
0
0

Hi abdul,

 

I'm not asking here for a solution...

I would suggest, to do it in this way.

 

TYPES: BEGIN OF TY,

         FIELD1 TYPE N LENGTH 18,

         FIELD2 TYPE C LENGTH 20,

        END OF TY.

 

DATA: WA2 TYPE TY,

       ITAB LIKE STANDARD TABLE OF WA,

       ITAB2 LIKE STANDARD TABLE OF WA.

 

FIELD-SYMBOLS: <lfs_wa> TYPE TY.

 

... <Insert sample code from above>

 

SORT ITAB BY FIELD1.

ITAB2 = ITAB.

 

DELETE ADJUCANT DUPLICATES ITAB2 COMPARING FIELD1.

 

LOOP AT ITAB2 INTO WA2.

    LOOP AT ITAB ASSIGNING <lfs_wa> where FIELD1 = WA2-FIELD1.

        IF sy-tabix <> 1.

          clear: <lfs_wa>-field1.

        ENDIF.

        WRITE: / <lfs_wa>-FIELD1, <lfs_wa>-FIELD2. 

    ENDLOOP.

ENDLOOP.

 

~Florian

 

PS: No guarantee that this syntax is correct, because it is just written here and not tested


Viewing all articles
Browse latest Browse all 8538

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>