<?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 the code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-code/m-p/1534448#M243938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ravi,&lt;/P&gt;&lt;P&gt;  Try this way ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ifile type standard table of char256.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Aug 2006 11:05:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-21T11:05:06Z</dc:date>
    <item>
      <title>Problem in the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-code/m-p/1534447#M243937</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;See the following code.I am getting list of files in the table ifile.But when i use CALL METHOD cl_gui_frontend_services=&amp;gt;gui_upload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting sy-subrc = 19.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any body tell me what may be the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ifile type table of  file_info.&lt;/P&gt;&lt;P&gt;data: wa_file like line of ifile.&lt;/P&gt;&lt;P&gt;data: xfile type string.&lt;/P&gt;&lt;P&gt;data: xcount type i.&lt;/P&gt;&lt;P&gt;data: l_xml_table_size TYPE i.&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_xml_line, "Structure for holding XML data&lt;/P&gt;&lt;P&gt;data(256) TYPE x,&lt;/P&gt;&lt;P&gt;END OF t_xml_line.&lt;/P&gt;&lt;P&gt;DATA: l_filename type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_xml_table TYPE TABLE OF t_xml_line. " XML Table of the structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_gui_frontend_services=&amp;gt;directory_list_files&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    directory                   = 'D:\'&lt;/P&gt;&lt;P&gt;    FILTER                      = '*.XML'&lt;/P&gt;&lt;P&gt;     FILES_ONLY                  = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   DIRECTORIES_ONLY            =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  changing&lt;/P&gt;&lt;P&gt;    file_table                  = ifile&lt;/P&gt;&lt;P&gt;    count                       = xcount&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    cntl_error                  = 1&lt;/P&gt;&lt;P&gt;    directory_list_files_failed = 2&lt;/P&gt;&lt;P&gt;    wrong_parameter             = 3&lt;/P&gt;&lt;P&gt;    error_no_gui                = 4&lt;/P&gt;&lt;P&gt;    others                      = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*loop at ifile .&lt;/P&gt;&lt;P&gt;  write:/ 'ifile'.&lt;/P&gt;&lt;P&gt;*endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at ifile into wa_file.&lt;/P&gt;&lt;P&gt;  l_filename = wa_file-filename.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Upload file from the client's workstation&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD cl_gui_frontend_services=&amp;gt;gui_upload&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;      filename   = l_filename&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        filetype   = 'BIN'&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        filelength = l_xml_table_size&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        data_tab   = l_xml_table&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        OTHERS     = 19.&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;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Aug 2006 10:59:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-code/m-p/1534447#M243937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-21T10:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-code/m-p/1534448#M243938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ravi,&lt;/P&gt;&lt;P&gt;  Try this way ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ifile type standard table of char256.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Aug 2006 11:05:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-code/m-p/1534448#M243938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-21T11:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-code/m-p/1534449#M243939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please concatenate the file path with your file name before you call the upload method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ifile into wa_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="18" type="ul"&gt;&lt;P&gt;New line ******************&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;concatenate 'D:\' wa_file-filename into l_filename.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="18" type="ul"&gt;&lt;P&gt;New line ******************&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Upload file from the client's workstation&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL METHOD cl_gui_frontend_services=&amp;gt;gui_upload&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = l_filename&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filetype = 'BIN'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;filelength = l_xml_table_size&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;data_tab = l_xml_table&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 19.&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;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if found useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Aug 2006 11:12:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-code/m-p/1534449#M243939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-21T11:12:58Z</dc:date>
    </item>
  </channel>
</rss>

