<?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: Comparing two internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2797565#M653121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;APPEND it_bsik1_wa TO it_bsik_error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no need to write &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT it_bsik_bdc_wa INTO it_bsik_bdc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will  automatically  append it when record is new&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing you can do this also by AT NEW command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards if useful..................&lt;/P&gt;&lt;P&gt;Minal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Sep 2007 05:05:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-17T05:05:01Z</dc:date>
    <item>
      <title>Comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2797564#M653120</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;I have a one internal table in which all records of BSIK tables are there and in other internal table i have records (belnr, bukrs and lifnr ) from my flat file. Now i want to check if that particular record in flat file exists in bsik internal table and if exists it will sum up wrbtr for that record on basis of belnr, lifnr and bukrs otherwise append in file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;  LOOP AT it_bsik_flat INTO it_bsik_flat_wa.&lt;/P&gt;&lt;P&gt;    UNPACK it_bsik_flat_wa-lifnr TO var.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read table will read only 1 record at-a-time but there may be muliple records&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    READ TABLE it_bsik INTO it_bsik1_wa&lt;/P&gt;&lt;P&gt;    WITH KEY bukrs = it_bsik_flat_wa-bukrs&lt;/P&gt;&lt;P&gt;     lifnr = var&lt;/P&gt;&lt;P&gt;     belnr = it_bsik_flat_wa-belnr.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      MOVE it_bsik1_wa-bukrs TO it_bsik_bdc_wa-bukrs.&lt;/P&gt;&lt;P&gt;      MOVE it_bsik1_wa-lifnr TO it_bsik_bdc_wa-lifnr.&lt;/P&gt;&lt;P&gt;      MOVE it_bsik1_wa-belnr TO it_bsik_bdc_wa-belnr.&lt;/P&gt;&lt;P&gt;      MOVE it_bsik1_wa-waers TO it_bsik_bdc_wa-waers.&lt;/P&gt;&lt;P&gt;      MOVE it_bsik1_wa-wrbtr TO it_bsik_bdc_wa-wrbtr.&lt;/P&gt;&lt;P&gt;      COLLECT it_bsik_bdc_wa INTO it_bsik_bdc.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      APPEND it_bsik1_wa TO it_bsik_error.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help will be awarded.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 04:59:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2797564#M653120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T04:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2797565#M653121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;APPEND it_bsik1_wa TO it_bsik_error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no need to write &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT it_bsik_bdc_wa INTO it_bsik_bdc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will  automatically  append it when record is new&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing you can do this also by AT NEW command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards if useful..................&lt;/P&gt;&lt;P&gt;Minal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 05:05:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2797565#M653121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T05:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2797566#M653122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi minal,&lt;/P&gt;&lt;P&gt;thanx for ur prompt reply. but i wanna get sum of records of same BELNR also.&lt;/P&gt;&lt;P&gt;like for all same BELNR in flat file i wanna get sum and if any belnr doesnot exists it should be recoded in log structure.&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;Sachin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 05:31:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2797566#M653122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T05:31:17Z</dc:date>
    </item>
  </channel>
</rss>

