<?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 Issue related to 'UPLOAD' function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975969#M949631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using 'UPLOAD' FM to upload a text file into the internal table from the presentation server. I have two  text files that exactly identical. The file layouts, strucutre are the same only the data is different. The interesting thing is the first file is getting uploaded into the internal table, while the second no data is coming through. I have thoroughly checked the two files, there is no difference in the two.TXT files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'UPLOAD'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Exporting &lt;/P&gt;&lt;P&gt;       filename  = 'C:\HOA_ABC.txt&lt;/P&gt;&lt;P&gt;       filetype = 'DAT'&lt;/P&gt;&lt;P&gt;Tables&lt;/P&gt;&lt;P&gt;   data_tab  = itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can be the reason for this? Is there a problem with 'UPLOAD" FM ?&lt;/P&gt;&lt;P&gt;I have used this FM quite often and works fine, I am unable to discover what might be wrong in the second file?&lt;/P&gt;&lt;P&gt;Let me know,&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2008 17:07:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-23T17:07:13Z</dc:date>
    <item>
      <title>Issue related to 'UPLOAD' function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975969#M949631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using 'UPLOAD' FM to upload a text file into the internal table from the presentation server. I have two  text files that exactly identical. The file layouts, strucutre are the same only the data is different. The interesting thing is the first file is getting uploaded into the internal table, while the second no data is coming through. I have thoroughly checked the two files, there is no difference in the two.TXT files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'UPLOAD'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Exporting &lt;/P&gt;&lt;P&gt;       filename  = 'C:\HOA_ABC.txt&lt;/P&gt;&lt;P&gt;       filetype = 'DAT'&lt;/P&gt;&lt;P&gt;Tables&lt;/P&gt;&lt;P&gt;   data_tab  = itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can be the reason for this? Is there a problem with 'UPLOAD" FM ?&lt;/P&gt;&lt;P&gt;I have used this FM quite often and works fine, I am unable to discover what might be wrong in the second file?&lt;/P&gt;&lt;P&gt;Let me know,&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 17:07:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975969#M949631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T17:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue related to 'UPLOAD' function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975970#M949632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;r U trying to upload the 2 files in the same prog?&lt;/P&gt;&lt;P&gt;If so, I suggest check clearing/ refreshing internal tables/ variables before the FM is used 2nd time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Raghu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 17:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975970#M949632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T17:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Issue related to 'UPLOAD' function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975971#M949633</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;Refresh itab data before you upload the second file ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e, &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REFRESH ITAB. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 17:11:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975971#M949633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T17:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issue related to 'UPLOAD' function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975972#M949634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinu,&lt;/P&gt;&lt;P&gt;Try using the FM "GUI_UPLOAD".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call function 'GUI_UPLOAD'
  exporting
    filename                      = filename
    filetype                      = filetype
    has_field_separator           = has_field_separator
    header_length                 = header_length
    read_by_line                  = read_by_line
    dat_mode                      = dat_mode
    codepage                      = codepage
    ignore_cerr                   = ignore_cerr
    replacement                   = replacement
    virus_scan_profile            = virus_scan_profile
  importing
    filelength                    = filelength
    header                        = header
  tables
    data_tab                      = data_tab
  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
    .

  if sy-subrc &amp;lt;&amp;gt; 0.
    case sy-subrc.
      when 1.
        raise file_open_error.
      when 2.
        raise file_read_error.
      when 3.
        raise no_batch.
      when 4.
        raise gui_refuse_filetransfer.
      when 5.
        raise invalid_type.
      when 6.
        raise no_authority.
      when 7.
        raise unknown_error.
      when 8.
        raise bad_data_format.
      when 9.
        raise header_not_allowed.
      when 10.
        raise separator_not_allowed.
      when 11.
        raise header_too_long.
      when 12.
        raise unknown_dp_error.
      when 13.
        raise access_denied.
      when 14.
        raise dp_out_of_memory.
      when 15.
        raise disk_full.
      when 16.
        raise dp_timeout.
      when others.
        raise unknown_error.
    endcase.
  endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;***************&lt;STRONG&gt;&amp;lt;removed_by_moderator&amp;gt;&lt;/STRONG&gt;*******************&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PS: I will start removing points from now onward...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Jun 23, 2008 11:01 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 17:14:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975972#M949634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T17:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue related to 'UPLOAD' function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975973#M949635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. I am uploading them one by one. Is the FM not very consistent one? I upload the first file that goes fine The second one comes up with this wierd stuff. Anyway going forward I believe should use GUI_UPLOAD that can take different formats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I shall take a look inot it. Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 17:30:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975973#M949635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T17:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Issue related to 'UPLOAD' function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975974#M949636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this sample code for gui_upload, you can have ASC.. BIN.. modes...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_filename_string
filetype = 'ASC'
has_field_separator = 'X'

    * HEADER_LENGTH = 0
    * READ_BY_LINE = 'X'

dat_mode = ''

    * IMPORTING
    * FILELENGTH =
    * HEADER =

TABLES
data_tab = i_text_data
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.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 23:32:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975974#M949636</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-06-23T23:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Issue related to 'UPLOAD' function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975975#M949637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the repsonse. I figured out the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2009 14:32:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-related-to-upload-function-module/m-p/3975975#M949637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-30T14:32:44Z</dc:date>
    </item>
  </channel>
</rss>

