<?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: Before FOR ALL ENTRIES  remove duplicate values. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228573#M1380247</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;This is very simple before using any table as for all enteries,sort the same and use delete adjacenbt duplicate comparing the key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;sort gt_ekpo by werks matnr.
delete adjacent duplicate comparing werks.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;same for gt_prps as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will definetly solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pooja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2009 11:17:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-12T11:17:59Z</dc:date>
    <item>
      <title>Before FOR ALL ENTRIES  remove duplicate values.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228567#M1380241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi In code inspector i am getting messgae that before for all entries remove duplicate values.&lt;/P&gt;&lt;P&gt;How can I do the same for following code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 SELECT prctr FROM marc INTO TABLE gt_marc
          FOR ALL ENTRIES IN gt_ekpo
          WHERE werks EQ gt_ekpo-werks
          AND matnr EQ gt_ekpo-matnr
          AND prctr IN s_prctr.

    SELECT pspnr FROM prps
           INTO TABLE gt_prps
           FOR ALL ENTRIES IN gt_ekpo
           WHERE werks EQ gt_ekpo-werks
           AND matnr EQ gt_ekpo-matnr
           AND pspnr IN s_pspnr.

    SELECT pstrm
           eetrm
           FROM prte INTO TABLE gt_prte
           FOR ALL ENTRIES IN gt_prps
           WHERE posnr EQ gt_prps-pspnr
           AND pstrm IN s_pstrm
           AND eetrm IN s_eetrm.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 10:52:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228567#M1380241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T10:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Before FOR ALL ENTRIES  remove duplicate values.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228568#M1380242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi oorvi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before using the table gt_ekpo, (For all entries in gt_ekpo), you can use the statement "DELETE ADJACENT DUPLICATES" on the table gt_ekpo, BY COMPARING the key fields. This will delete the duplicate entries of table gt_ekpo. This will improve the performance of the corresponding select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 10:56:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228568#M1380242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T10:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Before FOR ALL ENTRIES  remove duplicate values.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228569#M1380243</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;Try like this ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort gt_ekpo by matnr 
delete adjacent duplicates from table gt_ekpo.

sort gt_prps by  pspnr
delete adjacent duplicates from table gt_prps.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use for all entries &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 10:57:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228569#M1380243</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2009-10-12T10:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Before FOR ALL ENTRIES  remove duplicate values.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228570#M1380244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;{color:blue}&lt;/P&gt;&lt;P&gt;hi friend&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort gt_ekpo by matnr werks ascending.
delete adjacent duplicates from gt_ekpo comparing matnr werks.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;after that following ur code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;surender&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="color"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 11:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228570#M1380244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T11:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Before FOR ALL ENTRIES  remove duplicate values.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228571#M1380245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Before you use FOR ALL ENTRIES statement, you must two things.
&amp;lt;li&amp;gt;Check whether FOR ALL ENTRIES table has values or not . If you do not check, and it does not have values, it gives dump.
&amp;lt;li&amp;gt;Sort the internal tables before use
&amp;lt;li&amp;gt;You need to check Whether it has duplicate entries.
&amp;lt;li&amp;gt;Try the below way to use .
&lt;PRE&gt;&lt;CODE&gt;DELETE ADJACENT DUPLICATES FROM gt_ekpo.
IF gt_ekpo[] IS NOT INITIAL.
  SELECT prctr FROM marc INTO TABLE gt_marc
           FOR ALL ENTRIES IN gt_ekpo
           WHERE werks EQ gt_ekpo-werks
           AND matnr EQ gt_ekpo-matnr
           AND prctr IN s_prctr.
ENDIF.
DELETE ADJACENT DUPLICATES FROM gt_ekpo.
IF gt_ekpo[] IS NOT INITIAL.
  SELECT pspnr FROM prps
         INTO TABLE gt_prps
         FOR ALL ENTRIES IN gt_ekpo
         WHERE werks EQ gt_ekpo-werks
         AND matnr EQ gt_ekpo-matnr
         AND pspnr IN s_pspnr.
ENDIF.
IF gt_prps[] IS NOT INITIAL.
  SELECT pstrm
         eetrm
         FROM prte INTO TABLE gt_prte
         FOR ALL ENTRIES IN gt_prps
         WHERE posnr EQ gt_prps-pspnr
         AND pstrm IN s_pstrm
         AND eetrm IN s_eetrm.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 11:09:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228571#M1380245</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-10-12T11:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Before FOR ALL ENTRIES  remove duplicate values.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228572#M1380246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friend ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;given below is the important point that we need to take care before using for all entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Sort the table using the key field &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT LT_BSIS BY BUKRS GJAHR BELNR. all are key field 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. delete the dublicate entries &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 DELETE ADJACENT DUPLICATES FROM LT_KUNNR COMPARING KUNNR. kunnr is the key field
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.  Before using internal table with the table inwhich you have a data &lt;/P&gt;&lt;P&gt; check is initial or not &lt;/P&gt;&lt;P&gt;if initial that false&lt;/P&gt;&lt;P&gt;else true &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF NOT LT_BSIS IS INITIAL.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. try to use all tha key field in for all entries if not using than pass all the key field is initial&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

C_AUGDT       LIKE BSIS-AUGDT  VALUE IS INITIAL,
pass in code
BSIS GE C_AUGDT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 11:11:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228572#M1380246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T11:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Before FOR ALL ENTRIES  remove duplicate values.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228573#M1380247</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;This is very simple before using any table as for all enteries,sort the same and use delete adjacenbt duplicate comparing the key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;sort gt_ekpo by werks matnr.
delete adjacent duplicate comparing werks.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;same for gt_prps as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will definetly solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pooja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 11:17:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-for-all-entries-remove-duplicate-values/m-p/6228573#M1380247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T11:17:59Z</dc:date>
    </item>
  </channel>
</rss>

