<?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: GUI_DOWNLOAD Help in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004050#M77232</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;Check the decalrations.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;types : begin of ty,&lt;/P&gt;&lt;P&gt;        werks(5)    TYPE c,    "Plant&lt;/P&gt;&lt;P&gt;        matnr(18)   TYPE c,    "Product number&lt;/P&gt;&lt;P&gt;        end of ty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : i_download type standard table of ty,&lt;/P&gt;&lt;P&gt;       w_download type ty.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Local Variable declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA lv_file TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_file = p_file.&lt;/P&gt;&lt;P&gt;  w_download-werks = text-032.&lt;/P&gt;&lt;P&gt;  w_download-matnr   = text-033.   &lt;/P&gt;&lt;P&gt;  INSERT w_download INTO i_download INDEX 1.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            filename                = lv_file&lt;/P&gt;&lt;P&gt;            filetype                = 'ASC'&lt;/P&gt;&lt;P&gt;            write_field_separator   = c_x&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            data_tab                = i_download&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            file_write_error        = 1&lt;/P&gt;&lt;P&gt;            no_batch                = 2&lt;/P&gt;&lt;P&gt;            gui_refuse_filetransfer = 3&lt;/P&gt;&lt;P&gt;            invalid_type            = 4&lt;/P&gt;&lt;P&gt;            no_authority            = 5&lt;/P&gt;&lt;P&gt;            unknown_error           = 6&lt;/P&gt;&lt;P&gt;            header_not_allowed      = 7&lt;/P&gt;&lt;P&gt;            separator_not_allowed   = 8&lt;/P&gt;&lt;P&gt;            filesize_not_allowed    = 9&lt;/P&gt;&lt;P&gt;            header_too_long         = 10&lt;/P&gt;&lt;P&gt;            dp_error_create         = 11&lt;/P&gt;&lt;P&gt;            dp_error_send           = 12&lt;/P&gt;&lt;P&gt;            dp_error_write          = 13&lt;/P&gt;&lt;P&gt;            unknown_dp_error        = 14&lt;/P&gt;&lt;P&gt;            access_denied           = 15&lt;/P&gt;&lt;P&gt;            dp_out_of_memory        = 16&lt;/P&gt;&lt;P&gt;            disk_full               = 17&lt;/P&gt;&lt;P&gt;            dp_timeout              = 18&lt;/P&gt;&lt;P&gt;            file_not_found          = 19&lt;/P&gt;&lt;P&gt;            dataprovider_exception  = 20&lt;/P&gt;&lt;P&gt;            control_flush_error     = 21&lt;/P&gt;&lt;P&gt;            OTHERS                  = 22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works perfectly fine for me.&lt;/P&gt;&lt;P&gt;It's dispalying&lt;/P&gt;&lt;P&gt;Matnr Werks &lt;/P&gt;&lt;P&gt;in a single line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jayanthi Jayaraman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Aug 2005 12:32:15 GMT</pubDate>
    <dc:creator>jayanthi_jayaraman</dc:creator>
    <dc:date>2005-08-05T12:32:15Z</dc:date>
    <item>
      <title>GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004037#M77219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i am facing a problem in funtion module gui_download for downloading header.I have tried few tricks but nothing works.&lt;/P&gt;&lt;P&gt;1. i called function module twice in appending manner but it download the header but all the data comes in one row that also in differnet format(like:word specified format).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so can anyone plz help me in this problem.can anyone send me the sample code that shows how the function module should be used for downloading the header.&lt;/P&gt;&lt;P&gt;It will be great help if some one solve my query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;anu_m13@rediffmail.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 08:51:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004037#M77219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T08:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004038#M77220</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;Check this one&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Download internal table to presentation server file(PC)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Separating fields/columns by a tab&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: ld_filename TYPE string,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Pre version 4.7 declaration e_file like rlgrap-filename.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: begin of it_datatab occurs 0,&lt;/P&gt;&lt;P&gt;  col1(50) type c,&lt;/P&gt;&lt;P&gt;  col2(50) type c,&lt;/P&gt;&lt;P&gt;  col3(50) type c,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      etc....&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; end of it_datatab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;   EXPORTING&lt;/P&gt;&lt;P&gt;        filename         = ld_filename &lt;/P&gt;&lt;P&gt;        filetype         = 'ASC'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      APPEND           = 'X'  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        write_field_separator = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CONFIRM_OVERWRITE = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   TABLES&lt;/P&gt;&lt;P&gt;        data_tab         = it_datatab[]&lt;/P&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;P&gt;        file_open_error  = 1&lt;/P&gt;&lt;P&gt;        file_write_error = 2&lt;/P&gt;&lt;P&gt;        OTHERS           = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/file/file_updown.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/file/file_updown.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 08:57:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004038#M77220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T08:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004039#M77221</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;  DATA lv_file TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_file = p_file.&lt;/P&gt;&lt;P&gt;  CLEAR w_download.&lt;/P&gt;&lt;P&gt;  w_download-werks = text-032.&lt;/P&gt;&lt;P&gt;  w_download-matnr   = text-033.  &lt;/P&gt;&lt;P&gt;*This will append the header.&lt;/P&gt;&lt;P&gt;  INSERT w_download INTO i_download INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            filename                = lv_file&lt;/P&gt;&lt;P&gt;            filetype                = 'ASC'&lt;/P&gt;&lt;P&gt;            write_field_separator   = c_x&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            data_tab                = i_download&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            file_write_error        = 1&lt;/P&gt;&lt;P&gt;            no_batch                = 2&lt;/P&gt;&lt;P&gt;            gui_refuse_filetransfer = 3&lt;/P&gt;&lt;P&gt;            invalid_type            = 4&lt;/P&gt;&lt;P&gt;            no_authority            = 5&lt;/P&gt;&lt;P&gt;            unknown_error           = 6&lt;/P&gt;&lt;P&gt;            header_not_allowed      = 7&lt;/P&gt;&lt;P&gt;            separator_not_allowed   = 8&lt;/P&gt;&lt;P&gt;            filesize_not_allowed    = 9&lt;/P&gt;&lt;P&gt;            header_too_long         = 10&lt;/P&gt;&lt;P&gt;            dp_error_create         = 11&lt;/P&gt;&lt;P&gt;            dp_error_send           = 12&lt;/P&gt;&lt;P&gt;            dp_error_write          = 13&lt;/P&gt;&lt;P&gt;            unknown_dp_error        = 14&lt;/P&gt;&lt;P&gt;            access_denied           = 15&lt;/P&gt;&lt;P&gt;            dp_out_of_memory        = 16&lt;/P&gt;&lt;P&gt;            disk_full               = 17&lt;/P&gt;&lt;P&gt;            dp_timeout              = 18&lt;/P&gt;&lt;P&gt;            file_not_found          = 19&lt;/P&gt;&lt;P&gt;            dataprovider_exception  = 20&lt;/P&gt;&lt;P&gt;            control_flush_error     = 21&lt;/P&gt;&lt;P&gt;            OTHERS                  = 22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly reward points if it is useful.If you need calrifications,get back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 09:05:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004039#M77221</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-08-05T09:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004040#M77222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi look here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="556081"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 10:12:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004040#M77222</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-08-05T10:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004041#M77223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i got some help but its not clear completely.&lt;/P&gt;&lt;P&gt;The field seprator c_x gaves error&lt;/P&gt;&lt;P&gt;1.do i have to define c_x of some type.&lt;/P&gt;&lt;P&gt;2.i get the header not in one row.they are coming into new column like:&lt;/P&gt;&lt;P&gt;value&lt;/P&gt;&lt;P&gt;material&lt;/P&gt;&lt;P&gt;posnr&lt;/P&gt;&lt;P&gt;order.&lt;/P&gt;&lt;P&gt;and i need like:value material posnr order.And below it the whole data.&lt;/P&gt;&lt;P&gt;So please can u thorw some light on this also.how to make my data look like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 11:31:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004041#M77223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T11:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004042#M77224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The value of c_x is X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: c_x(1) TYPE c VALUE 'X'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 11:34:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004042#M77224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T11:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004043#M77225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI judith&lt;/P&gt;&lt;P&gt;it has given the short dump stating type conflict.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please suggest what should be done for that.And if i gave field seprator as 'x' it gives the header but like:&lt;/P&gt;&lt;P&gt;1.value&lt;/P&gt;&lt;P&gt; order&lt;/P&gt;&lt;P&gt; material&lt;/P&gt;&lt;P&gt;And i need output like 2. : value order material &lt;/P&gt;&lt;P&gt;and then the data under the heading.&lt;/P&gt;&lt;P&gt;While stating field seprator as 'x' it gives data but in the format that i stated above in 1.&lt;/P&gt;&lt;P&gt;plz help&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 11:50:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004043#M77225</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T11:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004044#M77226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The value of c_x is 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry it should be inside ' ' k???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 11:54:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004044#M77226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T11:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004045#M77227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;post deleted&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 11:57:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004045#M77227</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T11:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004046#M77228</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;PRE&gt;&lt;CODE&gt;TYPES: begin of ty_itab ,
          Value   type
          material  type 
end of ty_itab.

DATA: i_itab type standard table of ty_itab,
      w_itab type ty_itab.


 w_itab- Value = ' Value '.
 w_itab- material  = ' material '.

 APPEND w_itab to i_output_final.

 i_output[] = i_output_final.

 APPEND i_output_final.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/file/file_downloadpc.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/file/file_downloadpc.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 12:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004046#M77228</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T12:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004047#M77229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope below links helps you&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="451774"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/file/file_updown.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/file/file_updown.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or below is a sample programme which helps you upload and download&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ytest5 LINE-SIZE 80
                LINE-COUNT 65
                NO STANDARD PAGE HEADING.

TABLES: dd02l, dd03l.


* selection screen
SELECTION-SCREEN BEGIN OF BLOCK b00 WITH FRAME TITLE text-b00.
*
SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
PARAMETERS: tabname     LIKE dd02l-tabname OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b01.
*
SELECTION-SCREEN BEGIN OF BLOCK b03 WITH FRAME TITLE text-b03.
PARAMETERS: path(30)    TYPE c DEFAULT 'C:SAPWorkdir'.
SELECTION-SCREEN END OF BLOCK b03.
*
SELECTION-SCREEN BEGIN OF BLOCK b04 WITH FRAME TITLE text-b04.
PARAMETERS: p_exp RADIOBUTTON GROUP radi,
            p_imp RADIOBUTTON GROUP radi,
            p_clear     AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b04.

SELECTION-SCREEN END OF BLOCK b00.

* data
DATA: q_return     LIKE syst-subrc,
      err_flag(1)  TYPE c,
      answer(1)    TYPE c,
      w_text1(62)  TYPE c,
      w_text2(40)  TYPE c,
      winfile(128) TYPE c,
      w_system(40) TYPE c,
      winsys(7)    TYPE c,
      zname(8)     TYPE c,
      w_line(80)   TYPE c.

* internal tables
DATA : BEGIN OF textpool_tab OCCURS 0.
        INCLUDE STRUCTURE textpool.
DATA : END OF textpool_tab.

* table for subroutine pool
DATA : itab(80) OCCURS 0.

* events
INITIALIZATION.
  PERFORM check_system.
*
AT SELECTION-SCREEN ON tabname.
  PERFORM check_table_exists.
*
START-OF-SELECTION.
  PERFORM init_report_texts.
  PERFORM request_confirmation.
*
END-OF-SELECTION.
  IF answer = 'J'.
    PERFORM execute_program_function.
  ENDIF.
*
TOP-OF-PAGE.
  PERFORM process_top_of_page.

* forms
*---------------------------------------------------------------------*
*       FORM CHECK_TABLE_EXISTS                                      *
*---------------------------------------------------------------------*
FORM check_table_exists.
  SELECT SINGLE * FROM dd02l
  INTO CORRESPONDING FIELDS OF dd02l
  WHERE tabname = tabname.
  CHECK syst-subrc NE 0.
  MESSAGE e402(mo) WITH tabname.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM INIT_REPORT_TEXTS                                        *
*---------------------------------------------------------------------*
FORM init_report_texts.
  READ TEXTPOOL syst-repid
  INTO textpool_tab LANGUAGE syst-langu.
  LOOP AT textpool_tab
  WHERE id EQ 'R' OR id EQ 'T'.
    REPLACE '&amp;amp;1............................'
    WITH tabname INTO textpool_tab-entry.
    MODIFY textpool_tab.
  ENDLOOP.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM REQUEST_CONFIRMATION                                     *
*---------------------------------------------------------------------*
FORM request_confirmation.

* import selected, confirm action
  IF p_imp = 'X'.
*   build message text for popup
    CONCATENATE 'Data for table'
                 tabname
                 'will be imported' INTO w_text1 SEPARATED BY space.
*   check if delete existing selected, and change message text
    IF p_clear = ' '.
      w_text2 = 'and appended to the end of existing data'.
    ELSE.
      w_text2 = 'Existing Data will be deleted'.
    ENDIF.

    CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
         EXPORTING
              defaultoption  = 'N'
              textline1      = w_text1
              textline2      = w_text2
              titel          = 'Confirm Import of Data'
              cancel_display = ' '
         IMPORTING
              answer         = answer
         EXCEPTIONS
              OTHERS         = 1.
  ELSE.
*   export selected, set answer to yes so export can continue
    answer = 'J'.
  ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM EXECUTE_PROGRAM_FUNCTION                                 *
*---------------------------------------------------------------------*
FORM execute_program_function.
  PERFORM build_file_name.
  CLEAR: q_return,err_flag.

  IF p_imp = 'X'.
    PERFORM check_file_exists.
    CHECK err_flag = ' '.
    PERFORM func_import.
  ELSE.
    PERFORM func_export.
  ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM BUILD_FILE_NAME                                          *
*---------------------------------------------------------------------*
FORM build_file_name.
  MOVE path TO winfile.
  WRITE '' TO winfile+30.
  WRITE tabname TO winfile+31.
  WRITE '.TAB' TO winfile+61(4).
  CONDENSE winfile NO-GAPS.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM CHECK_FILE_EXISTS                                        *
*---------------------------------------------------------------------*
FORM check_file_exists.

  CALL FUNCTION 'WS_QUERY'
       EXPORTING
            filename = winfile
            query    = 'FE'
       IMPORTING
            return   = q_return
       EXCEPTIONS
            OTHERS   = 1.

  IF syst-subrc NE 0 OR q_return NE 1.
    err_flag = 'X'.
  ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
*     FORM func_export                                              *
*---------------------------------------------------------------------*
FORM func_export.
  CLEAR itab. REFRESH itab.

  APPEND 'PROGRAM SUBPOOL.' TO itab.

  APPEND 'FORM DOWNLOAD.' TO itab.
  APPEND 'DATA: BEGIN OF IT_TAB OCCURS 0.' TO itab.
  CONCATENATE 'INCLUDE STRUCTURE'
              tabname
              '.' INTO w_line SEPARATED BY space.
  APPEND w_line TO itab.
  APPEND 'DATA: END OF IT_TAB.' TO itab.

  CONCATENATE 'SELECT * FROM'
              tabname
              'INTO TABLE IT_TAB.' INTO w_line  SEPARATED BY space.
  APPEND w_line TO itab.

  APPEND 'CALL FUNCTION ''WS_DOWNLOAD''' TO itab.
  APPEND 'EXPORTING' TO itab.
  CONCATENATE 'filename = ' ''''
              winfile '''' INTO w_line SEPARATED BY space.
  APPEND w_line TO itab.
  APPEND 'filetype = ''DAT''' TO itab.
  APPEND 'TABLES' TO itab.
  APPEND 'DATA_TAB = IT_TAB.' TO itab.

  APPEND 'DESCRIBE TABLE IT_TAB LINES sy-index.' TO itab.

  APPEND 'FORMAT COLOR COL_NORMAL INTENSIFIED OFF.' TO itab.
  APPEND 'WRITE: /1 syst-vline,' TO itab.
  APPEND '''EXPORT'',' TO itab.
  APPEND '15 ''data line(s) have been exported'',' TO itab.
  APPEND '68 syst-index,' TO itab.
  APPEND '80 syst-vline.' TO itab.
  APPEND 'ULINE.' TO itab.

  APPEND 'ENDFORM.' TO itab.

  GENERATE SUBROUTINE POOL itab NAME zname.
  PERFORM download IN PROGRAM (zname).
ENDFORM.
*---------------------------------------------------------------------*
*       FORM func_import                                              *
*---------------------------------------------------------------------*
FORM func_import.
  CLEAR itab. REFRESH itab.
  APPEND 'PROGRAM SUBPOOL.' TO itab.

  APPEND 'FORM UPLOAD.' TO itab.
  APPEND 'DATA: BEGIN OF IT_TAB OCCURS 0.' TO itab.
  CONCATENATE 'INCLUDE STRUCTURE'
              tabname
              '.' INTO w_line SEPARATED BY space.
  APPEND w_line TO itab.
  APPEND 'DATA: END OF IT_TAB.' TO itab.
  APPEND 'DATA: BEGIN OF IT_TAB2 OCCURS 0.' TO itab.
  CONCATENATE 'INCLUDE STRUCTURE'
              tabname
              '.' INTO w_line SEPARATED BY space.
  APPEND w_line TO itab.
  APPEND 'DATA: END OF IT_TAB2.' TO itab.

  APPEND 'CALL FUNCTION ''WS_UPLOAD''' TO itab.
  APPEND 'EXPORTING' TO itab.
  CONCATENATE 'filename = ' ''''
              winfile '''' INTO w_line SEPARATED BY space.
  APPEND w_line TO itab.
  APPEND 'filetype = ''DAT''' TO itab.
  APPEND 'TABLES' TO itab.
  APPEND 'DATA_TAB = IT_TAB.' TO itab.

  IF p_clear = 'X'.
    CONCATENATE 'SELECT * FROM'
                tabname
                'INTO TABLE IT_TAB2.' INTO w_line SEPARATED BY space.
    APPEND w_line TO itab.

    APPEND 'LOOP AT IT_TAB2.' TO itab.
    CONCATENATE 'DELETE'
                tabname
                'FROM IT_TAB2.' INTO w_line SEPARATED BY space.
    APPEND w_line TO itab.
    APPEND 'ENDLOOP.' TO itab.
    APPEND 'COMMIT WORK.' TO itab.
  ENDIF.

  APPEND 'LOOP AT IT_TAB.' TO itab.
  CONCATENATE 'MODIFY'
              tabname
              'FROM IT_TAB.' INTO w_line SEPARATED BY space.
  APPEND w_line TO itab.
  APPEND 'ENDLOOP.' TO itab.

  APPEND 'DESCRIBE TABLE IT_TAB LINES sy-index.' TO itab.

  APPEND 'FORMAT COLOR COL_NORMAL INTENSIFIED OFF.' TO itab.
  APPEND 'WRITE: /1 syst-vline,' TO itab.
  APPEND '''IMPORT'',' TO itab.
  APPEND '15 ''data line(s) have been imported'',' TO itab.
  APPEND '68 syst-index,' TO itab.
  APPEND '80 syst-vline.' TO itab.
  APPEND 'ULINE.' TO itab.

  APPEND 'ENDFORM.' TO itab.

  GENERATE SUBROUTINE POOL itab NAME zname.
  PERFORM upload IN PROGRAM (zname).
ENDFORM.
*---------------------------------------------------------------------*
*       Form  CHECK_SYSTEM
*            Check users workstation is running
*            WINDOWS 95, or WINDOWS NT.
*            OS/2 uses 8.3 file names which are no good for
*            this application as filenames created are 30 char
*            same as table name.
*            You could change the logic to only use the first 8 chars
*            of the table name for the filename, but you could possibly
*            get problems if users had exported already with a table
*            with the same first 8 chars.
*            As an alternate method you could request the user to input
*            the full path including filename and remove the logic to
*            build the path using the table name.
*---------------------------------------------------------------------*
FORM check_system.
  CALL FUNCTION 'WS_QUERY'
       EXPORTING
            query  = 'WS'
       IMPORTING
            return = winsys.

  IF winsys NE 'WN32_95'.
    WRITE: 'Windows NT or Windows 95/98 is required'.
    EXIT.
  ENDIF.

ENDFORM.                               " CHECK_SYSTEM
*---------------------------------------------------------------------*
*       FORM PROCESS_TOP_OF_PAGE                                      *
*---------------------------------------------------------------------*
FORM process_top_of_page.
  FORMAT COLOR COL_HEADING INTENSIFIED ON.
  ULINE.

  CONCATENATE syst-sysid
              syst-saprl
              syst-host INTO w_system SEPARATED BY space.

  WRITE : AT /1(syst-linsz) w_system CENTERED.
  WRITE : AT 1 syst-vline, syst-uname.
  syst-linsz = syst-linsz - 11.
  WRITE : AT syst-linsz syst-repid(008).
  syst-linsz = syst-linsz + 11.
  WRITE : AT syst-linsz syst-vline.

  LOOP AT textpool_tab WHERE id EQ 'R'.
    WRITE : AT /1(syst-linsz) textpool_tab-entry CENTERED.
  ENDLOOP.
  WRITE : AT 1 syst-vline, syst-datum.
  syst-linsz = syst-linsz - 11.
  WRITE : AT syst-linsz syst-tcode(004).
  syst-linsz = syst-linsz + 11.
  WRITE : AT syst-linsz syst-vline.

  LOOP AT textpool_tab WHERE id EQ 'T'.
    WRITE : AT /1(syst-linsz) textpool_tab-entry CENTERED.
  ENDLOOP.
  WRITE : AT 1 syst-vline, syst-uzeit.
  syst-linsz = syst-linsz - 11.
  WRITE : AT syst-linsz 'Page', syst-pagno.
  syst-linsz = syst-linsz + 11.
  WRITE : AT syst-linsz syst-vline.
  ULINE.

  FORMAT COLOR COL_HEADING INTENSIFIED OFF.
  LOOP AT textpool_tab WHERE id EQ 'H'.
    WRITE : AT /1(syst-linsz) textpool_tab-entry.
  ENDLOOP.

  ULINE.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it helps you reward with points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 12:11:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004047#M77229</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T12:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004048#M77230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI jayanthi&lt;/P&gt;&lt;P&gt;i tried ur solution but it gaves a little error..its downloading header but like:&lt;/P&gt;&lt;P&gt;age&lt;/P&gt;&lt;P&gt;sex&lt;/P&gt;&lt;P&gt;location.&lt;/P&gt;&lt;P&gt;And i need the output like: age sex location.&lt;/P&gt;&lt;P&gt;and then the output of the data.So please can u send me some sample code so that i can make corrections for the result.It will be great help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;anu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 12:27:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004048#M77230</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T12:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004049#M77231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anu do one thing goto se37, write FM gui...&lt;/P&gt;&lt;P&gt;and then click where used list button, and look into various coding &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope it help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 12:30:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004049#M77231</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T12:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_DOWNLOAD Help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004050#M77232</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;Check the decalrations.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;types : begin of ty,&lt;/P&gt;&lt;P&gt;        werks(5)    TYPE c,    "Plant&lt;/P&gt;&lt;P&gt;        matnr(18)   TYPE c,    "Product number&lt;/P&gt;&lt;P&gt;        end of ty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : i_download type standard table of ty,&lt;/P&gt;&lt;P&gt;       w_download type ty.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Local Variable declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA lv_file TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_file = p_file.&lt;/P&gt;&lt;P&gt;  w_download-werks = text-032.&lt;/P&gt;&lt;P&gt;  w_download-matnr   = text-033.   &lt;/P&gt;&lt;P&gt;  INSERT w_download INTO i_download INDEX 1.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            filename                = lv_file&lt;/P&gt;&lt;P&gt;            filetype                = 'ASC'&lt;/P&gt;&lt;P&gt;            write_field_separator   = c_x&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            data_tab                = i_download&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            file_write_error        = 1&lt;/P&gt;&lt;P&gt;            no_batch                = 2&lt;/P&gt;&lt;P&gt;            gui_refuse_filetransfer = 3&lt;/P&gt;&lt;P&gt;            invalid_type            = 4&lt;/P&gt;&lt;P&gt;            no_authority            = 5&lt;/P&gt;&lt;P&gt;            unknown_error           = 6&lt;/P&gt;&lt;P&gt;            header_not_allowed      = 7&lt;/P&gt;&lt;P&gt;            separator_not_allowed   = 8&lt;/P&gt;&lt;P&gt;            filesize_not_allowed    = 9&lt;/P&gt;&lt;P&gt;            header_too_long         = 10&lt;/P&gt;&lt;P&gt;            dp_error_create         = 11&lt;/P&gt;&lt;P&gt;            dp_error_send           = 12&lt;/P&gt;&lt;P&gt;            dp_error_write          = 13&lt;/P&gt;&lt;P&gt;            unknown_dp_error        = 14&lt;/P&gt;&lt;P&gt;            access_denied           = 15&lt;/P&gt;&lt;P&gt;            dp_out_of_memory        = 16&lt;/P&gt;&lt;P&gt;            disk_full               = 17&lt;/P&gt;&lt;P&gt;            dp_timeout              = 18&lt;/P&gt;&lt;P&gt;            file_not_found          = 19&lt;/P&gt;&lt;P&gt;            dataprovider_exception  = 20&lt;/P&gt;&lt;P&gt;            control_flush_error     = 21&lt;/P&gt;&lt;P&gt;            OTHERS                  = 22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works perfectly fine for me.&lt;/P&gt;&lt;P&gt;It's dispalying&lt;/P&gt;&lt;P&gt;Matnr Werks &lt;/P&gt;&lt;P&gt;in a single line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jayanthi Jayaraman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 12:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-download-help/m-p/1004050#M77232</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-08-05T12:32:15Z</dc:date>
    </item>
  </channel>
</rss>

