<?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: Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395294#M1044987</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi saravannan .,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The requirement is Tricky ,&lt;/P&gt;&lt;P&gt; To get it done first the internal table Number of fileds should be equal to Number of Records Records .&lt;/P&gt;&lt;P&gt; and All Fields are of same Data type . By using RowID and ColumnID Variables u can Achive .&lt;/P&gt;&lt;P&gt;   But in ABAP u dont get such Scinario where swaping of Rows and Columns .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; thanks&lt;/P&gt;&lt;P&gt; Sreenivas Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Aug 2008 04:48:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-19T04:48:06Z</dc:date>
    <item>
      <title>Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395292#M1044985</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;I have doubt in Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently my internal table data in vertical format.&lt;/P&gt;&lt;P&gt;I need to convert that same data into horizontal format.&lt;/P&gt;&lt;P&gt;I have given a example of my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1 &lt;/P&gt;&lt;P&gt;abc 001 777&lt;/P&gt;&lt;P&gt;abd 002 888&lt;/P&gt;&lt;P&gt;abe 003 999&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to change that internal table data into this format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab2&lt;/P&gt;&lt;P&gt;abc abd abe&lt;/P&gt;&lt;P&gt;001 002 003&lt;/P&gt;&lt;P&gt;777 888 999&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advanced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;mrsara27...,.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 04:38:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395292#M1044985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T04:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395293#M1044986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can display the data in the horizontal format but you cannot fill data inside an internal table in the format you have prescribed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We should have only one type of data into one column and here each column of yours is having a different type of data.&lt;/P&gt;&lt;P&gt;That is not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 04:43:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395293#M1044986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T04:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395294#M1044987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi saravannan .,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The requirement is Tricky ,&lt;/P&gt;&lt;P&gt; To get it done first the internal table Number of fileds should be equal to Number of Records Records .&lt;/P&gt;&lt;P&gt; and All Fields are of same Data type . By using RowID and ColumnID Variables u can Achive .&lt;/P&gt;&lt;P&gt;   But in ABAP u dont get such Scinario where swaping of Rows and Columns .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; thanks&lt;/P&gt;&lt;P&gt; Sreenivas Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 04:48:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395294#M1044987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T04:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395295#M1044988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This thread might help:&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3089362"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 04:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395295#M1044988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T04:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395296#M1044989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use OOABAP to solve your problem... But Iam not sure about that mathos names...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried in normal ABAP, But it causes performance reduce...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of itab occurs 0,
       f1(3), f2(3), f3(3),
      end of itab.

itab-f1 = 'abc'.
itab-f2 = '001'.
itab-f3 = '777'.
append itab.
clear itab.

itab-f1 = 'abd'.
itab-f2 = '002'.
itab-f3 = '888'.
append itab.
clear itab.

itab-f1 = 'abe'.
itab-f2 = '003'.
itab-f3 = '999'.
append itab.
clear itab.

loop at itab.
write: itab-f1.
endloop.
skip 1.
loop at itab.
write: itab-f2.
endloop.
skip 1.
loop at itab.
write: itab-f3.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At last....Get back with your solution.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen.I&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 05:06:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395296#M1044989</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2008-08-19T05:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395297#M1044990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   I hope this psudo code would help your cause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say internal table &lt;STRONG&gt;itab1&lt;/STRONG&gt; is the internal table with the contents which you want ot transpose into table &lt;STRONG&gt;itab2&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here itab1 and itab2 are internal tables with header lines with 3 columns f1,f2 and f3 all of character type and of same length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa1 type itab1,&lt;/P&gt;&lt;P&gt;        wa2 type itab1,&lt;/P&gt;&lt;P&gt;        wa3 type itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i1 type i.&lt;/P&gt;&lt;P&gt;describe table itab1 to i1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to wa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to wa2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to wa3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d0 i1 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table itab2 with index sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case sy-index.&lt;/P&gt;&lt;P&gt;when 1.&lt;/P&gt;&lt;P&gt;itab2-f1 = wa1-f1.&lt;/P&gt;&lt;P&gt;itab2-f2 = wa2-f1.&lt;/P&gt;&lt;P&gt;itab2-f3 = wa3-f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 2.&lt;/P&gt;&lt;P&gt;itab2-f1 = wa1-f2.&lt;/P&gt;&lt;P&gt;itab2-f2 = wa2-f2.&lt;/P&gt;&lt;P&gt;itab2-f3 = wa3-f2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 3.&lt;/P&gt;&lt;P&gt;itab2-f1 = wa1-f3.&lt;/P&gt;&lt;P&gt;itab2-f2 = wa2-f3.&lt;/P&gt;&lt;P&gt;itab2-f3 = wa3-f3.&lt;/P&gt;&lt;P&gt;Modify itab2 with corresponding index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 05:09:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395297#M1044990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T05:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395298#M1044991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can go for CASE ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 1.&lt;/P&gt;&lt;P&gt;  fill field1 of itab2.&lt;/P&gt;&lt;P&gt;WHEN 2.&lt;/P&gt;&lt;P&gt;  fill field2 of itab2.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can refer to the code below. I am transferring data from T_COSP to T_REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
     LOOP AT t_cosp INTO fs_cosp.

       IF fs_cosp-objnr CS fs_mat_quan-werks.

         fs_report-twaer = fs_cosp-twaer.

         CASE fs_cosp-kstar.

           WHEN c_kstar0.
             w_cost = fs_cosp-wkgtot / w_lfimg.

             w_cost = w_cost + fs_report-thru.

             fs_report-thru  = w_cost.
             CLEAR w_cost.

             w_index = w_index + 1.
             MODIFY t_report FROM fs_report
                            INDEX w_count
                     TRANSPORTING thru.

           WHEN c_kstar1.
             w_cost = fs_cosp-wkgtot / w_lfimg.

             w_cost = w_cost + fs_report-steam.

             fs_report-steam = w_cost.
             CLEAR w_cost.

             w_index = w_index + 1.
             MODIFY t_report FROM fs_report
                            INDEX w_count
                     TRANSPORTING steam.

           WHEN c_kstar3.
             w_cost = fs_cosp-wkgtot / w_lfimg.

             w_cost = w_cost + fs_report-demur.

             fs_report-demur = w_cost.
             CLEAR w_cost.

             w_index = w_index + 1.
             MODIFY t_report FROM fs_report
                            INDEX w_count
                     TRANSPORTING demur.

           WHEN c_kstar4.
             w_cost = fs_cosp-wkgtot / w_lfimg.

             w_cost = w_cost + fs_report-time.

             fs_report-time  = w_cost.
             CLEAR w_cost.

             w_index = w_index + 1.
             MODIFY t_report FROM fs_report
                            INDEX w_count
                     TRANSPORTING time.

           WHEN c_kstar5.
             w_cost = fs_cosp-wkgtot / w_lfimg.

             w_cost = w_cost + fs_report-test.

             fs_report-test  = w_cost.
             CLEAR w_cost.

             w_index = w_index + 1.
             MODIFY t_report FROM fs_report
                            INDEX w_count
                     TRANSPORTING test.

           WHEN c_kstar6.
             w_cost = fs_cosp-wkgtot / w_lfimg.

             w_cost = w_cost + fs_report-start.

             fs_report-start = w_cost.
             CLEAR w_cost.

             w_index = w_index + 1.
             MODIFY t_report FROM fs_report
                            INDEX w_count
                     TRANSPORTING start.


         ENDCASE.                       " CASE fs_cosp-kstar


         AT END OF objnr.

* To modify the report table with obtained data
           PERFORM modify_report_table.
           EXIT.

         ENDAT.

       ENDIF.                           " IF fs_cosp-objnr CS...

     ENDLOOP.                           " LOOP t_cosp

*---------------------------------------------------------------------*
*  FORM  MODIFY_REPORT_TABLE                                          *
*---------------------------------------------------------------------*
*  This subroutine modifies the report table with necessary data      *
*---------------------------------------------------------------------*
*  There are no interface parameters to be passed to this subroutine. *
*---------------------------------------------------------------------*
 FORM modify_report_table .

   fs_report-total = fs_report-steam +
                     fs_report-demur +
                     fs_report-start +
                     fs_report-test  +
                     fs_report-time  +
                     fs_report-thru.

   MODIFY t_report FROM fs_report
                  INDEX w_count
           TRANSPORTING total
                        twaer.


   DELETE t_cosp TO w_index.
   CLEAR  w_index.

 ENDFORM.                               " MODIFY_REPORT_TABLE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structures of T_COSP and T_REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*"--------------------------------------------------------------------*
* Declaration of the structure for holding Cost Totals                *
*"--------------------------------------------------------------------*
 DATA:
   BEGIN OF fs_cosp,
     lednr  TYPE cosp-lednr,            " Ledger for Controlling
                                        " objects
     objnr  TYPE cosp-objnr,            " Object number
     gjahr  TYPE cosp-gjahr,            " Fiscal year
     wrttp  TYPE cosp-wrttp,            " Value type
     versn  TYPE cosp-versn,            " Version
     kstar  TYPE cosp-kstar,            " Cost element
     hrkft  TYPE cosp-hrkft,            " CO key subnumber
     vrgng  TYPE cosp-vrgng,            " CO Business Transaction
     vbund  TYPE cosp-vbund,            " Company ID: Trading Partner
     pargb  TYPE cosp-pargb,            " Trading Partner's
                                        " Business Area
     beknz  TYPE cosp-beknz,            " Debit/credit indicator
     twaer  TYPE cosp-twaer,            " Transaction Currency
     perbl  TYPE cosp-perbl,            " Period block
     wkg001 TYPE cosp-wkg001,           " Cost total for period 1
     wkg002 TYPE cosp-wkg002,           " Cost total for period 2
     wkg003 TYPE cosp-wkg003,           " Cost total for period 3
     wkg004 TYPE cosp-wkg004,           " Cost total for period 4
     wkg005 TYPE cosp-wkg005,           " Cost total for period 5
     wkg006 TYPE cosp-wkg006,           " Cost total for period 6
     wkg007 TYPE cosp-wkg007,           " Cost total for period 7
     wkg008 TYPE cosp-wkg008,           " Cost total for period 8
     wkg009 TYPE cosp-wkg009,           " Cost total for period 9
     wkg010 TYPE cosp-wkg010,           " Cost total for period 10
     wkg011 TYPE cosp-wkg011,           " Cost total for period 11
     wkg012 TYPE cosp-wkg012,           " Cost total for period 12
     wkgtot TYPE cosp-wkg001,           " Cost total for all periods
   END OF fs_cosp.

*"--------------------------------------------------------------------*
* Declaration of the structure for holding Report output data         *
*"--------------------------------------------------------------------*
 DATA:
   BEGIN OF fs_report,
     werks TYPE lips-werks,             " Plant number
     name1 TYPE t001w-name1,            " Plant name
     steam TYPE cosp-wkg001,            " Steaming expenses
     demur TYPE cosp-wkg001,            " Demurrage expenses
     start TYPE cosp-wkg001,            " 1 time startup expenses
     test  TYPE cosp-wkg001,            " Testing expenses
     time  TYPE cosp-wkg001,            " Over time expenses
     thru  TYPE cosp-wkg001,            " Thru-put expenses
     total TYPE cosp-wkg001,            " Total expenses
     twaer TYPE cosp-twaer,             " Transaction Currency
     lfimg TYPE lips-lfimg,             " Actual delivered quantity
   END OF fs_report.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 05:17:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/4395298#M1044991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T05:17:26Z</dc:date>
    </item>
  </channel>
</rss>

