<?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 excel upload in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097509#M734901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi can anybody suggest me how to upload/download excel file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Nov 2007 03:07:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-28T03:07:14Z</dc:date>
    <item>
      <title>excel upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097509#M734901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi can anybody suggest me how to upload/download excel file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2007 03:07:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097509#M734901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-28T03:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: excel upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097510#M734902</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;&amp;lt;b&amp;gt;UPLOAD&amp;lt;/b&amp;gt; ABAP code for uploading an Excel document into an internal table. See code below for structures. The&lt;/P&gt;&lt;P&gt;code is based on uploading a simple Excel spreadsheet or for an actual Excel file click here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are also a couple of alternatives which use fucntion modules 'KCD_EXCEL_OLE_TO_INT_CONVERT'&lt;/P&gt;&lt;P&gt;and 'ALSM_EXCEL_TO_INTERNAL_TABLE' but the method below is by far the simplest method to used.&lt;/P&gt;&lt;P&gt;A big thanks to Jayanta for bringing this method to my attention.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*..............................................................&lt;/P&gt;&lt;P&gt;*: Description                                                :&lt;/P&gt;&lt;P&gt;*: -&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;                                                :&lt;/P&gt;&lt;P&gt;*: This is a simple example program to get data from an excel :&lt;/P&gt;&lt;P&gt;*: file and store it in an internal table.                    :&lt;/P&gt;&lt;P&gt;*:                                                            :&lt;/P&gt;&lt;P&gt;*: Author : &lt;A href="https://community.sap.com/www.sapdev.co.uk" target="test_blank"&gt;www.sapdev.co.uk&lt;/A&gt;, based on code from Jayanta      :&lt;/P&gt;&lt;P&gt;*:                                                            :&lt;/P&gt;&lt;P&gt;*: SAP Version : 4.7                                          :&lt;/P&gt;&lt;P&gt;*:............................................................:&lt;/P&gt;&lt;P&gt;REPORT  zupload_excel_to_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: truxs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_file TYPE  rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_datatab,&lt;/P&gt;&lt;P&gt;      col1(30)    TYPE c,&lt;/P&gt;&lt;P&gt;      col2(30)    TYPE c,&lt;/P&gt;&lt;P&gt;      col3(30)    TYPE c,&lt;/P&gt;&lt;P&gt;      END OF t_datatab.&lt;/P&gt;&lt;P&gt;DATA: it_datatab type standard table of t_datatab,&lt;/P&gt;&lt;P&gt;      wa_datatab type t_datatab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_raw TYPE truxs_t_text_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;At selection screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      field_name = 'P_FILE'&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      file_name  = p_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    I_FIELD_SEPERATOR        =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      i_line_header            =  'X'&lt;/P&gt;&lt;P&gt;      i_tab_raw_data           =  it_raw       " WORK TABLE&lt;/P&gt;&lt;P&gt;      i_filename               =  p_file&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      i_tab_converted_data     = it_datatab[]    "ACTUAL DATA&lt;/P&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_failed        = 1&lt;/P&gt;&lt;P&gt;      OTHERS                   = 2.&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;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&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;***********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  LOOP AT it_datatab INTO wa_datatab.&lt;/P&gt;&lt;P&gt;    WRITE:/ wa_datatab-col1,&lt;/P&gt;&lt;P&gt;            wa_datatab-col2,&lt;/P&gt;&lt;P&gt;            wa_datatab-col3.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DOWNLOAD&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : mara.&lt;/P&gt;&lt;P&gt;DATA: ld_filename TYPE string VALUE 'C:\TEMP\DATA.XLS'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: itab LIKE mara OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SELECT * FROM mara INTO TABLE itab.&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;P&gt;   WRITE_FIELD_SEPARATOR = ';'  "Add this line&lt;/P&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_write_error = 2&lt;/P&gt;&lt;P&gt;    OTHERS           = 3.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2007 05:49:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097510#M734902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-28T05:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: excel upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097511#M734903</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;You can download to an excel sheet using the function module GUI_DOWNLOAD. Set the parameter WRITE_COLUMN_SEPARATOR as "X", and give a file name with the .xls extension. Now if you want to upload that file back into your program, use GUI_UPLOAD and set the HAS_COLUMN_SEPARATOR to "X". I believe the GUI_UPLOAD will only work correctly if the file that you are uploading was actually created by the GUI_DOWNLOAD function module. Otherwise, it will not recognize the separator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check demo programs&lt;/P&gt;&lt;P&gt;GREXCEL0 &lt;/P&gt;&lt;P&gt;GREXCEL1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Omkar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2007 05:57:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097511#M734903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-28T05:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: excel upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097512#M734904</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;We have the Class CL_GUI_Frontend_Services which has various methods for communicating with Presentation server files (Excel, Notepad etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the methods of this class in SE24.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_GUI_Frontend_Services=&amp;gt;GUI_Upload&lt;/P&gt;&lt;P&gt;CL_GUI_Frontend_Services=&amp;gt;GUI_Download&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2007 06:16:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097512#M734904</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-11-28T06:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: excel upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097513#M734905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use function modules GUI_UPLOAD &amp;amp; GUI_DOWNLOAD to upload &amp;amp; download a file respectively. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Sample code for uploading a file:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT  y689_upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: y689emp1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_infile  LIKE rlgrap-filename OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gd_file type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Internal tabe to store upload data&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_record,&lt;/P&gt;&lt;P&gt;    EMPID LIKE y689emp1-EMPID,&lt;/P&gt;&lt;P&gt;    NAME like y689emp1-NAME,&lt;/P&gt;&lt;P&gt;    age like y689emp1-age,&lt;/P&gt;&lt;P&gt;    role like y689emp1-role,&lt;/P&gt;&lt;P&gt;    experience like y689emp1-experience,&lt;/P&gt;&lt;P&gt;    END OF t_record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_record TYPE t_record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Internal table to upload data into&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF it_datatab OCCURS 0,&lt;/P&gt;&lt;P&gt;  row(500) TYPE c,&lt;/P&gt;&lt;P&gt; END OF it_datatab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Text version of data table&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_uploadtxt,&lt;/P&gt;&lt;P&gt;  empid TYPE i,&lt;/P&gt;&lt;P&gt;  name(50) TYPE c,&lt;/P&gt;&lt;P&gt;  age  TYPE i,&lt;/P&gt;&lt;P&gt;  role(30) type c,&lt;/P&gt;&lt;P&gt;  experience type i,&lt;/P&gt;&lt;P&gt; END OF t_uploadtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_uploadtxt TYPE t_uploadtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*String value to data in initially.&lt;/P&gt;&lt;P&gt;DATA: wa_string(255) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS: con_tab TYPE x VALUE '09'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*If you have Unicode check active in program attributes then you will&lt;/P&gt;&lt;P&gt;*need to declare constants as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*class cl_abap_char_utilities definition load.&lt;/P&gt;&lt;P&gt;*constants:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   con_tab  type c value cl_abap_char_utilities=&amp;gt;HORIZONTAL_TAB.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_infile.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_FILENAME_GET'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            def_filename     = p_infile&lt;/P&gt;&lt;P&gt;            mask             = ',*.txt.'&lt;/P&gt;&lt;P&gt;            mode             = 'O'&lt;/P&gt;&lt;P&gt;            title            = 'Upload File'(078)&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            filename         = p_infile&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            inv_winsys       = 1&lt;/P&gt;&lt;P&gt;            no_batch         = 2&lt;/P&gt;&lt;P&gt;            selection_cancel = 3&lt;/P&gt;&lt;P&gt;            selection_error  = 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;************************************************************************&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  gd_file = p_infile.&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                = gd_file&lt;/P&gt;&lt;P&gt;      has_field_separator     = 'X'  "file is TAB delimited&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = it_record&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;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write: 'Success'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*!! Text data is now contained within the internal table IT_RECORD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display report data for illustration purposes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT it_record INTO wa_record.&lt;/P&gt;&lt;P&gt;  WRITE:/     sy-vline,&lt;/P&gt;&lt;P&gt;         (10) wa_record-empid, sy-vline,&lt;/P&gt;&lt;P&gt;         (50) wa_record-name, sy-vline,&lt;/P&gt;&lt;P&gt;         (3) wa_record-age, sy-vline,&lt;/P&gt;&lt;P&gt;         (30) wa_record-role, sy-vline,&lt;/P&gt;&lt;P&gt;         (2) wa_record-experience, sy-vline.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To update the data base table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at it_record into wa_record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move wa_record-empid to y689emp1-empid.&lt;/P&gt;&lt;P&gt;move wa_record-name to y689emp1-name.&lt;/P&gt;&lt;P&gt;move wa_record-age to y689emp1-age.&lt;/P&gt;&lt;P&gt;move wa_record-role to y689emp1-role.&lt;/P&gt;&lt;P&gt;move wa_record-experience to y689emp1-experience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify y689emp1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Sample code for downloading a file:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  Y689TEST1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: mara.&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;      ERSDA like mara-ERSDA,&lt;/P&gt;&lt;P&gt;      ERNAM like mara-ERNAM,&lt;/P&gt;&lt;P&gt;      MTART like mara-MTART,&lt;/P&gt;&lt;P&gt;      MATKL like mara-MATKL,&lt;/P&gt;&lt;P&gt;      MEINS like mara-MEINS,&lt;/P&gt;&lt;P&gt;      NTGEW like mara-NTGEW,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;parameters: display as checkbox,&lt;/P&gt;&lt;P&gt;            file as checkbox,                    " Do you need download&lt;/P&gt;&lt;P&gt;            filename like rlgrap-filename.       " download filename&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;select matnr ersda ernam mtart matkl meins ntgew&lt;/P&gt;&lt;P&gt;from mara&lt;/P&gt;&lt;P&gt;into table itab&lt;/P&gt;&lt;P&gt;where matnr in s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not display is initial.&lt;/P&gt;&lt;P&gt;perform display.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not file is initial.&lt;/P&gt;&lt;P&gt;perform file_download.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  file_download&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form file_download .&lt;/P&gt;&lt;P&gt;data: filename1 type string.&lt;/P&gt;&lt;P&gt;filename1 = filename.&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                        = filename1&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; 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;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;endform.                    " file_download&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  display&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form display .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write:/  itab-matnr,&lt;/P&gt;&lt;P&gt;         itab-ersda,&lt;/P&gt;&lt;P&gt;         itab-ernam,&lt;/P&gt;&lt;P&gt;         itab-mtart,&lt;/P&gt;&lt;P&gt;         itab-matkl,&lt;/P&gt;&lt;P&gt;         itab-meins,&lt;/P&gt;&lt;P&gt;         itab-ntgew.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sayee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2007 10:00:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-upload/m-p/3097513#M734905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-28T10:00:58Z</dc:date>
    </item>
  </channel>
</rss>

