<?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: a question about function module--WS_UPLOAD in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857618#M927240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi gupta pullipudi   &lt;/P&gt;&lt;P&gt;I tried gui_upload, it seems the same as ws_upload.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 May 2008 09:03:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-19T09:03:39Z</dc:date>
    <item>
      <title>a question about function module--WS_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857615#M927237</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;when I tried to use function module--ws_upload to read data from a text file, I find it can only read max 18 bytes for a num column, for example, if the value is 111222333444555666777, but it can just get 111222333444555666, and missed 777, why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 08:27:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857615#M927237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T08:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: a question about function module--WS_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857616#M927238</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;that is the main disadvantage with the ws_upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u try with gui_upload function module to read the data from text file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward me if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 08:31:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857616#M927238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T08:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: a question about function module--WS_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857617#M927239</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;UPLOAD - File transfer with dialog from presentation server file to internal table. Data which is available in a file on the presentation server is transferred in an internal table. ASCII &amp;amp; Binary files can be transferred. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WS_UPLOAD - To read data from the presentation server into an internal table without a user dialog, use the function module WS_UPLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File Upload with ws_upload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current Release for article: 4.6b This article describes creating a workstation upload to SAP. The WS_UPLOAD function replaces the old GUI_UPLOAD. GUI_UPLOAD should no longer be used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upload a file from a workstation, or a "presentation server" as it is known in the SAP world, to an ABAP program is a relatively simple procedure requiring a call to the BAPI WS_UPLOAD. The BAPI processes the request and returns an internal table containing the uploaded file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's begin by defining the itab that will hold the input file from the workstation.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of plant occurs 200,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MATNR(18),&lt;/P&gt;&lt;P&gt;WERKS(4),&lt;/P&gt;&lt;P&gt;VKORG(4),&lt;/P&gt;&lt;P&gt;VTWEG(2),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.Next, lets define the input file name and tell the program to prompt for input:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: wsfile(132) lower case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternates for the parameters option: &lt;/P&gt;&lt;P&gt;One of the problems with the way we have defined the parameters is that the dialog box that is presented by SAP starts deep within the SAP libraries on the presentation server. Another is that the fully qualified filename can not exceed the 132 character limit. Most people will want to use a file on C:, on a Windows platform. Here's how to tell the dialog box to start in C:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: wsfile(132) default 'C:\input.txt' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Importing the raw pattern:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the ABAP editor click the Pattern button. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the interactive dialog (see image, right), enter the function name WS_UPLOAD. The pattern inserted is shown below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CODEPAGE = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILENAME = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILETYPE = 'ASC'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;HEADLEN = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LINE_EXIT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TRUNCLEN = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;USER_FORM = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;USER_PROG = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DAT_D_FORMAT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILELENGTH =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB =&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONVERSION_ERROR = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILE_OPEN_ERROR = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILE_READ_ERROR = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TYPE = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_BATCH = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNKNOWN_ERROR = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 7&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 8&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CUSTOMER_ERROR = 9&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 10&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you need in to call the function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME =wsfile&lt;/P&gt;&lt;P&gt;FILETYPE = 'DAT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = plant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_ERROR = 1&lt;/P&gt;&lt;P&gt;FILE_OPEN_ERROR = 2&lt;/P&gt;&lt;P&gt;FILE_READ_ERROR = 3&lt;/P&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 4&lt;/P&gt;&lt;P&gt;INVALID_TYPE = 5&lt;/P&gt;&lt;P&gt;NO_BATCH = 6&lt;/P&gt;&lt;P&gt;UNKNOWN_ERROR = 7&lt;/P&gt;&lt;P&gt;OTHERS = 8.&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;WRITE: / 'Error Uploading', wsfile, SY-SUBRC.&lt;/P&gt;&lt;P&gt;STOP.&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The call is very simple. The filename is the name of the variable that holds the user selection for the file on the presentation server. Filetype is a little tricky. There are a number of different values available, including &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ASC' (ASCII) &lt;/P&gt;&lt;P&gt;'DAT' (Tab-delimited data) &lt;/P&gt;&lt;P&gt;'IBM' (EBCDIC) &lt;/P&gt;&lt;P&gt;'BIN' (binary) &lt;/P&gt;&lt;P&gt;Check the function module documentation for a complete list of values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Datatab is the ITAB name created in the first step of this procedure. If the procedue completes normally, the upload information will be in this table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Return to ABAP help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 08:50:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857617#M927239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T08:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: a question about function module--WS_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857618#M927240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi gupta pullipudi   &lt;/P&gt;&lt;P&gt;I tried gui_upload, it seems the same as ws_upload.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 09:03:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857618#M927240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T09:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: a question about function module--WS_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857619#M927241</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;WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 09:10:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857619#M927241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T09:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: a question about function module--WS_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857620#M927242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Jagadish Raj Kumar Avidi&lt;/P&gt;&lt;P&gt;thank you for your detailed explanation, but I believe u missed my point,&lt;/P&gt;&lt;P&gt;I know how to use ws_upload,  but I am puzzled by why I can only read 18 bytes of a num value, and missed the left?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 01:41:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-about-function-module-ws-upload/m-p/3857620#M927242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T01:41:48Z</dc:date>
    </item>
  </channel>
</rss>

