<?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: Creating an Internal table based on flat file data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008568#M1165940</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;Try to use GUI_Upload function module .. &lt;/P&gt;&lt;P&gt;hope it helps you ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Jan 2009 06:12:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-12T06:12:55Z</dc:date>
    <item>
      <title>Creating an Internal table based on flat file data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008567#M1165939</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 have a requirement where i need to create an internal table based on the data present in the flat file .&lt;/P&gt;&lt;P&gt;This flat file&lt;/P&gt;&lt;P&gt;1)  has the field names in the first row  and&lt;/P&gt;&lt;P&gt;2) has the values in the next rows&lt;/P&gt;&lt;P&gt;3) The field names in the flat file are not in the same order always . The order may change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create an internal table dynamically based on this flat file.&lt;/P&gt;&lt;P&gt;I have searched in SDN but unfortunately I did not find any solution that matches my requirement.&lt;/P&gt;&lt;P&gt;I even tried using field symbols in my program. &lt;/P&gt;&lt;P&gt;Can any one help me regarding this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt; Parvatha Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2009 05:28:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008567#M1165939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-12T05:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an Internal table based on flat file data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008568#M1165940</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;Try to use GUI_Upload function module .. &lt;/P&gt;&lt;P&gt;hope it helps you ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2009 06:12:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008568#M1165940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-12T06:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an Internal table based on flat file data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008569#M1165941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;once your flat file is ready ,then you can make use of upload or ws_upload to transfer data from flat file to the internal table.&lt;/P&gt;&lt;P&gt;then you should make use of BDCDATA structure to transfer the values of the fields to the transaction either through BATCH INPUT method or CALL TRANSACTION method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aakash Banga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2009 06:20:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008569#M1165941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-12T06:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an Internal table based on flat file data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008570#M1165942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use &lt;STRONG&gt;RTTI/RTTC&lt;/STRONG&gt; in order to create a dynamic itab based on the fieldnames in the first row (where are the technical details, e.g. field length???).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;References:&lt;/P&gt;&lt;P&gt;[Creating Flat and Complex Internal Tables Dynamically using RTTI|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/creating%2bflat%2band%2bcomplex%2binternal%2btables%2bdynamically%2busing%2brtti]&lt;/P&gt;&lt;P&gt;[An Insider's Guide to Writing Robust, Understandable, Maintainable State of the Art ABAP Programs, Part 3|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic itab having the structure described by the first row in the flat file&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Upload the flat file into an itab with line type = string&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Move data from unstructured string into structured itab&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the third step you can use the static method &lt;STRONG&gt;READ_CONTAINER_C&lt;/STRONG&gt; of class &lt;STRONG&gt;CL_ABAP_CONTAINER_UTILITIES&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2009 06:38:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008570#M1165942</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-01-12T06:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an Internal table based on flat file data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008571#M1165943</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 have mentioned that the field names in the flat file will not be the same each time .&lt;/P&gt;&lt;P&gt;They will keep  on changing . I do not think just gui_upload works in this case.&lt;/P&gt;&lt;P&gt;Need some additional code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2009 06:38:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008571#M1165943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-12T06:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an Internal table based on flat file data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008572#M1165944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Create one internal table which should reflect in field count which are there in flat file and also create one more internal table with single field with greater length which used to held the flat file records lines as rows.than get file into single field record.Loop the single field table and than using off set fill the corresponding fields of target table work area and append it.&lt;/P&gt;&lt;P&gt;let say WA is work area of target table and flat is the work area for single field table then use the technique give below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-pernr = flat-record+0(8).&lt;/P&gt;&lt;P&gt;wa-amount = flat-record+8(15).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appens wa to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this may help you .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Alok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2009 06:39:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008572#M1165944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-12T06:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an Internal table based on flat file data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008573#M1165945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Parvatha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : ty_excell_data TYPE kcde_cells.&lt;/P&gt;&lt;P&gt;DATA: it_excell_data TYPE STANDARD TABLE OF ty_excell_data.&lt;/P&gt;&lt;P&gt;           &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;gt;First you provide one parameter on selection screen from which you will access you flat file data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg: PARAMETERS: pr_fname LIKE rlgrap-filename OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;gt;   CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      program_name  = syst-cprog&lt;/P&gt;&lt;P&gt;      dynpro_number = syst-dynnr&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      file_name     = pr_fname.&lt;/P&gt;&lt;P&gt;3.&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Function module to capture the excel sheet data into internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                =   pr_fname&lt;/P&gt;&lt;P&gt;      i_begin_col             = c_begin_col&lt;/P&gt;&lt;P&gt;      i_begin_row             = c_begin_row&lt;/P&gt;&lt;P&gt;      i_end_col               = c_end_col&lt;/P&gt;&lt;P&gt;      i_end_row               = c_end_row&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      intern                  = it_excell_data&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      inconsistent_parameters = 1&lt;/P&gt;&lt;P&gt;      upload_ole              = 2&lt;/P&gt;&lt;P&gt;      OTHERS                  = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    message text-001 type 'E'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear it_excell_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope its enough for your understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fell free to ask me if you still get some problems&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a Nice Day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sujeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2009 06:52:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-an-internal-table-based-on-flat-file-data/m-p/5008573#M1165945</guid>
      <dc:creator>SujeetMishra</dc:creator>
      <dc:date>2009-01-12T06:52:46Z</dc:date>
    </item>
  </channel>
</rss>

