<?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: APPEND in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598122#M866530</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;The record is selected twice because conditions in the second SELECT are almost equal to the conditions in the first SELECT. You only added the &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AND bschl IN r_bschl&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you are selecting using the FOR ALL ENTRIES and the condition for this is &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AND belnr EQ it_bseg-belnr&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which is selected in the first SELECT&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AND belnr EQ it_bkpf-belnr&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you want to change the FOR ALL ENTRIES condition to some other field, perhaps the Reversal document number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2008 09:53:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-17T09:53:46Z</dc:date>
    <item>
      <title>APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598115#M866523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all &lt;/P&gt;&lt;P&gt;If u see below there are two SELECT statements.In the first statement am selecting RECORD1 and in the second SELECT statement i want to select RECORD2.But whats happening is RECORD 1 is getting selected TWICE and in the output am getting as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECORD1&lt;/P&gt;&lt;P&gt;RECORD1&lt;/P&gt;&lt;P&gt;RECORD2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using &lt;STRONG&gt;INTO table it_bseg&lt;/STRONG&gt; in the second statment but am not getting it.Am also using &lt;STRONG&gt;DELETE ADJACENT....&lt;/STRONG&gt;.But am getting the same out put.Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards &lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;belnr  gjahr   buzei  bschl  koart  shkzg  wrbtr&lt;/P&gt;&lt;P&gt;sgtxt  saknr  hkont  kunnr  lifnr    prctr   FROM bseg &lt;/P&gt;&lt;P&gt;INTO TABLE it_bseg  FOR ALL ENTRIES IN it_bkpf&lt;/P&gt;&lt;P&gt; WHERE bukrs EQ p_bukrs  AND belnr EQ it_bkpf-belnr AND&lt;/P&gt;&lt;P&gt; gjahr EQ p_gjahr  AND   umskz NE 'F' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not it_bseg[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;belnr  gjahr  buzei bschl koart shkzg wrbtr sgtxt saknr        hkont kunnr  lifnr    prctr FROM bseg&lt;/P&gt;&lt;P&gt; APPENDING table it_bseg&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_bseg  WHERE bukrs EQ p_bukrs       AND  belnr EQ it_bseg-belnr AND gjahr EQ p_gjahr&lt;/P&gt;&lt;P&gt;AND  umskz NE 'F' AND bschl IN r_bschl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM it_bseg comparing bschl belnr prctr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:45:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598115#M866523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598116#M866524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi krishna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just delete adjacent duplicates in it_bkpf  befiore using for all entries and also in it_bseg before using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Madhu..!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:48:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598116#M866524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598117#M866525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try appending it separately after the two select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598117#M866525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598118#M866526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI RAMYA..&lt;/P&gt;&lt;P&gt;Can u tell me exactly where to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:50:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598118#M866526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598119#M866527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi madhu can u explain me exactly where to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:51:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598119#M866527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598120#M866528</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;in your code use this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after   first select statement &lt;/P&gt;&lt;P&gt;sort the itab by field1.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from itab comparing the field1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:52:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598120#M866528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598121#M866529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before DELETE ADJACENT DUPLICATES you must SORT this table with relevant fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598121#M866529</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598122#M866530</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;The record is selected twice because conditions in the second SELECT are almost equal to the conditions in the first SELECT. You only added the &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AND bschl IN r_bschl&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you are selecting using the FOR ALL ENTRIES and the condition for this is &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AND belnr EQ it_bseg-belnr&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which is selected in the first SELECT&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AND belnr EQ it_bkpf-belnr&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you want to change the FOR ALL ENTRIES condition to some other field, perhaps the Reversal document number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:53:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598122#M866530</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598123#M866531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First sort the internal table it_bkpf based on the primary keys &amp;amp; then delete the adjacent duplicates from it. Next after the 1st select statement sort the internal table it_bseg &amp;amp; then delete the duplicate entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sayee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:55:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598123#M866531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598124#M866532</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 think there may two differnt combination of RECORD1 may exist thats y its coming like that first of all check the internal table wether both the records having same values in all fields... if not then check for the condition.... &lt;/P&gt;&lt;P&gt;check the internal table first by debugging..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Arunprasad.P&lt;/P&gt;&lt;P&gt;Reward if usefull.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:56:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598124#M866532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: APPEND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598125#M866533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question here &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Why are you doing 2 selects for the same table ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyway ....... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something Like this ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;belnr gjahr buzei bschl koart shkzg wrbtr&lt;/P&gt;&lt;P&gt;sgtxt saknr hkont kunnr lifnr prctr FROM bseg &lt;/P&gt;&lt;P&gt;INTO TABLE it_bseg FOR ALL ENTRIES IN it_bkpf&lt;/P&gt;&lt;P&gt;WHERE bukrs EQ p_bukrs AND belnr EQ it_bkpf-belnr AND&lt;/P&gt;&lt;P&gt;gjahr EQ p_gjahr AND umskz NE 'F' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not it_bseg[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;belnr gjahr buzei bschl koart shkzg wrbtr sgtxt saknr hkont kunnr lifnr prctr FROM bseg&lt;/P&gt;&lt;P&gt;APPENDING table it_bseg&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_bseg WHERE bukrs EQ p_bukrs AND belnr EQ it_bseg-belnr AND gjahr EQ p_gjahr&lt;/P&gt;&lt;P&gt;AND umskz NE 'F' AND bschl IN r_bschl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SORT it_bseg BY bschl belnr prctr.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM it_bseg comparing bschl belnr prctr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Kripa Rangachari.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 10:02:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append/m-p/3598125#M866533</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T10:02:57Z</dc:date>
    </item>
  </channel>
</rss>

