<?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: Remove duplicate values based on condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951229#M1694176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rudi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could try something like this (only 'pseudo code'... still have not learnt to write syntax error free ABAP without the syntax check &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;gs_file_fob&amp;gt; like line of gt_file_fob.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;loop at gt_file_fob assigning &amp;lt;gs_file_fob&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;gs_file_fob&amp;gt;-plant2 = &amp;lt;gs_file_fob&amp;gt;-plant+1(3).&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In terms of with header line vs. without header line: strange. I would not have expected any difference in the behavior. But using header lines is a bit old fashioned anyway... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thorsten&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2012 06:19:32 GMT</pubDate>
    <dc:creator>schneidertho</dc:creator>
    <dc:date>2012-08-15T06:19:32Z</dc:date>
    <item>
      <title>Remove duplicate values based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951226#M1694173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have implimented the BW-BPS upload file functionality, but I require some further enhancements to be done to the file to remove duplicate values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I have used, and it works, although now I want to remove further fields based on these conditions...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************Global Data*****************************&amp;nbsp; &lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ys_file_fob,&lt;/P&gt;&lt;P&gt;0KNART(4),&lt;/P&gt;&lt;P&gt;0PLANT(4),&lt;/P&gt;&lt;P&gt;ZPLANT(4),&lt;/P&gt;&lt;P&gt;0MATERIAL(25),&lt;/P&gt;&lt;P&gt;ZCNDNRATE(25),&lt;/P&gt;&lt;P&gt;ZCONDCRCY(3),&lt;/P&gt;&lt;P&gt;0SOLD_TO(10),&lt;/P&gt;&lt;P&gt;ZCURRCONV(1),&lt;/P&gt;&lt;P&gt;END OF ys_file_fob.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gt_file_fob TYPE STANDARD TABLE OF ys_file_fob WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ********************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT gt_file_fob by 0KNART 0PLANT ZCONDCRCY.&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM gt_file_fob COMPARING 0KNART 0PLANT ZCONDCRCY.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;*-------------------------------------------------------------------------------------&amp;gt;&amp;gt;*&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* Map and merge loaded data&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOOP AT gt_file_fob INTO ls_file.&lt;/P&gt;&lt;P&gt;CHECK sy-tabix &amp;gt; 1.&lt;/P&gt;&lt;P&gt;CLEAR ls_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The upload file used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Condition type Plant Sold-to party&amp;nbsp; Condition Rate Condition Currency&amp;nbsp; &lt;/P&gt;&lt;P&gt;ZDNH A002 A075 FECR_AGLX 0.25 USD 01.01.2010 31.12.9999&lt;/P&gt;&lt;P&gt;ZDNH A002 A075 FECR_LX 0.25 USD 01.01.2010 31.12.9999&lt;/P&gt;&lt;P&gt;ZDNH B022 B075 FECR_LXF 0.25 USD 01.01.2010 31.12.9999&lt;/P&gt;&lt;P&gt;ZDNH C002 C075 FECR_LXS 0.25 USD 01.01.2010 31.12.9999&lt;/P&gt;&lt;P&gt;ZDNH D042 D075 FECR_REC 0.25 USD 01.01.2010 31.12.9999&lt;/P&gt;&lt;P&gt;ZDNH B002 B075 FECR_RXF 0.25 USD 01.01.2010 31.12.9999&lt;/P&gt;&lt;P&gt;ZDNH E002 E075 FECR_RXS 0.25 USD 01.01.2010 31.12.9999&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I have used, and it works, although now I want to remove further fields based on these conditions...all these fields above results should be only one record. Meaning in the original code I removed duplicates excluding material, now I want to remove the records further where all the fields for plant (second column) = *002....to ignore the A, B, C... and filter on the *002 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I explained correctly...hehe, I searched for about two days already and could not find anything, hoping somone can assit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards and Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rudi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 14:58:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951226#M1694173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-08-14T14:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate values based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951227#M1694174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rudi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure if I understood the requirements to the full extend: you want to consider A002 and B002 as duplicates, because you want to ignore the first character (A, B) and do the comparison based on the last three characters (002)... right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably this is not the only way... I am not sure, if it is the fastest one... and I am not sure, if there is some specific BW-BPS functionality which might help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what about this idea: You create an additional column in your internal table. You fill this from the plant column. Somehow like this: gs_file_fob-plant2 = gs_file_fob-plant+1(3). Then you do the sort based on this column and then the deletion of duplicates...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thorsten&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 17:06:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951227#M1694174</guid>
      <dc:creator>schneidertho</dc:creator>
      <dc:date>2012-08-14T17:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate values based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951228#M1694175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, yes you are correct. That is exactly what I want to accomplish. However finding it difficult to impliment...hehe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the code gt_file_fob-plant2 = gt_file_fob-plant+1(3) I get the error that no header line specified, therefore plant2 does not exist. If I declare the table with header line, it does not seem to work to filter the records out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hehe, I get confused with this abap language &lt;SPAN __jive_emoticon_name="blush" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/910/images/emoticons/blush.gif"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks for replying.&lt;/SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 05:35:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951228#M1694175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-08-15T05:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate values based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951229#M1694176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rudi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could try something like this (only 'pseudo code'... still have not learnt to write syntax error free ABAP without the syntax check &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;gs_file_fob&amp;gt; like line of gt_file_fob.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;loop at gt_file_fob assigning &amp;lt;gs_file_fob&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;gs_file_fob&amp;gt;-plant2 = &amp;lt;gs_file_fob&amp;gt;-plant+1(3).&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In terms of with header line vs. without header line: strange. I would not have expected any difference in the behavior. But using header lines is a bit old fashioned anyway... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thorsten&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 06:19:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951229#M1694176</guid>
      <dc:creator>schneidertho</dc:creator>
      <dc:date>2012-08-15T06:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate values based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951230#M1694177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mr Thorsten, I am so happy now, you have helped me greatly....thank you sir!! It is working 100%, busy testing further, but sovar so good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I might have done something wrong with the header lines thing earlier. &lt;SPAN __jive_emoticon_name="blush" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" height="1" src="https://community.sap.com/910/images/emoticons/blush.gif" width="1"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rudi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 06:52:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/remove-duplicate-values-based-on-condition/m-p/8951230#M1694177</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-08-15T06:52:39Z</dc:date>
    </item>
  </channel>
</rss>

