<?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: Internal table to DB Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435316#M1998270</link>
    <description>&lt;P&gt;What "error" do you get?&lt;/P&gt;</description>
    <pubDate>Fri, 24 Sep 2021 16:58:19 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2021-09-24T16:58:19Z</dc:date>
    <item>
      <title>Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435311#M1998265</link>
      <description>&lt;P&gt;Hello folks,&lt;/P&gt;
  &lt;P&gt;I'm currently working on to update the table in SAP db from the internal table.&lt;/P&gt;
  &lt;P&gt;First, I made an internal table from three different db tables. &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF GT_FINAL,
         LFGJA TYPE MBEWH-LFGJA,
         LFMON TYPE MBEWH-LFMON,
         LBKUM TYPE MBEWH-LBKUM,
         SALK3 TYPE MBEWH-SALK3,
         VERPR TYPE MBEWH-VERPR,
         STPRS TYPE MBEWH-STPRS,
         PEINH TYPE MBEWH-PEINH,
         MATNR TYPE MARA-MATNR,
         MTART TYPE MARA-MTART,
         MAKTX TYPE MAKT-MAKTX,
       END OF GT_FINAL.

DATA: IT_FINAL TYPE TABLE OF GT_FINAL,
      WA_FINAL TYPE          GT_FINAL.

SELECT A~LFGJA
         A~LFMON
         A~LBKUM
         A~SALK3
         A~VERPR
         A~STPRS
         A~PEINH
         B~MATNR
         B~MTART
         C~MAKTX
    APPENDING CORRESPONDING FIELDS OF TABLE IT_FINAL
    FROM MBEWH AS A
    INNER JOIN MARA AS B
    ON A~MATNR = B~MATNR
    INNER JOIN MAKT AS C
    ON A~MATNR = C~MATNR
    WHERE A~LFGJA EQ P_LFGJA
          A~LFMON IN P_LFMON
          B~MATNR IN P_MATNR.

DELETE FROM ZREPORT01_TABLE
      WHERE LFGJA EQ P_LFGJA
        AND LFMON IN P_LFMON
        AND MATNR IN P_MATNR.



INSERT ZTABLE FROM IT_FINAL&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;And here is my problem comes.&lt;/P&gt;
  &lt;P&gt;First, I was trying to delete current db table.&lt;/P&gt;
  &lt;P&gt;Then, I was trying to update the db table from internal table in someway.&lt;/P&gt;
  &lt;P&gt;I got stuck because everytime I was trying to use, &lt;/P&gt;
  &lt;P&gt;INSERT ZTABLE FROM IT_FINAL.&lt;/P&gt;
  &lt;P&gt;I got error. &lt;/P&gt;
  &lt;P&gt;Overall, my question is.&lt;/P&gt;
  &lt;P&gt;how to update db table from internal table?&lt;/P&gt;
  &lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 13:48:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435311#M1998265</guid>
      <dc:creator>danielpray805</dc:creator>
      <dc:date>2021-09-24T13:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435312#M1998266</link>
      <description>&lt;P&gt;Thank you for visiting SAP
Community to get answers to your questions. Since this is your first question, I
recommend that you familiarize yourself with &lt;U&gt;&lt;A href="https://community.sap.com/resources/questions-and-answers"&gt;Community
Q&amp;amp;A&lt;/A&gt;&lt;/U&gt; , as the overview provides tips for
preparing questions that draw responses from our members. &lt;/P&gt;&lt;P&gt;Should you wish, you can revise
your question by selecting Actions, then Edit.&lt;/P&gt;&lt;P&gt;By adding a picture to your Profile
you encourage readers to respond.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 13:49:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435312#M1998266</guid>
      <dc:creator>former_member763929</dc:creator>
      <dc:date>2021-09-24T13:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435313#M1998267</link>
      <description>&lt;P&gt;... ACCEPTING DUPLICATE KEYS  maybe help.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 13:51:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435313#M1998267</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-09-24T13:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435314#M1998268</link>
      <description>&lt;P&gt;ZTABLE and IT_FINAL must be compatible. Is that the case?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 14:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435314#M1998268</guid>
      <dc:creator>hrmanagerde</dc:creator>
      <dc:date>2021-09-24T14:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435315#M1998269</link>
      <description>&lt;P&gt;Basically the record of the internal table must match those of the database table&lt;/P&gt;&lt;P&gt;&lt;EM&gt;usually (easy way) the internal table is defined from the database table ddic definition&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;EM&gt;DATA: IT_FINAL TYPE TABLE OF ZTABLE.&lt;/EM&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Read the documentation of &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapinsert_dbtab.htm"&gt;Insert dbtab in SQL Abap&lt;/A&gt; and look for &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenopen_sql_wa.htm"&gt;ABAP SQL - Work Areas in Statements&lt;/A&gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Then either use the ddic table definition or adapt your internal table type to make it compliant with the database table&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 14:28:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435315#M1998269</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2021-09-24T14:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435316#M1998270</link>
      <description>&lt;P&gt;What "error" do you get?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 16:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435316#M1998270</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-09-24T16:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435317#M1998271</link>
      <description>&lt;P&gt;"Got an error" is not a recognisable message. For all I know it means your computer explodes each time you try to run it.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Sep 2021 12:42:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435317#M1998271</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-09-25T12:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435318#M1998272</link>
      <description>&lt;P&gt;I believe they are compatible.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 19:21:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435318#M1998272</guid>
      <dc:creator>danielpray805</dc:creator>
      <dc:date>2021-09-26T19:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table to DB Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435319#M1998273</link>
      <description>&lt;P&gt;I guess ZTABLE AND IT_FINAL internal table doesn't match.&lt;/P&gt;&lt;P&gt;In that case, then, I guess I should define this &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: IT_FINAL TYPE TABLE OF GT_FINAL,
      WA_FINAL TYPE          GT_FINAL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to this. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: IT_FINAL TYPE TABLE OF ZTABLE,
      WA_FINAL TYPE        ZTABLE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But, then what about the GT_FINAL? It seems like that GT_FINAL is useless then.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 19:23:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-to-db-table/m-p/12435319#M1998273</guid>
      <dc:creator>danielpray805</dc:creator>
      <dc:date>2021-09-26T19:23:11Z</dc:date>
    </item>
  </channel>
</rss>

