<?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: inserting to itabs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850788#M46174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if my itab contains fields name, value, catalog.&lt;/P&gt;&lt;P&gt;Can I do an append like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;APPEND NAME, VALUE, CATALOG TO ITAB.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;? If name, value, and catalog correspond are variables and correspond to the field names of the itab.&lt;/P&gt;&lt;P&gt;I saw something similar in F1, but it looked like it only inserted values to an itab that only had one field- basically a list. I'm going to test this now.&lt;/P&gt;&lt;P&gt;N L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Mar 2005 15:34:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-03-09T15:34:25Z</dc:date>
    <item>
      <title>inserting to itabs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850784#M46170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do MOVE:... to itab-... statements insert new records to itabs within a loop? Or will it continually replace the first record in the internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at TableA.
  Move: TABLEA-NAME TO vName.
  SELECT NAME INTO tempname FROM TableB WHERE NAME=vName.
  ENDSELECT.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
     MOVE: tempname  INTO ITAB_nameholder-Name.
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason why I ask is because later down in my program I loop at my internal table, but it does not recognize it as a table. (Even though I declared it earlier.) So I think it may be that my inserts to the itab are not working. &lt;/P&gt;&lt;P&gt;N L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2005 15:10:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850784#M46170</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-09T15:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: inserting to itabs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850785#M46171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your internal table has a header line, then moving values to it would only move it in the header line.  Use APPEND ITAB statement after fill the header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data: imara type table of mara with header line.
Data: itab type table of mara with header line.

loop at imara.
move-corresponding imara to itab.
append itab.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if your itab is defined like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of itab &amp;lt;b&amp;gt;occurs 0 &amp;lt;/b&amp;gt;,
      field(1) type c,
      end of itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then by default it has a header line.&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;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2005 15:15:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850785#M46171</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-09T15:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: inserting to itabs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850786#M46172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your LOOP AT is syntactically correct, then you are&lt;/P&gt;&lt;P&gt;using tables with header lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a couple of lines to your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at TableA.
  Move: TABLEA-NAME TO vName.
  SELECT NAME INTO tempname FROM TableB WHERE NAME=vName.
  ENDSELECT.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
     &amp;lt;b&amp;gt;CLEAR ITAB_NAMEHOLDER.&amp;lt;/b&amp;gt;
     MOVE: tempname  INTO ITAB_nameholder-Name.
     &amp;lt;b&amp;gt;APPEND ITAB_NAMEHOLDER.&amp;lt;/b&amp;gt;
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2005 15:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850786#M46172</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-09T15:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: inserting to itabs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850787#M46173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my itab is defined like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of itab occurs 0 , 
            field(1) type c,      
            end of itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and when I try to append the itab, it says my syntax should be like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
APPEND fld TO itab
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm reading up on APPEND in F1, but is APPEND similar to INSERT in SQL?&lt;/P&gt;&lt;P&gt;like, instead of doing&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MOVE: VAL to ITAB-val.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;should I do:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;APPEND VAL TO ITAB-VAL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;?? (I require several inserts to the different fields of the itab.)&lt;/P&gt;&lt;P&gt;Natasha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2005 15:26:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850787#M46173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-09T15:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: inserting to itabs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850788#M46174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if my itab contains fields name, value, catalog.&lt;/P&gt;&lt;P&gt;Can I do an append like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;APPEND NAME, VALUE, CATALOG TO ITAB.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;? If name, value, and catalog correspond are variables and correspond to the field names of the itab.&lt;/P&gt;&lt;P&gt;I saw something similar in F1, but it looked like it only inserted values to an itab that only had one field- basically a list. I'm going to test this now.&lt;/P&gt;&lt;P&gt;N L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2005 15:34:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850788#M46174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-09T15:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: inserting to itabs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850789#M46175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be filling all your fields of the table structure then doing an append.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: begin of itab occurs 0,
      field1 type c,
      field2 type c,
      field3 type c,
      end of itab.

itab-field1 = 'A'.
itab-field2 = 'B'.
itab-field3 = 'C'.
append itab.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your internal table has no header line, then you need a work area to hold you data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

types: begin of ttab,
      field1 type c,
      field2 type c,
      field3 type c,
      end of ttab.

data: itab type table of ttab.
data: xtab type ttab.

xtab-field1 = 'A'.
xtab-field2 = 'B'.
xtab-field3 = 'C'.
append xtab to itab.

&lt;/CODE&gt;&lt;/PRE&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>Wed, 09 Mar 2005 15:36:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850789#M46175</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-09T15:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: inserting to itabs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850790#M46176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the reason why my itabs were not getting populated was because I was looping at a database table.&lt;/P&gt;&lt;P&gt;Thanks for your help gentlemen.&lt;/P&gt;&lt;P&gt;N L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2005 16:04:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-to-itabs/m-p/850790#M46176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-09T16:04:53Z</dc:date>
    </item>
  </channel>
</rss>

