<?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: File Upload in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762000#M1461835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use the sentences OPEN DATASET / READ DATASET / CLOSE DATASET instead of GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;The result is the same, an internal table with the file content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   open dataset '/dir/aa.txt' in text mode encoding default.   "Or binary mode&lt;/P&gt;&lt;P&gt;   if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;     do.&lt;/P&gt;&lt;P&gt;       read dataset '/dir/aa.txt' into w_structure.&lt;/P&gt;&lt;P&gt;       if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;         append w_structure to w_table.&lt;/P&gt;&lt;P&gt;       else.&lt;/P&gt;&lt;P&gt;         exit.&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;     enddo.&lt;/P&gt;&lt;P&gt;     close dataset  '/dir/aa.txt' .&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table w_table you have the file content, as with GUI_UPLOAD FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Differences between both, GUI_UPLOAD read file for local server (PC) and DATASET read file from aplication server (SAP SERVER). If you call the FM from another system, the program can't acces to the local PC.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Apr 2010 11:44:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-12T11:44:42Z</dc:date>
    <item>
      <title>File Upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6761997#M1461832</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 a BAPI and use GUI_UPLOAD FM to upload a file.But when I call this BAPI from a JAVA system, I facing a error because of GUI UPLOAD.So could you please suggest me ways other than GUI UPLOAD to upload a file(The uploading File can be of any type like ppt,doc,etc...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 09:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6761997#M1461832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-12T09:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: File Upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6761998#M1461833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GUI_UPLOAD FM can only be used in online mode. In background mode this FM fail because of the system tries to access to the local system (PC) and it is not accesible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read the file using the following sentences:&lt;/P&gt;&lt;P&gt;1.- open dataset (filename)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.- &lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;read dataset (filename) into (structure).&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;append (structure) to (table)&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;exit.   "End of file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.- close dataset (filename).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file must be in the aplication server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pepe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 10:52:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6761998#M1461833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-12T10:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: File Upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6761999#M1461834</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;Thanks for your quick reply.I am not using this function module GUI UPLOAD in a Background environment.I using this FM GUI UPLOAD  in a BAPI and this BAPI is called from a external system.Because of non availability of SAP GUI in the external system we are facing a problem when we use GUI UPLOAD.So could you please suggest me ways other that GUI UPLOAD to upload a file.Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 11:03:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6761999#M1461834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-12T11:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: File Upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762000#M1461835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use the sentences OPEN DATASET / READ DATASET / CLOSE DATASET instead of GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;The result is the same, an internal table with the file content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   open dataset '/dir/aa.txt' in text mode encoding default.   "Or binary mode&lt;/P&gt;&lt;P&gt;   if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;     do.&lt;/P&gt;&lt;P&gt;       read dataset '/dir/aa.txt' into w_structure.&lt;/P&gt;&lt;P&gt;       if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;         append w_structure to w_table.&lt;/P&gt;&lt;P&gt;       else.&lt;/P&gt;&lt;P&gt;         exit.&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;     enddo.&lt;/P&gt;&lt;P&gt;     close dataset  '/dir/aa.txt' .&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table w_table you have the file content, as with GUI_UPLOAD FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Differences between both, GUI_UPLOAD read file for local server (PC) and DATASET read file from aplication server (SAP SERVER). If you call the FM from another system, the program can't acces to the local PC.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 11:44:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762000#M1461835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-12T11:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: File Upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762001#M1461836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Use class CL_GUI_FRONTEND_SERVICES in that GUI_UPLOAD Method is there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Raghava Channooru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 11:59:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762001#M1461836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-12T11:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: File Upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762002#M1461837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use FM 'WS_UPLOAD' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg: PARAMETERS:  F_FILE LIKE RLGRAP-FILENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM UPLOAD_FILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      FILENAME                = F_FILE
      FILETYPE                = 'DAT'
    TABLES
      DATA_TAB                = INT_MAT
    EXCEPTIONS
      FILE_OPEN_ERROR         = 1
      FILE_WRITE_ERROR        = 2
      INVALID_FILESIZE        = 3
      INVALID_TYPE            = 4
      NO_BATCH                = 5
      UNKNOWN_ERROR           = 6
      INVALID_TABLE_WIDTH     = 7
      GUI_REFUSE_FILETRANSFER = 8
      CUSTOMER_ERROR          = 9
      OTHERS                  = 10.

  IF SY-SUBRC = 0.
    FORMAT COLOR COL_GROUP.
    WRITE:/ 'Data Upload Successfully from your local harddisk'.
    SKIP.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 12:25:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762002#M1461837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-12T12:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: File Upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762003#M1461838</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;The uploading File can be of any type like ppt,doc,etc...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GUI_UPLOAD can not upload .doc or .PPT files. For these file you can use OLE You can save the file as .txt and try it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Subhankar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Subhankar Garani on Apr 12, 2010 2:39 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 12:39:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload/m-p/6762003#M1461838</guid>
      <dc:creator>Subhankar</dc:creator>
      <dc:date>2010-04-12T12:39:25Z</dc:date>
    </item>
  </channel>
</rss>

