<?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 Populating internal table , column wise in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-internal-table-column-wise/m-p/3383493#M812385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;   I have an important requirement regarding internal table population.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two internal tables. Both are being processed in a single loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB1 has 1 field. ITAB2 has 5 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB1                          ITAB2&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;                   -&lt;/P&gt;&lt;HR originaltext="----------------------------" /&gt;&lt;P&gt;Fld1                    F1    F2  F3  F4   F5&lt;/P&gt;&lt;P&gt;1      &lt;/P&gt;&lt;P&gt;2      &lt;/P&gt;&lt;P&gt;3      &lt;/P&gt;&lt;P&gt;4      &lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let's assume that in the first loop iteration, ITAB1 has 5 records as shown above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the same loop pass I want to populate ITAB2 column wise. That is after the first loop pass ITAB2 should look like something below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           ITAB2&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------" /&gt;&lt;P&gt;F1    F2    F3    F4    F5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1      &lt;/P&gt;&lt;P&gt;2      &lt;/P&gt;&lt;P&gt;3      &lt;/P&gt;&lt;P&gt;4      &lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the second loop pass I want to populate ITAB2-F2 ONLY and i  the third loop pass I want to populate ITAB2-F3 ONLY and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again assume that after the second loop pass ITAB1 has been populated again. And ITAB1 looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB1                          &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;                   &lt;/P&gt;&lt;P&gt;Fld1                    &lt;/P&gt;&lt;P&gt;11      &lt;/P&gt;&lt;P&gt;22     &lt;/P&gt;&lt;P&gt;33      &lt;/P&gt;&lt;P&gt;44      &lt;/P&gt;&lt;P&gt;55&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So after the second loop pass ITAB2 should look like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ITAB2&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------" /&gt;&lt;P&gt;F1    F2    F3    F4    F5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1      11      &lt;/P&gt;&lt;P&gt;2      22&lt;/P&gt;&lt;P&gt;3      33&lt;/P&gt;&lt;P&gt;4      44&lt;/P&gt;&lt;P&gt;5      55&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 5 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process ITB1..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process ITB2..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I go ahead with this development? Your helps will be highly appreciated with points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2008 18:46:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-07T18:46:27Z</dc:date>
    <item>
      <title>Populating internal table , column wise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-internal-table-column-wise/m-p/3383493#M812385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;   I have an important requirement regarding internal table population.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two internal tables. Both are being processed in a single loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB1 has 1 field. ITAB2 has 5 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB1                          ITAB2&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;                   -&lt;/P&gt;&lt;HR originaltext="----------------------------" /&gt;&lt;P&gt;Fld1                    F1    F2  F3  F4   F5&lt;/P&gt;&lt;P&gt;1      &lt;/P&gt;&lt;P&gt;2      &lt;/P&gt;&lt;P&gt;3      &lt;/P&gt;&lt;P&gt;4      &lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let's assume that in the first loop iteration, ITAB1 has 5 records as shown above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the same loop pass I want to populate ITAB2 column wise. That is after the first loop pass ITAB2 should look like something below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           ITAB2&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------" /&gt;&lt;P&gt;F1    F2    F3    F4    F5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1      &lt;/P&gt;&lt;P&gt;2      &lt;/P&gt;&lt;P&gt;3      &lt;/P&gt;&lt;P&gt;4      &lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the second loop pass I want to populate ITAB2-F2 ONLY and i  the third loop pass I want to populate ITAB2-F3 ONLY and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again assume that after the second loop pass ITAB1 has been populated again. And ITAB1 looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB1                          &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;                   &lt;/P&gt;&lt;P&gt;Fld1                    &lt;/P&gt;&lt;P&gt;11      &lt;/P&gt;&lt;P&gt;22     &lt;/P&gt;&lt;P&gt;33      &lt;/P&gt;&lt;P&gt;44      &lt;/P&gt;&lt;P&gt;55&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So after the second loop pass ITAB2 should look like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ITAB2&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------" /&gt;&lt;P&gt;F1    F2    F3    F4    F5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1      11      &lt;/P&gt;&lt;P&gt;2      22&lt;/P&gt;&lt;P&gt;3      33&lt;/P&gt;&lt;P&gt;4      44&lt;/P&gt;&lt;P&gt;5      55&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 5 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process ITB1..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process ITB2..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I go ahead with this development? Your helps will be highly appreciated with points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 18:46:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-internal-table-column-wise/m-p/3383493#M812385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T18:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Populating internal table , column wise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-internal-table-column-wise/m-p/3383494#M812386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
do 5 times.
var = sy-index.
Process ITB1..

Process ITB2..

enddo.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the process itb2 do something like this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at itab1.
case var.
when '1'.
move itab1-field to itab2-f1.
append itab2.
when '2'.
move itab1-field to itab2-f2.
modify itab2 index sy-tabix transporting f2.
when '3'.
move itab1-field to itab2-f3.
modify itab2 index sy-tabix transporting f3.
when '4'.
move itab1-field to itab2-f4.
modify itab2 index sy-tabix transporting f4.
when '5'.
move itab1-field to itab2-f5.
modify itab2 index sy-tabix transporting f5.
endcase.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps, didn't test it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ramiro Escamilla on Feb 7, 2008 9:07 PM&lt;/P&gt;&lt;P&gt;Minor changes, hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 19:00:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-internal-table-column-wise/m-p/3383494#M812386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T19:00:10Z</dc:date>
    </item>
  </channel>
</rss>

