<?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: Problem in  GUI_UPLOAD in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182366#M757659</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;last statement sy-subrc, it should ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE e899(ZMSG) WITH 'File Open Error' sy-subrc.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it might be mistake, chekc it now and value of FILETYPE always capitals.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Dec 2007 14:32:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-21T14:32:12Z</dc:date>
    <item>
      <title>Problem in  GUI_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182361#M757654</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; i want to upload data from flat file ( notepad) to internal table and from there to database table. for that i have written the following code ,&lt;/P&gt;&lt;P&gt;But the data is not uploaded ,  instead it gives an error  5 i.e. 'INVALID type' (given in Exceptions of function module GUI_UPLOAD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the code is as below............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody  modify it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZSB_GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : ZSB_TAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_tab TYPE ZSB_TAB1.&lt;/P&gt;&lt;P&gt;DATA: i_tab TYPE STANDARD TABLE OF ZSB_TAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : v_subrc(2),&lt;/P&gt;&lt;P&gt;          v_recswritten(6).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_file(80)   DEFAULT 'C:\1\UPLOAD.TXT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: filename TYPE string,&lt;/P&gt;&lt;P&gt;       w_ans(1) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename = p_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'POPUP_TO_CONFIRM'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;    titlebar = 'Upload Confirmation'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DIAGNOSE_OBJECT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    text_question = 'upload ?'&lt;/P&gt;&lt;P&gt;    text_button_1 = 'yes'(001)&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ICON_BUTTON_1 = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    text_button_2 = 'NO'(002)&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ICON_BUTTON_2 = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    default_button = '2'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DISPLAY_CANCEL_BUTTON = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;USERDEFINED_F1_HELP = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START_COLUMN = 25&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START_ROW = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;POPUP_TYPE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IV_QUICKINFO_BUTTON_1 = 'YES'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IV_QUICKINFO_BUTTON_2 = 'NO'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;answer = w_ans&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PARAMETER =&lt;/P&gt;&lt;/LI&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;TEXT_NOT_FOUND = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 2&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;CHECK w_ans = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = filename&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;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 = i_tab&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SYST FIELDS ARE NOT SET BY THIS FUNCTION SO DISPLAY THE ERROR CODE *&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;P&gt;v_subrc = sy-subrc.&lt;/P&gt;&lt;P&gt;MESSAGE e899(ZMSG) WITH 'File Open Error' v_subrc.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT ZSB_TAB1 FROM TABLE i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMMIT WORK AND WAIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE i899(ZMSG) WITH sy-dbcnt 'Records Written to ZSB_TAB1'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 10:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182361#M757654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T10:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in  GUI_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182362#M757655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use File Type as &lt;STRONG&gt;'ASC'&lt;/STRONG&gt; instead of 'dat'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This solves your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 10:37:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182362#M757655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T10:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in  GUI_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182363#M757656</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;Remove the FILETYPE assignment line and execute.&lt;/P&gt;&lt;P&gt;Since you are uploading from notepad,its type is ASC and GUI_UPLOAD has the default type as ASC,hence you dont need to declare the filetype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Swaminathan PJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 10:45:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182363#M757656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T10:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in  GUI_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182364#M757657</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;file type should be ASC instead of dat in your below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = filename&lt;/P&gt;&lt;P&gt;FILETYPE = 'dat'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Siva kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 10:58:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182364#M757657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T10:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in  GUI_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182365#M757658</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 trued ur code just make the small modification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;      matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = 'D:\Book1.TXT'&lt;/P&gt;&lt;P&gt;FILETYPE = 'ASC'          "Change DAT to ASC&lt;/P&gt;&lt;P&gt;has_field_separator = 'X'   "Uncommented so that if the line is balnk it wont put #&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;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;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;data_tab = itab&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SYST FIELDS ARE NOT SET BY THIS FUNCTION SO DISPLAY THE ERROR CODE *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE e899(ZMSG) WITH 'File Open Error' sy-subrc.&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;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 14:21:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182365#M757658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T14:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in  GUI_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182366#M757659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;last statement sy-subrc, it should ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE e899(ZMSG) WITH 'File Open Error' sy-subrc.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it might be mistake, chekc it now and value of FILETYPE always capitals.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 14:32:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182366#M757659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T14:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in  GUI_UPLOAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182367#M757660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 13:11:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-gui-upload/m-p/3182367#M757660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-16T13:11:18Z</dc:date>
    </item>
  </channel>
</rss>

