<?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: Populating an internal table. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-an-internal-table/m-p/917699#M58464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When using cooresponding fields, the internal table fields names should be the same as the table itself. Your data statement should be like this.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB2 OCCURS 0,&lt;/P&gt;&lt;P&gt;      ARCHIVEKEY LIKE ZARIXFI3-ARCHIVEKEY,&lt;/P&gt;&lt;P&gt;      ARCHIVEOFS LIKE ZARIXFI3-ARCHIVEOFS.&lt;/P&gt;&lt;P&gt;DATA: END OF ITAB2.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Mar 2005 19:14:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-03-02T19:14:51Z</dc:date>
    <item>
      <title>Populating an internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-an-internal-table/m-p/917697#M58462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know the conditions for this select are acceptable because when I select archiveykey and archiveofs into plain variable varKEY and varOFS, they get values. [the problem with this is that when there are more than one key and offset for the condition, varKEY and varOFS only retrieve the last record's info.]&lt;/P&gt;&lt;P&gt;For some reason, I cannot populate this internal table even though it's fields correspond directly to the fields from which I am trying to copy data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF ITAB2 OCCURS 0,
      KEY LIKE ZARIXFI3-ARCHIVEKEY,
      OFS LIKE ZARIXFI3-ARCHIVEOFS.
DATA: END OF ITAB2.
*
*
*
SELECT: archivekey archiveofs INTO CORRESPONDING FIELDS OF TABLE ITAB2
            FROM (tablename)
            WHERE (lt_cond).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;N L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2005 17:36:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-an-internal-table/m-p/917697#M58462</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-02T17:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Populating an internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-an-internal-table/m-p/917698#M58463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Natasha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the command INTO CORRESPONDING FIELDS OF TABLE ITAB2 to work the fields in teh ITAB2 have to be declared with the same name and datatype as the one you are selecting So your ITAB2 should be declared as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF ITAB2 OCCURS 0,      
      ARCHIVEKEY LIKE ZARIXFI3-ARCHIVEKEY,      
      ARCHIVEOFS LIKE ZARIXFI3-ARCHIVEOFS,
      END OF ITAB2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or if that is not possible you can modify your select to read &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT ARCHIVEKEY ARCHIVEOFS INTO (ITAB2-key, itab2-ofs)
       FROM (tablename)
       WHERE (lt_cond).
  if sy-subrc = 0 .
    append itab2 .
  endif.
ENDSELECT .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Either should work and populate the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2005 19:10:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-an-internal-table/m-p/917698#M58463</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-02T19:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Populating an internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-an-internal-table/m-p/917699#M58464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When using cooresponding fields, the internal table fields names should be the same as the table itself. Your data statement should be like this.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB2 OCCURS 0,&lt;/P&gt;&lt;P&gt;      ARCHIVEKEY LIKE ZARIXFI3-ARCHIVEKEY,&lt;/P&gt;&lt;P&gt;      ARCHIVEOFS LIKE ZARIXFI3-ARCHIVEOFS.&lt;/P&gt;&lt;P&gt;DATA: END OF ITAB2.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2005 19:14:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-an-internal-table/m-p/917699#M58464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-02T19:14:51Z</dc:date>
    </item>
  </channel>
</rss>

