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

Re: delete duplicate entries with condition

$
0
0

Hi Haritha,

 

We can achieve this in couple of steps.

 

  • Copy the Internal table into a temporary Internal table IT_TEMP.
  • SORT IT_TEMP by RACCT.
  • DELETE ADJACENT DUPLICATES from the temp table IT_TEMP comparing RACCT. By which you will get the Unique Account Numbers.
  • Loop at IT_TEMP into LS_TEMP.
    • READ TABLE IT_GLT0 INTO LS_GLT0_1 WITH KEY RACCT = LS_TEMP-RACT
                        • DRCRK = 'H'.
    • READ TABLE IT_GLT0 INTO LS_GLT0_1 WITH KEY RACCT = LS_TEMP-RACT
      • DRCRK = 'S'.
    • IF LS_GLT0_1-HSLVT NE 0 AND  LS_GLT0_2-HSLVT NE 0.
      • APPEND LS_GLT0_1 TO IT_FINAL.
      • APPEND LS_GLT0_2 TO IT_FINAL.
    • ENDIF.
    • CLEAR: LS_GLT0_1, LS_GLT0_2.
  • ENDLOOP.

 

Now you will get the required data into your final internal table IT_FINAL.

 

Please ask me if any future clarifications required.


Viewing all articles
Browse latest Browse all 8667

Trending Articles



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