<?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: Reg :  FUNCTION module 'WS_UPLOAD' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376537#M527019</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mallikarjun,&lt;/P&gt;&lt;P&gt;   Check what is the value of sy-subrc after the call to the FM.&lt;/P&gt;&lt;P&gt;It will tell you what is the exact problem.&lt;/P&gt;&lt;P&gt;eg: if you get sy-subrc = 4, then it means the table eidth is invalid.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jun 2007 20:52:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-04T20:52:55Z</dc:date>
    <item>
      <title>Reg :  FUNCTION module 'WS_UPLOAD'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376534#M527016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have program with internal table declared as below with 2 fields.&lt;/P&gt;&lt;P&gt;when i specify the input file using FILENAME = P_FILE.....&lt;/P&gt;&lt;P&gt;the input file has only one field values(i.e. only matnr values).&lt;/P&gt;&lt;P&gt;So, I am getting error : "unable to load input file".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so my query is Can i specify input file with only matnr values and download into internal table (ITAB_MATNR--which has 2 fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB_MATNR OCCURS 0,&lt;/P&gt;&lt;P&gt;MATNR LIKE MARA-MATNR,&lt;/P&gt;&lt;P&gt;COUNT TYPE I,&lt;/P&gt;&lt;P&gt;END OF ITAB_MATNR.&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;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = P_FILE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;filetype = ftype&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB_MATNR&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;GUI_REFUSE_FILETRANSFER = 8&lt;/P&gt;&lt;P&gt;OTHERS = 9.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE E699(PP) WITH 'Unable to load input file' P_FILE.&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vaja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 15:14:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376534#M527016</guid>
      <dc:creator>mallikarjun_vaja</dc:creator>
      <dc:date>2007-06-04T15:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :  FUNCTION module 'WS_UPLOAD'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376535#M527017</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;I think you miss file type and importing parameters. The ws_upload is look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Important Export Parameters:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CODEPAGE - Only for upload under DOS: Value IBM&lt;/P&gt;&lt;P&gt;FILENAME - Filename&lt;/P&gt;&lt;P&gt;FILETYPE - File type&lt;/P&gt;&lt;P&gt;Use the FILETYPE parameter to specify the transfer mode. Possible values:&lt;/P&gt;&lt;P&gt;  BIN&lt;/P&gt;&lt;P&gt;Binary files&lt;/P&gt;&lt;P&gt;  ASC&lt;/P&gt;&lt;P&gt;ASCII files: Text files with end of line markers.&lt;/P&gt;&lt;P&gt;  DAT&lt;/P&gt;&lt;P&gt;Excel files, saved as text files with columns separated by tabs and lines separated by&lt;/P&gt;&lt;P&gt;line breaks.&lt;/P&gt;&lt;P&gt;  WK1&lt;/P&gt;&lt;P&gt;Excel and Lotus files saved as WK1 spreadsheets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Export Parameters:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILELENGTH - Number of bytes transferred&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Tables Parameters:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA_TAB - Internal table (target for the import)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Exception Parameters:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_ERROR - Error converting data&lt;/P&gt;&lt;P&gt;FILE_OPEN_ERROR - Unable to open the file&lt;/P&gt;&lt;P&gt;FILE_READ_ERROR - Unable to read the file&lt;/P&gt;&lt;P&gt;INVALID_TABLE_WIDTH - Invalid table structure&lt;/P&gt;&lt;P&gt;INVALID_TYPE Value of FILETYPE parameter is incorrect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;Suppose the presentation server is running under Windows NT, and contains the&lt;/P&gt;&lt;P&gt;following text file:&lt;/P&gt;&lt;P&gt;"This file is text file, that is edited with the WINDOWS-notepad editor.  It serves to demonstrate how the function module WS_UPLOAD works".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code;&lt;/P&gt;&lt;P&gt;The following program reads the text file:&lt;/P&gt;&lt;P&gt;PROGRAM SAPMZTST.&lt;/P&gt;&lt;P&gt;DATA: FLENGTH TYPE I.&lt;/P&gt;&lt;P&gt;DATA: TAB(80) OCCURS 5 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;CODEPAGE = 'IBM'&lt;/P&gt;&lt;P&gt;FILENAME = 'd:\temp\mytext.txt'&lt;/P&gt;&lt;P&gt;FILETYPE = 'ASC'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;FILELENGTH = FLENGTH&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = TAB&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;WRITE: 'SY-SUBRC:', SY-SUBRC,&lt;/P&gt;&lt;P&gt;/ 'Length :', FLENGTH.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;LOOP AT TAB.&lt;/P&gt;&lt;P&gt;WRITE: / TAB.&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;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 16:07:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376535#M527017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-04T16:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :  FUNCTION module 'WS_UPLOAD'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376536#M527018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi baskar ,&lt;/P&gt;&lt;P&gt;thanks for ur reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the actual problem is : Iam using the FM 'WS_UPLOAD' with file name as export parameter and data should be populated into internal table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but iam getting error bcoz the internal table is declared with 2 fields.&lt;/P&gt;&lt;P&gt;and file(file from presentation server) iam using has only one field values i.e. MATNR values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so iam getting error.&lt;/P&gt;&lt;P&gt;even if u dont specify file type it takes default file type ASCII.&lt;/P&gt;&lt;P&gt;so my query is -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; i want to upload file with only single field values (MATNR values ) and data shold be populated into internal table which has 2 field fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vaja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 20:42:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376536#M527018</guid>
      <dc:creator>mallikarjun_vaja</dc:creator>
      <dc:date>2007-06-04T20:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :  FUNCTION module 'WS_UPLOAD'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376537#M527019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mallikarjun,&lt;/P&gt;&lt;P&gt;   Check what is the value of sy-subrc after the call to the FM.&lt;/P&gt;&lt;P&gt;It will tell you what is the exact problem.&lt;/P&gt;&lt;P&gt;eg: if you get sy-subrc = 4, then it means the table eidth is invalid.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 20:52:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376537#M527019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-04T20:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :  FUNCTION module 'WS_UPLOAD'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376538#M527020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can specify any number fields in file and any number fields in internal table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the program and when you specify the count variable in your internal table ,if the data is not available,then it will take some defualt values,other than this one it will be okay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my system count variable data is  538976288  if the file does not have value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB_MATNR OCCURS 0,&lt;/P&gt;&lt;P&gt;MATNR LIKE MARA-MATNR,&lt;/P&gt;&lt;P&gt;COUNT TYPE i,&lt;/P&gt;&lt;P&gt;END OF ITAB_MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : v_repid like sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters p_file like rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;initialization.&lt;/P&gt;&lt;P&gt;v_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   PROGRAM_NAME        = v_repid&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DYNPRO_NUMBER       = SYST-DYNNR&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FIELD_NAME          = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   FILE_NAME           = p_file&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;&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;refresh itab_matnr.&lt;/P&gt;&lt;P&gt;clear itab_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = P_FILE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;filetype = 'ASC'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB_MATNR&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;GUI_REFUSE_FILETRANSFER = 8&lt;/P&gt;&lt;P&gt;OTHERS = 9.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE E699(PP) WITH 'Unable to load input file' P_FILE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my file &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data is like ( No count)&lt;/P&gt;&lt;P&gt;matnr&lt;/P&gt;&lt;P&gt;12344&lt;/P&gt;&lt;P&gt;ssss&lt;/P&gt;&lt;P&gt;sddd&lt;/P&gt;&lt;P&gt;sddff&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after ws_upload :&lt;/P&gt;&lt;P&gt;material          count&lt;/P&gt;&lt;P&gt;12344             | 538976288                                             |&lt;/P&gt;&lt;P&gt;ssss               | 538976288                                             |&lt;/P&gt;&lt;P&gt;sddd               | 538976288                                             |&lt;/P&gt;&lt;P&gt;sddff               | 538976288&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 22:06:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-function-module-ws-upload/m-p/2376538#M527020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-04T22:06:08Z</dc:date>
    </item>
  </channel>
</rss>

