<?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: Where does GUI_UPLOAD function store the files? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903881#M55727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Audrey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of accessing files from application server:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset w_file for input in text mode.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    message e895 with 'Unable to locate file'.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    do.&lt;/P&gt;&lt;P&gt;      read dataset w_file into it_data. &lt;/P&gt;&lt;P&gt;      if sy-subrc eq 4.            " End of file reached&lt;/P&gt;&lt;P&gt;        clear it_data.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        append it_data.&lt;/P&gt;&lt;P&gt;        clear it_data.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    enddo.&lt;/P&gt;&lt;P&gt;    close dataset w_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example, w_file is declared as string containing  c:\usr\sap\test.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this file should be there on this path on application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, yes, you need to declare it_data as an internal table containing fields corresponding to file from which you are reading data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashish Jain&lt;/P&gt;&lt;P&gt;ashishjain@ko-india.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Apr 2005 11:33:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-04-28T11:33:54Z</dc:date>
    <item>
      <title>Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903873#M55719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where does GUI_UPLOAD function store the files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 20:25:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903873#M55719</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-27T20:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903874#M55720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The content of the file being uploaded is transfered from memory of the frontend device (via the SAPGui), accross the network to your application server.  There it resides in ABAP memory as an internal table (which you supply as a parameter to the GUI_UPLOAD Function).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore the content never persists anywhere unless the calling application stores it somehow.  Otherwise it has the same lifespan as any other internal table in your ABAP application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 20:39:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903874#M55720</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2005-04-27T20:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903875#M55721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for clarifying that that GUI_UPLOAD uploads files from the frontend device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My files are already on the server, so I can't use GUI_UPLOAD.  But I need those files in an internal table like how GUI_UPLOAD does (output of data_tab).  I need the files in an interal table because I eventually call the function module RSOD_DOC_MAST_CHANGE which uses the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another function similar to GUI_UPLOAD but instead uploads files from the server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR, how can I manually put the files in an internal table?  To do this I would need to know the structure of data_tab (the file produced by GUI_UPLOAD).  Does anyone know the structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!!! I'm in desperate need of help!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 20:48:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903875#M55721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-27T20:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903876#M55722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you want are the abap key words open dataset and read dataset.  These commands will read a file from the application server.  The following is a simple example from a 46C system:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
function z_e_read_from_file.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(FILENAME1)
*"  TABLES
*"      ITAB1
*"----------------------------------------------------------------------

**** Open the Input file
  open dataset filename1 for input in text mode message message_text.

**** Test that the open was successful
  if sy-subrc = 8.
    message x013 with filename1 message_text.
  endif.

****Read the input file into internal memory
  while sy-subrc = 0.
    read dataset filename1 into itab1.
    if sy-subrc ne 0.
      if sy-subrc ne 4.   "End of file
        message x015 with filename1.
      endif.
    endif.
    append itab1.
  endwhile.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 21:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903876#M55722</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2005-04-27T21:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903877#M55723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THANK YOU!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying out the code now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a new ABAP programmer so my next question is going to sound dumb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  How do I declare itab1 as an internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 21:28:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903877#M55723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-27T21:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903878#M55724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well it depends upon what kind of structure you need itab1 to have.  In its simplest form you might do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab1 type table of string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you would have an internal table of strings. But you knew you were going to pass this internal table to a SAP function module. You probably want your internal table to match the type it is expecting.  I would have a look at the definition of that function module.  Also the on-line help does have a nice syntax layout for internal tables.  There are many different options on the type of internal table created (with/without header lines, sorted, hash, standard, etc).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 21:36:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903878#M55724</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2005-04-27T21:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903879#M55725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yet another question from me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added the declaration statement for itab1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I get a syntax error on this statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  read dataset filename into itab1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax error i get is... "ITAB1 cannot be a table, a reference, a string, or contain any of these objects"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesn't make any sense to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLEASE HELP!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 21:54:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903879#M55725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-27T21:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903880#M55726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's probably my fault. I gave you a read example that had a table with a header line, but a table declaration without one.  Try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: itab1 type table of string.
data: wa_itab1 like line of itab.

 while sy-subrc = 0.
    read dataset filename1 into wa_itab1.
    if sy-subrc ne 0.
      if sy-subrc ne 4.   "End of file
        message x015 with filename1.
      endif.
    endif.
    append wa_itab1 to itab1.
  endwhile.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm afraid I am coding from memory and not at a system right now. Hopefully this will work a little better (I'm questioning my append statement - it doesn't look quite right. You might check this in the online help if it isn't right.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 22:56:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903880#M55726</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2005-04-27T22:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Where does GUI_UPLOAD function store the files?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903881#M55727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Audrey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of accessing files from application server:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset w_file for input in text mode.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    message e895 with 'Unable to locate file'.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    do.&lt;/P&gt;&lt;P&gt;      read dataset w_file into it_data. &lt;/P&gt;&lt;P&gt;      if sy-subrc eq 4.            " End of file reached&lt;/P&gt;&lt;P&gt;        clear it_data.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        append it_data.&lt;/P&gt;&lt;P&gt;        clear it_data.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    enddo.&lt;/P&gt;&lt;P&gt;    close dataset w_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example, w_file is declared as string containing  c:\usr\sap\test.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this file should be there on this path on application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, yes, you need to declare it_data as an internal table containing fields corresponding to file from which you are reading data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashish Jain&lt;/P&gt;&lt;P&gt;ashishjain@ko-india.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2005 11:33:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-does-gui-upload-function-store-the-files/m-p/903881#M55727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-28T11:33:54Z</dc:date>
    </item>
  </channel>
</rss>

