<?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: Update or append data from internal table to transparent table . in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758785#M1461321</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;You can use &lt;STRONG&gt;MODIFY&lt;/STRONG&gt; key word to update the database.  This serves 2 purposes.&lt;/P&gt;&lt;P&gt;1) if the Records with Primary Key already there it &lt;STRONG&gt;UPDATEs&lt;/STRONG&gt; the Records&lt;/P&gt;&lt;P&gt;2) Otherwise it &lt;STRONG&gt;APPENDs&lt;/STRONG&gt; the Records to the Transperant Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab into wa.
" do whatever you want to process
endloop.

modify &amp;lt;DBTAB&amp;gt; FROM TABLE &amp;lt;ITAB&amp;gt; " Instead of modifying within a loop you can do it FROM TABLE addition&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For more infor Take F1 help on this &lt;STRONG&gt;MODIFY&lt;/STRONG&gt; key word&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would serve your purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheerz&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Apr 2010 03:22:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-17T03:22:37Z</dc:date>
    <item>
      <title>Update or append data from internal table to transparent table .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758784#M1461320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Guru ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a program which can compare the records between internal table and transparent table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the transparent table already have the record (check with PK) , it only update the record from internal table . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not , append the record from my internal table to the transparent table ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My solution is a stupid way that is to check the transparent table before we take the decision ... if it has , update , if not , append ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does any fast way can do this ?&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;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Carlos Zhang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Apr 2010 03:14:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758784#M1461320</guid>
      <dc:creator>carlos_zhang3</dc:creator>
      <dc:date>2010-04-17T03:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update or append data from internal table to transparent table .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758785#M1461321</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;You can use &lt;STRONG&gt;MODIFY&lt;/STRONG&gt; key word to update the database.  This serves 2 purposes.&lt;/P&gt;&lt;P&gt;1) if the Records with Primary Key already there it &lt;STRONG&gt;UPDATEs&lt;/STRONG&gt; the Records&lt;/P&gt;&lt;P&gt;2) Otherwise it &lt;STRONG&gt;APPENDs&lt;/STRONG&gt; the Records to the Transperant Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab into wa.
" do whatever you want to process
endloop.

modify &amp;lt;DBTAB&amp;gt; FROM TABLE &amp;lt;ITAB&amp;gt; " Instead of modifying within a loop you can do it FROM TABLE addition&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For more infor Take F1 help on this &lt;STRONG&gt;MODIFY&lt;/STRONG&gt; key word&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would serve your purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheerz&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Apr 2010 03:22:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758785#M1461321</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-17T03:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update or append data from internal table to transparent table .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758786#M1461322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day Carlos Zhang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code i used.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: fs_spfli like line of t_spfli,
      fs_spfli1 like line of t_spfli.
 
Loop at t_spfli into fs_spfli.

MODIFY zspfli from fs_spfli.
clear fs_spfli.
  IF sy-subrc EQ 0.
        COMMIT WORK.
      ELSE.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
 Endloop.

HERE ZSPFLI IS MY TRANSPERANT TABLE I CREATED.
T_SPFLI CONTAINS RECORDS SOME MAY BE EXTRA RECORDS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards and Best wishes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Apr 2010 03:47:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758786#M1461322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-17T03:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Update or append data from internal table to transparent table .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758787#M1461323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use MODIFY &amp;lt;database table&amp;gt; FROM TABLE &amp;lt;internal table&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the record avaialble for primary key condition in database table, record will be updated, otherwise record will be inserted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Apr 2010 05:18:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758787#M1461323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-17T05:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update or append data from internal table to transparent table .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758788#M1461324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May i know how does your solution differ from Ramchander's post ? Does it add any value ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Apr 2010 05:31:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-or-append-data-from-internal-table-to-transparent-table/m-p/6758788#M1461324</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-17T05:31:57Z</dc:date>
    </item>
  </channel>
</rss>

