<?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/3056054#M723811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot create different different structures for the rows in the internal table. You can create 2 nested internal tables in the one main table. But it will not solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using same Internal table, Create two different table.&lt;/P&gt;&lt;P&gt;Upload your file into first internal table which has the same structure as the EXCEL file.&lt;/P&gt;&lt;P&gt;APPEND another table, which has a different structure, from the first table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;P&gt;UPLOAD FILE  TO ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;  MOVE ITAB1 TO ITAB2.&lt;/P&gt;&lt;P&gt;  APPEND ITAB2.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOu can use one of the field as the unique key which can relate both tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Dec 2007 23:53:09 GMT</pubDate>
    <dc:creator>naimesh_patel</dc:creator>
    <dc:date>2007-12-04T23:53:09Z</dc:date>
    <item>
      <title>Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056053#M723810</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 a doubt in building an internal table.&lt;/P&gt;&lt;P&gt;The scenario, is am getting an excel sheet with records.&lt;/P&gt;&lt;P&gt;I have to convert this excel format into one of sap format where the internal table should have two different structures.&lt;/P&gt;&lt;P&gt;Say for example, i read the 1st record from the excel, but i need to build an internal table with 2 structures i.e 2 line items now.&lt;/P&gt;&lt;P&gt;Convert single record from excel to 2 records in itab and each of these lines have differnent structures.&lt;/P&gt;&lt;P&gt;Hope am clear!!&lt;/P&gt;&lt;P&gt;Please help me in this&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2007 23:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056053#M723810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-04T23:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056054#M723811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot create different different structures for the rows in the internal table. You can create 2 nested internal tables in the one main table. But it will not solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using same Internal table, Create two different table.&lt;/P&gt;&lt;P&gt;Upload your file into first internal table which has the same structure as the EXCEL file.&lt;/P&gt;&lt;P&gt;APPEND another table, which has a different structure, from the first table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;P&gt;UPLOAD FILE  TO ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;  MOVE ITAB1 TO ITAB2.&lt;/P&gt;&lt;P&gt;  APPEND ITAB2.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOu can use one of the field as the unique key which can relate both tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2007 23:53:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056054#M723811</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2007-12-04T23:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056055#M723812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey thanks patel,&lt;/P&gt;&lt;P&gt;I am doing the same. But the scenario is as follwos:&lt;/P&gt;&lt;P&gt;I have itab1 same as excel format and uploading into it. This works perfect.&lt;/P&gt;&lt;P&gt;Now i want to move these contents to another internal table itab2.&lt;/P&gt;&lt;P&gt;Itab2 should have 2 strcutures Check_head and check_rec.&lt;/P&gt;&lt;P&gt;So i have to split the header record and check record from itab1 and put as two  line items in the same table itab2.&lt;/P&gt;&lt;P&gt;how do i do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2007 23:57:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056055#M723812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-04T23:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056056#M723813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of itab2 occurs 0,
      ind,
*     header field
      fld1(10),
*     rec field
      fld2(10),
      end   of itab2.
      
loop at itab.
  if header = 'X'.
    itab2-ind = 'H'.
    itab2-head = itab-head
    append itb2.
  else.
    itba2-ind = 'R'.
    itab2-head = itab-head
    append itb2.
  endif.
endloop. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 00:12:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056056#M723813</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2007-12-05T00:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056057#M723814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Declare an internal table like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs0,&lt;/P&gt;&lt;P&gt;data(500),&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;upload the data of the excel into this flat type internal table using GUI_UPLOAD etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab-data.&lt;/P&gt;&lt;P&gt;if &amp;lt;cond1&amp;gt;.&lt;/P&gt;&lt;P&gt;split itab-data at CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB into itab1-field1&lt;/P&gt;&lt;P&gt;itab1-field2 itab1-field3 itab1-field4....&lt;/P&gt;&lt;P&gt;append itab1.&lt;/P&gt;&lt;P&gt;clear itab1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &amp;lt;cond2&amp;gt;.&lt;/P&gt;&lt;P&gt;split itab-data at CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB into itab2-field1&lt;/P&gt;&lt;P&gt;itab2-field2 itab2-field3 itab2-field4....&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;clear itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi Kanth Talagana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 01:55:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056057#M723814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T01:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056058#M723815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I resolved by ownself.&lt;/P&gt;&lt;P&gt;Declared an Internla table with a variable type string and using offset concept we can manage any kind of structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF IT_CHECK_HEAD OCCURS 0,&lt;/P&gt;&lt;P&gt;      VALUE(255) TYPE C,&lt;/P&gt;&lt;P&gt;      END OF IT_CHECK_HEAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT IT_TAB.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'CONVERSION_EXIT_PDATE_INPUT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        INPUT  = IT_TAB-DATE&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        OUTPUT = DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+0(1) = '1'.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+19(15) = IT_TAB-BANKID.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+34(18) = IT_TAB-ACCNO.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+55(8) = DATE.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+63(3) = IT_TAB-CURR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comments:  upload the data into an itab from tabdelimited file and push into it_check_head internal table using offset concept. so it_check_head has no of line items with each one of them having our own desined structures. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT IT_TAB.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'CONVERSION_EXIT_PDATE_INPUT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        INPUT  = IT_TAB-DATE&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        OUTPUT = DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+0(1) = '1'.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+19(15) = IT_TAB-BANKID.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+34(18) = IT_TAB-ACCNO.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+55(8) = DATE.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+63(3) = IT_TAB-CURR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW BANKID.&lt;/P&gt;&lt;P&gt;      IF NOT IT_CHECK_HEAD-VALUE IS INITIAL.&lt;/P&gt;&lt;P&gt;        APPEND IT_CHECK_HEAD.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;    CLEAR IT_CHECK_HEAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+0(1) = '5'.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+1(8) = DATE.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+9(13) =  IT_TAB-CKNUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    REPLACE ALL OCCURRENCES OF ',' IN IT_TAB-AMT WITH ''.&lt;/P&gt;&lt;P&gt;    IT_TAB-AMT = IT_TAB-AMT * 100.&lt;/P&gt;&lt;P&gt;    CONDENSE IT_TAB-AMT.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+22(11) = IT_TAB-AMT.&lt;/P&gt;&lt;P&gt;    IT_CHECK_HEAD-VALUE+58(8) = DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND IT_CHECK_HEAD.&lt;/P&gt;&lt;P&gt;    CLEAR IT_CHECK_HEAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 22:27:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3056058#M723815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T22:27:59Z</dc:date>
    </item>
  </channel>
</rss>

