<?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 Error while uploading the file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895579#M54178</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 am trying to upload a file using GUI_UPLOAD... But sy-subrc 5 is raised which says that it's invalid type ... I have tried using both the DAT as well as the ASC in the filetype line... Can any one help whats wrong in program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Feb 2005 18:17:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-02-24T18:17:37Z</dc:date>
    <item>
      <title>Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895579#M54178</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 am trying to upload a file using GUI_UPLOAD... But sy-subrc 5 is raised which says that it's invalid type ... I have tried using both the DAT as well as the ASC in the filetype line... Can any one help whats wrong in program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 18:17:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895579#M54178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-24T18:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895580#M54179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the function module code,  the exception is raised two places....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* filetype parameter valid ?
  CASE filetype.
    WHEN 'BIN' OR 'ASC'.
    WHEN OTHERS.
      RAISE INVALID_TYPE.
  ENDCASE.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So then you can only use 'BIN' or 'ASC'.  &lt;/P&gt;&lt;P&gt;You said that you tried 'ASC', so then your exception has to be being raised from the second place which is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

    call function 'ITS_UPLOAD'
         EXPORTING
              codepage                = codepage
              filename                = tempfile
              filetype                = typ
              trunclen                = read_by_line
         IMPORTING
              filelength              = filelength
         TABLES
              data_tab                = data_tab
         EXCEPTIONS
              conversion_error        = 1
              file_read_error         = 2
              gui_refuse_filetransfer = 3
              others                  = 4.

    IF sy-subrc = 1.
      RAISE invalid_type.
    ELSEIF sy-subrc = 2.
      RAISE file_read_error.
    ELSEIF sy-subrc = 3.
      RAISE gui_refuse_filetransfer.
    ELSEIF sy-subrc = 4.
      RAISE unknown_error.
    ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I believe that this code is only executed when the interface is ITS.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post your code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 18:25:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895580#M54179</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-02-24T18:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895581#M54180</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;  It's now raising a dump ... &amp;amp; it says &lt;/P&gt;&lt;P&gt;Runtime errors         CALL_FUNCTION_CONFLICT_TYPE &lt;/P&gt;&lt;P&gt;Exception              CX_SY_DYN_CALL_ILLEGAL_TYPE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; my Code is as follows...&lt;/P&gt;&lt;P&gt;FORM FILE_UPLOAD .&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      FILENAME                      = P_FILE&lt;/P&gt;&lt;P&gt;      FILETYPE                      = 'DAT'&lt;/P&gt;&lt;P&gt;      HAS_FIELD_SEPARATOR           = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    HEADER_LENGTH                 = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    READ_BY_LINE                  = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    DAT_MODE                      = ' '&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;LI level="1" type="ul"&gt;&lt;P&gt;    HEADER                        =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      DATA_TAB                      = IT_INPUT&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      FILE_OPEN_ERROR               = 1&lt;/P&gt;&lt;P&gt;      FILE_READ_ERROR               = 2&lt;/P&gt;&lt;P&gt;      NO_BATCH                      = 3&lt;/P&gt;&lt;P&gt;      GUI_REFUSE_FILETRANSFER       = 4&lt;/P&gt;&lt;P&gt;      INVALID_TYPE                  = 5&lt;/P&gt;&lt;P&gt;      NO_AUTHORITY                  = 6&lt;/P&gt;&lt;P&gt;      UNKNOWN_ERROR                 = 7&lt;/P&gt;&lt;P&gt;      BAD_DATA_FORMAT               = 8&lt;/P&gt;&lt;P&gt;      HEADER_NOT_ALLOWED            = 9&lt;/P&gt;&lt;P&gt;      SEPARATOR_NOT_ALLOWED         = 10&lt;/P&gt;&lt;P&gt;      HEADER_TOO_LONG               = 11&lt;/P&gt;&lt;P&gt;      UNKNOWN_DP_ERROR              = 12&lt;/P&gt;&lt;P&gt;      ACCESS_DENIED                 = 13&lt;/P&gt;&lt;P&gt;      DP_OUT_OF_MEMORY              = 14&lt;/P&gt;&lt;P&gt;      DISK_FULL                     = 15&lt;/P&gt;&lt;P&gt;      DP_TIMEOUT                    = 16&lt;/P&gt;&lt;P&gt;      OTHERS                        = 17&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;    V_FLAG = 'X'.&lt;/P&gt;&lt;P&gt;    WRITE : 'Error while uploading the file'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " FILE_UPLOAD&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Seema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 18:49:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895581#M54180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-24T18:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895582#M54181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, for FILETYPE, you can only use "ASC" or "BIN".  Second make sure that your P_FILE is defined as type STRING.  If that doesn't work, then please post your data statement for IT_INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 18:52:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895582#M54181</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-02-24T18:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895583#M54182</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 have changed it to filetype 'ASC' still its giving dump ... giving the same message...&lt;/P&gt;&lt;P&gt;Runtime errors         CALL_FUNCTION_CONFLICT_TYPE&lt;/P&gt;&lt;P&gt;Exception              CX_SY_DYN_CALL_ILLEGAL_TYPE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; the input internal table that I have declared is as follows...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Internal table for the input data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF IT_INPUT OCCURS 0,&lt;/P&gt;&lt;P&gt;         GRCODE(2) TYPE C,&lt;/P&gt;&lt;P&gt;         GL(4)     TYPE C,&lt;/P&gt;&lt;P&gt;         GLSUF(5)  TYPE C,&lt;/P&gt;&lt;P&gt;         SUBAC(5)  TYPE C,&lt;/P&gt;&lt;P&gt;         CORSUF(3) TYPE C,&lt;/P&gt;&lt;P&gt;         LOCSUF(3) TYPE C,&lt;/P&gt;&lt;P&gt;         PROLIN(4) TYPE C,&lt;/P&gt;&lt;P&gt;       END OF IT_INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 18:59:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895583#M54182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-24T18:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895584#M54183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Seema!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about an extended program check. SAP will tell you, which fields have different definition in your program / in function module definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 19:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895584#M54183</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-02-24T19:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895585#M54184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, is your P_FILE as type STRING?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also,  use this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Types: BEGIN OF tIT_INPUT,
       GRCODE(2) TYPE C,
       GL(4) TYPE C,
       GLSUF(5) TYPE C,
       SUBAC(5) TYPE C,
       CORSUF(3) TYPE C,
       LOCSUF(3) TYPE C,
       PROLIN(4) TYPE C,
       END OF tIT_INPUT.

Data: it_input type table of tit_input.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should work then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 19:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895585#M54184</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-02-24T19:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895586#M54185</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 have decalred P_FILE as:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PARAMETERS : P_FILE LIKE RLGRAP-FILENAME.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 19:17:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895586#M54185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-24T19:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895587#M54186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, you need to pass the GUI_UPLOAD function a field of type STRING.  So, in your code.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Data: yourfile type string.

yourfile = p_file.

  call function 'GUI_UPLOAD'
    exporting
      filename                      = yourfile
*   FILETYPE                      = 'ASC'
*   HAS_FIELD_SEPARATOR           = ' '
*   HEADER_LENGTH                 = 0
*   READ_BY_LINE                  = 'X'
*   DAT_MODE                      = ' '
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
    tables
      data_tab                      = it_input
   exceptions
     file_open_error               = 1
     file_read_error               = 2
     no_batch                      = 3
     gui_refuse_filetransfer       = 4
     invalid_type                  = 5
     no_authority                  = 6
     unknown_error                 = 7
     bad_data_format               = 8
     header_not_allowed            = 9
     separator_not_allowed         = 10
     header_too_long               = 11
     unknown_dp_error              = 12
     access_denied                 = 13
     dp_out_of_memory              = 14
     disk_full                     = 15
     dp_timeout                    = 16
     others                        = 17.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 19:20:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895587#M54186</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-02-24T19:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error while uploading the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895588#M54187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I am able to upload the file ... (I checked it up in debug mode)....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx a lot...&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2005 19:29:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-uploading-the-file/m-p/895588#M54187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-24T19:29:12Z</dc:date>
    </item>
  </channel>
</rss>

