<?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 Inserting columns from internal table to a database table! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339726#M172041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi people,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I go about to insert columns from an internal table -intab- into an data base table -dbtab-. These tables contain some similar columns, not all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A code example would be much appriciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Armin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Jun 2006 16:15:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-09T16:15:51Z</dc:date>
    <item>
      <title>Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339726#M172041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi people,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I go about to insert columns from an internal table -intab- into an data base table -dbtab-. These tables contain some similar columns, not all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A code example would be much appriciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Armin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 16:15:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339726#M172041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T16:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339727#M172042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Inserting a column in internal table is nothing by defining a field in your internal table defination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And before that you might inserted the field in database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I understood your query ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 16:19:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339727#M172042</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-06-09T16:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339728#M172043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Armin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         Use the following statement.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;INSERT INTO dbtab VALUES intab.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to update few rows of internal table based on certain condition do as follows::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DATA wa TYPE intab.&lt;/P&gt;&lt;P&gt;LOOP AT intab INTO wa WHERE&amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&gt;INSERT INTO dbtab VALUES wa.&lt;/P&gt;&lt;P&gt;CLEAR wa.&lt;/P&gt;&lt;P&gt;ENDLOOP.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 16:20:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339728#M172043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T16:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339729#M172044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Loop at your internal table move corresponding fields from your itab wa to the wa of the db table, then modify the db table from the wa.&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;data: xtable type ztable.


Loop at itab.

move-corresponding itab to xtable.
modify ztable from xtable.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 16:20:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339729#M172044</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-09T16:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339730#M172045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi armin,&lt;/P&gt;&lt;P&gt;INSERT  dbtab      FROM TABLE itab. oder &lt;/P&gt;&lt;P&gt;INSERT (dbtabname) FROM TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... ACCEPTING DUPLICATE KEYS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ... CONNECTION con &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Mass insert: All lines of the internal table itab are inserted in one single operation. The lines of itab must fulfill the same conditions as the work area wa in variant 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the command has been executed, the system field SY-DBCNT contains the number of inserted lines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;All lines successfully inserted. Any other result causes a runtime error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0 after the call. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;As with variant 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... ACCEPTING DUPLICATE KEYS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;If a line cannot be inserted, the system does not&lt;/P&gt;&lt;P&gt;terminate with a runtime error but only sets the return value SY-SUBRC to 4. All other lines are inserted after the command is executed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;do reward if it helps,&lt;/P&gt;&lt;P&gt;priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 16:27:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339730#M172045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T16:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339731#M172046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Armin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you want to &lt;/P&gt;&lt;P&gt;1)insert new record in all the cases or&lt;/P&gt;&lt;P&gt;2) you want to insert only when its a new record in internal table but if there is a record with same keys already present in the table, then the existing record should be updated with the internal table records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If first case is true then code will be :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT dbtab FROM TABLE intab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else if the second case is true then code will be :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODIFY dbtab FROM TABLE intab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above statements will do mass updates in 1 go but if you want to do it in a loop taking 1 record from intab and inserting it then statement will be :&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : wa_intab type intab.
  loop at intab into wa_intab.
   INSERT INTO dbtab VALUES wa_intab.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) )&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : wa_intab type intab.
  loop at intab into wa_intab.
   MODIFY dbtab FROM wa_intab.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vikram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward for helpful replies!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 16:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339731#M172046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T16:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339732#M172047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for your suggestions, but I have allready tryed all the suggested approaches and non of them worked:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) When trying this approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT dbtab FROM TABLE intab.&lt;/P&gt;&lt;P&gt;or:&lt;/P&gt;&lt;P&gt;MODIFY dbtab FROM TABLE intab.&lt;/P&gt;&lt;P&gt;or:&lt;/P&gt;&lt;P&gt;data : wa_intab type intab.&lt;/P&gt;&lt;P&gt;  loop at intab into wa_intab.&lt;/P&gt;&lt;P&gt;   INSERT INTO dbtab VALUES wa_intab.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the error: "The type of the database table and work area (or internal table) are not Unicode convertible.."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) When trying this approach as suggested by mr. Heilman: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA db_wa TYPE dbtab.&lt;/P&gt;&lt;P&gt;LOOP AT intab&lt;/P&gt;&lt;P&gt;  INTO wa&lt;/P&gt;&lt;P&gt;  WHERE checkboxx = 'X'.&lt;/P&gt;&lt;P&gt;  db_wa~stono = wa-stono.&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;  INSERT INTO dbtab VALUES db_wa.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the error: "db_wa unexpected.."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the tables have some columns that are the same and others that are not. They are not of the same type!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone had this prob before and solved it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 17:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339732#M172047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T17:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339733#M172048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check your program with UCCHECK tcode, this might give you some log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 17:04:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339733#M172048</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-06-09T17:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339734#M172049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never mind guys, Rich's sollution worked. Had some other problems that made me initially think it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So 10 goes to mr. Heilman and rest of you get a strong 2 for the effort!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks guys!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 17:16:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339734#M172049</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T17:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339735#M172050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Armin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to do that?? Thats surprizing !! could you please explain me how it adds a new column to a DATABASE TABLE from internal table??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Amiya Shrivastava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jun 2006 07:13:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339735#M172050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-10T07:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting columns from internal table to a database table!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339736#M172051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry ..I read the confabulation only superficially, now I am clear with what you had asked!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting columns values and not adding new columns!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jun 2006 07:18:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-columns-from-internal-table-to-a-database-table/m-p/1339736#M172051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-10T07:18:09Z</dc:date>
    </item>
  </channel>
</rss>

