<?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: invert table - columns per rows in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737617#M1301052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please search this forum with keyword "dynamic AND Internal AND table " you can find examples&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jun 2009 20:30:48 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2009-06-09T20:30:48Z</dc:date>
    <item>
      <title>invert table - columns per rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737616#M1301051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i do this.. i want to print the columns of a i-table as rows.. like inverting the table.. for example something like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              col1         col2      col3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;row1          1.00        2.00      3.00&lt;/P&gt;&lt;P&gt;row2          4.00        5.00      6.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;waht i want is to get this&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            row1      row2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;col1         1.00      4.00&lt;/P&gt;&lt;P&gt;col2         2.00      5.00&lt;/P&gt;&lt;P&gt;col3         3.00      6.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there like a function ?? or someone had have done this???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx in advanceee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 20:22:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737616#M1301051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T20:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: invert table - columns per rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737617#M1301052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please search this forum with keyword "dynamic AND Internal AND table " you can find examples&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 20:30:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737617#M1301052</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-06-09T20:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: invert table - columns per rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737618#M1301053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can try something like this.&lt;/P&gt;&lt;P&gt;Internal table itab_1 has 2 rows:&lt;/P&gt;&lt;P&gt;11    12&lt;/P&gt;&lt;P&gt;21    22&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab_2 will have inversed data as follows:&lt;/P&gt;&lt;P&gt;11    21&lt;/P&gt;&lt;P&gt;12    22&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF t_itab,
        fld1 TYPE i,
        fld2 TYPE i,
      END OF t_itab.
DATA: itab_1 TYPE t_itab OCCURS 0 WITH HEADER LINE,
       itab_2 TYPE t_itab OCCURS 0 WITH HEADER LINE.

DATA: v_counter TYPE i,
      v_index LIKE sy-index.
FIELD-SYMBOLS: &amp;lt;fs1&amp;gt; TYPE ANY,
               &amp;lt;fs2&amp;gt; TYPE ANY.
itab_1-fld1 = '11'.
itab_1-fld2 = '12'.
APPEND itab_1.
itab_1-fld1 = '21'.
itab_1-fld2 = '22'.
APPEND itab_1.

DESCRIBE TABLE itab_1 LINES v_counter.

DO v_counter TIMES.
  v_index = sy-index.
  LOOP AT itab_1.

    CASE v_index.
      WHEN '1'.
        ASSIGN COMPONENT sy-tabix OF STRUCTURE itab_2 TO &amp;lt;fs1&amp;gt;.
        MOVE itab_1-fld1 TO &amp;lt;fs1&amp;gt;.

      WHEN '2'.
        ASSIGN COMPONENT sy-tabix OF STRUCTURE itab_2 TO &amp;lt;fs2&amp;gt;.
        MOVE itab_1-fld2 TO &amp;lt;fs2&amp;gt;.
    ENDCASE.
  ENDLOOP.
  APPEND itab_2.
ENDDO.
&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 21:51:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737618#M1301053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T21:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: invert table - columns per rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737619#M1301054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thx Vikram for the answer but.. my internal table have a column for each day of the month .. so i have like a 30 columns and like 20 rows .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i take each column and append it to another table row??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 23:21:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737619#M1301054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T23:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: invert table - columns per rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737620#M1301055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well in case someone has the same problem, wat i did was a loop for the table as many columns it has, and passing the values with field symbols to the new table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do (columns) &lt;/P&gt;&lt;P&gt;loop table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2009 14:06:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invert-table-columns-per-rows/m-p/5737620#M1301055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-15T14:06:47Z</dc:date>
    </item>
  </channel>
</rss>

