<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ABAP code to delete duplicate records in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597812#M1758222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ahmad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Internal table is the SOURCE_PACKAGE[] in the start routine of the DSO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jul 2013 07:32:04 GMT</pubDate>
    <dc:creator>NagaPrakashT</dc:creator>
    <dc:date>2013-07-18T07:32:04Z</dc:date>
    <item>
      <title>ABAP code to delete duplicate records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597811#M1758221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help to write complete ABAP code for below scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Request 101 loads data from PSA to WODSO and I have records like below in DSO active table /BIC/AFIGL00&lt;/P&gt;&lt;P&gt;request no. DocNo Line item Ccode Amount&lt;/P&gt;&lt;P&gt;101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;(among lots of other fields. Just to clarify this data is based on 0fi_gl_4 datasource)&lt;/P&gt;&lt;P&gt;These records are loaded futher into SDSO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with delta request 102, I get records like&lt;/P&gt;&lt;P&gt;request no. docNo Line item Ccode Amount&lt;/P&gt;&lt;P&gt;102&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;102&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I load these futher into SDSO then I have wrong figures. These duplicate records under different request nos. should be deleted/ignored while load from WODSO to SDSO. Therefore,&amp;nbsp; I think i need to have code as Start Routine&lt;/P&gt;&lt;P&gt;In some old posts I have got syntax &lt;/P&gt;&lt;P&gt;Sort &amp;lt;internal table&amp;gt;.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from &amp;lt;internaltable&amp;gt; comparing all fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I need complete code syntax. Does &amp;lt;internal table&amp;gt; means DSO active table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 15:16:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597811#M1758221</guid>
      <dc:creator>a_ahmad</dc:creator>
      <dc:date>2013-07-17T15:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to delete duplicate records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597812#M1758222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ahmad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Internal table is the SOURCE_PACKAGE[] in the start routine of the DSO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 07:32:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597812#M1758222</guid>
      <dc:creator>NagaPrakashT</dc:creator>
      <dc:date>2013-07-18T07:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to delete duplicate records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597813#M1758223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't do that &lt;SPAN __jive_emoticon_name="cry" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1642/images/emoticons/cry.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those records must be processed as some data of the accounting document was changed triggering the delta extraction (e.g; clearing date), just insure that amount/quantity key-figures are correctly copied to DSO: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In transformation, check via rule detail, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/247633" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;must be "MOV Overwrite" and not "SUM Summation".&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/247778" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;If you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;use old&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;3.x&lt;/SPAN&gt; flow, &lt;SPAN class="hps"&gt;please specify.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Also don't forget the keys of the DSO must always contain 0COMP_CODE, 0FISCPER (+0FISCVARNT) and 0AC_DOC_NO, 0ITEM_NUM to match BSEG primary keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Raymond Giuseppi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 07:51:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597813#M1758223</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2013-07-18T07:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to delete duplicate records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597814#M1758224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for replying&lt;/P&gt;&lt;P&gt;we have 7.3x system&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WDSO - keys: fiscper, fiscvarnt, fiscper3, fiscyear, Ac_doc_no, Pstng_date, comp_code, chrt_accts, gl_account, item_num&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from Datasource to WDSO : aggregation is 'overwrite'&lt;/P&gt;&lt;P&gt;from WDSO to SDSO: agg. is Summation &lt;/P&gt;&lt;P&gt;Reason: in WDSO we have line-item data but then further on we don't need doc_no level data. we need data at aggregated level only. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After first full load,&amp;nbsp; we reconciled figures with ECC and this dataflow worked fine. &lt;/P&gt;&lt;P&gt;Problem rose after first delta load. From PSA to WDSO, delta failed because of duplicate records. I changed WDSO settings to allow duplicate records and it worked (you can say problem avoided &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1642/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;. But after load from WDSO to SDSO, we reconciled figures again and found errors. We narrowed down: records in IC, SDSO, WDSO and found exact same records but with under different requests in WDSO. These records came through the delta. So when they are aggregated from WDSO to SDSO, they are creating wrong figures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, we are alright keeping these records in WDSO but then on these should be deleted/ignored.&lt;/P&gt;&lt;P&gt;I need help in writing ABAP code for this issue. &lt;/P&gt;&lt;P&gt;For data in each delta load request, data should be checked against all data of WDSO active table and duplicate records coming in delta request should be ignored for futher aggregation into SDSO.&lt;/P&gt;&lt;P&gt;e.g. Req 101 lying in WDSO and is aggregated into SDSO, now delta Req102 in WDSO, before load into SDSO this should be checked against all data of WDSO active table and if duplicate records are found, should not be aggregated in SDSO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this clarifies&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 09:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597814#M1758224</guid>
      <dc:creator>a_ahmad</dc:creator>
      <dc:date>2013-07-18T09:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to delete duplicate records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597815#M1758225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(I compare with a 731 SP 06 SAP_BW system)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMHO when you ignored duplicate records, you caused the problem, some data changed in ECC was&amp;nbsp; no longer pushed into BW DSO. First DSO data must be an exact replication of ECC, you should also have kept the keys of the standard DSO, to prevent such problem, did you change other attributes comparing DSO 0FIGL_O02 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then from this correct DSO, after activation, you can send delta requests to following targets, and yes there use SUM summation on key-figures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post your data flow ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 11:25:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597815#M1758225</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2013-07-18T11:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to delete duplicate records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597816#M1758226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data flow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DS -&amp;gt; WODSO -&amp;gt; SDSO -&amp;gt; IC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;key fields in WODSO: fiscper, fiscvarnt, fiscper3, fiscyear, Ac_doc_no, Pstng_date, comp_code, chrt_accts, gl_account, item_num&lt;/P&gt;&lt;P&gt;comparing with 0FIGL_O02, in my WODSO I have Posting data in addition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the time being I deleted all delta requests in WODSO as they were bringing duplicate records. &lt;/P&gt;&lt;P&gt;Need to figure out solution first and implement it for data load either from PSA to WODSO (wiht DSO setting: don't allow duplicate records) or from WODSO to SDSO (where WODSO setting: allow duplicate records)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to use below code but complete is for my scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort &amp;lt;internal table&amp;gt;.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from &amp;lt;internaltable&amp;gt; comparing all fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 13:32:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597816#M1758226</guid>
      <dc:creator>a_ahmad</dc:creator>
      <dc:date>2013-07-18T13:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to delete duplicate records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597817#M1758227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any help on this issue &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before loading delta data from WODSO to SDSO, need to write code to check delta data against all data of WODSO and ignore/delete duplicate records that is not letting them go into SDSO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 10:01:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-delete-duplicate-records/m-p/9597817#M1758227</guid>
      <dc:creator>a_ahmad</dc:creator>
      <dc:date>2013-07-22T10:01:40Z</dc:date>
    </item>
  </channel>
</rss>

