Downloading Prompt parameters to Excel

Hello,
I have dashboard prompt and a Table view in my report. I would like to download the report to EXCEL which includes Table data and Selected prompt parameters by the user.
I tried to use Filter View, but it is giving me all the filters applied in the report, not only the ones selected in the prompts. But, I need only the Prompt filters selected by the user !!
Please Suggest !!

only workaround is to save the report filters as a separaet filer with simple name:
for e.g. column1 = 1 and column2 = 'xyz' and column3 = '123abc'
save above set as separate filter say Otherfilers and then apply to the report.
*use  reference while applying filter and not contents so that the name of the filter appears instead of  the details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Can not open file download prompt in portal web app.

    Hi folks,
    I am migrating existing Struts app into portal web app and currently stuck on the following problem.
    In existing app, Struts action calls servlet that generates excel file, sets response headers:
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","attachment;filename=thename.csv");
    that brings up "file download" prompt window.
    In portal app, the same code writes excel file content into browser window instead of the prompt.
    Has anyone had to deal with similar problem? Any help will be greatly appreciated.
    Alex.
    Version of portal used is 8.1 SP5
    Struts - 1.1

    Problem is resolved. For those who might be interested - specifying redirect=true on forward to servlet did the trick.

  • Download  to multiple sheet excel in the background

    Hi,
    I am trying to download data into multiple excel sheets in the background. I was able to create comma delimited csv file in the server, which can be opened as excel file. This is good when it does not have more that one worksheets.
    I have three internal table and to send these internal tables in different worksheets in the same excel file.
    Is it possible to have multiple sheets excel file from the csv file?
    Thanks,
    Lokman

    Hi Lokman,
    <b>1</b>.
    Yes it is Possible.
    <b>2</b>.
    Am sending one example program .That is clear to understand .
    REPORT zvenkat_head MESSAGE-ID zvenkat .
    INCLUDE ole2incl. " Include for OLE object
    DATA: application TYPE ole2_object,
          workbook    TYPE ole2_object,
          sheet       TYPE ole2_object,
          cells       TYPE ole2_object,
          h_f         TYPE ole2_object.            " font
    *Structure for users deleted
    DATA:   BEGIN OF itab_yb001_udel OCCURS 0,
              bname     LIKE yb001-bname,
              name_text LIKE addr3_val-name_text,
            END OF itab_yb001_udel.
    DATA:   BEGIN OF itab_yb001_tadd OCCURS 0.
            INCLUDE STRUCTURE yb001.
    DATA:   name_text LIKE addr3_val-name_text,
            ttext LIKE tstct-ttext.
    DATA:   END OF itab_yb001_tadd.
    *Structure for Transactions deleted
    DATA:   BEGIN OF itab_yb001_tdel OCCURS 0.
            INCLUDE STRUCTURE yb001.
    DATA:   name_text LIKE addr3_val-name_text,
            ttext LIKE tstct-ttext.
    DATA:   END OF itab_yb001_tdel.
    DATA:   BEGIN OF itab_yb001_uadd OCCURS 0,
            bname LIKE yb001-bname,
            name_text LIKE addr3_val-name_text,
            END OF itab_yb001_uadd.
    PARAMETERS: p_fname LIKE rlgrap-filename. " File name to download
    PERFORM download_file.
    FORM - DOWNLOAD_FILE
    FORM download_file.
      DATA index TYPE i.
      CREATE OBJECT application 'excel.application'.
      SET PROPERTY OF application 'visible' = 0.
      CALL METHOD OF application 'Workbooks' = workbook.
      CALL METHOD OF workbook 'Add'.
      CALL METHOD OF application 'Worksheets' = sheet.
      CALL METHOD OF sheet 'Add'.
    Create 1 Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING #1 = 1.
      SET PROPERTY OF sheet 'Name' = 'Transactions Added'.
      CALL METHOD OF sheet 'Activate'.
      PERFORM f_xl_theader.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text   = text-m03
        EXCEPTIONS
          OTHERS = 1.
      LOOP AT itab_yb001_tadd.
        index = sy-tabix + 1. " 1 - column name
        PERFORM fill_cell USING index 1 0 itab_yb001_tadd-bname.
        PERFORM fill_cell USING index 2 0 itab_yb001_tadd-tcode.
        PERFORM fill_cell USING index 3 0 itab_yb001_tadd-name_text.
        PERFORM fill_cell USING index 4 0 itab_yb001_tadd-ttext.
        PERFORM fill_cell USING index 5 0 itab_yb001_tadd-agr_name.
      ENDLOOP.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text   = text-m03
        EXCEPTIONS
          OTHERS = 1.
    Create 2 Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING #1 = 2.
      SET PROPERTY OF sheet 'Name' = 'Transactions Deleted'.
      CALL METHOD OF sheet 'Activate'.
      PERFORM f_xl_theader.
      LOOP AT itab_yb001_tdel.
        index = sy-tabix + 1. " 1 - column name
        PERFORM fill_cell USING index 1 0 itab_yb001_tdel-bname.
        PERFORM fill_cell USING index 2 0 itab_yb001_tdel-tcode.
        PERFORM fill_cell USING index 3 0 itab_yb001_tdel-name_text.
        PERFORM fill_cell USING index 4 0 itab_yb001_tdel-ttext.
        PERFORM fill_cell USING index 5 0 itab_yb001_tdel-agr_name.
      ENDLOOP.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text   = text-m04
        EXCEPTIONS
          OTHERS = 1.
    Create 3 Excel Sheet
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING #1 = 3.
      CALL METHOD OF sheet 'Activate'.
      SET PROPERTY OF sheet 'Name' = 'Users Added'.
      PERFORM f_xl_uheader.
      LOOP AT itab_yb001_uadd.
        index = sy-tabix + 1. " 1 - column name
        PERFORM fill_cell USING index 1 0 itab_yb001_uadd-bname.
        PERFORM fill_cell USING index 2 0 itab_yb001_uadd-name_text.
      ENDLOOP.
    Create 4 Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING #1 = 4.
      SET PROPERTY OF sheet 'Name' = 'Users Deleted'.
      CALL METHOD OF sheet 'Activate'.
      PERFORM f_xl_uheader.
      LOOP AT itab_yb001_udel.
        index = sy-tabix + 1. " 1 - column name
        PERFORM fill_cell USING index 1 0 itab_yb001_udel-bname.
        PERFORM fill_cell USING index 2 0 itab_yb001_udel-name_text.
      ENDLOOP.
    Save excel speadsheet to particular filename
      CALL METHOD OF sheet 'SaveAs'
                      EXPORTING #1 = p_fname     "filename
                                #2 = 1.          "fileFormat
      PERFORM err_hdl.
    Closes excel window, data is lost if not saved
      SET PROPERTY OF application 'visible' = 0.
    Close the file
      CALL METHOD OF workbook 'CLOSE'.
    Quit the file
      CALL METHOD OF application 'QUIT'.
      FREE OBJECT application.
    ENDFORM.                    "DOWNLOAD_FILE
    *&      Form  F_XL_THEADER
          Header for XL sheet
    -->  p1        text
    <--  p2        text
    FORM f_xl_theader .
    output column headings to active Excel sheet
      PERFORM fill_cell USING 1 1 1 text-t01.
      PERFORM fill_cell USING 1 2 1 text-t02.
      PERFORM fill_cell USING 1 3 1 text-t03.
      PERFORM fill_cell USING 1 4 1 text-t04.
      PERFORM fill_cell USING 1 5 1 text-t05.
    ENDFORM.                    " F_XL_THEADER
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    FORM fill_cell USING i j bold val.
      CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = i #2 = j.
      PERFORM err_hdl.
      SET PROPERTY OF cells 'Value' = val .
      PERFORM err_hdl.
      GET PROPERTY OF cells 'Font' = h_f.
      PERFORM err_hdl.
      SET PROPERTY OF h_f 'Bold' = bold .
      PERFORM err_hdl.
    ENDFORM.                    "FILL_CELL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    FORM err_hdl.
      IF sy-subrc <> 0.
        WRITE: / 'Fehler bei OLE-Automation:'(010), sy-subrc.
        STOP.
      ENDIF.
    ENDFORM.                    " ERR_HDL
          Header for XL sheet
    -->  p1        text
    <--  p2        text
    FORM f_xl_uheader .
      PERFORM fill_cell USING 1 1 1 text-t01.
      PERFORM fill_cell USING 1 2 1 text-t03.
    ENDFORM.                    " F_XL_UHEADER
    Please try to understand first and replicate to ur requirement.
    Please let me know if u have any problem.
    <b>Thanks,
    Venkat.O</b>

  • Downloading table data into Excel sheet - Webdynpro Java

    Hi All,
    We have developed a custom webdynpro application that executes an RFC and displays data in Table UI element. We have provided a button to download the data in excel sheet. When data is huge like, total number of rows filled up in the table are around 11,000 & columns are 32, and when user tries to download whole 11000 rows in excel sheet, the timeout occurs after 20 mins due to huge data. But when I apply filtering on the same table data and then try to download some 700 rows out of 11000 into excel, it took me around 3.36 mins.
    If anyone encountered such scenario in past, please guide in this regard to speed-up the download to excel functionality or suggest any other alternative.
    We are using 7.3 Portal and tableUtilities java class for export to excel functionality.
    Thanks,
    Amol.

    hi monica ,
    sorry im not able to understand properly ,
    The server don't restarts automatically when we uploading a huge data, onlly we open the file instead of save the file.
    If we save the file the problem is that when we try to open this, the process can take hours and sometimes excel is blocked
    you mean that after saving the file to your desktop , having huge data you are not able to open the file i.e the excel file. your file gets blocked or consumes more time to open the file ,
    or else when you are prompted for saving or opening , on click of opening  you are facing the problem ?
    let me be clear with your part , here your application deals with uploading the data from webdynpro table to excel sheet and allowing the end user to save or open the file  right .
    Regards
    Govardan Raj S

  • Download SAP data to Excel file in Presentation server

    Hi gurus,
    I need to download SAP data to excel file. for that im using SAP_CONVERT_TO_XLS_FORMAT   function module. I have to download with column header and also date should be in YYMMDD format. Im changing the format in ITAB but when populating to excel leading zero's were removed.(EX. 12102007 is converted to 071012 and it was populated as 71012). can someone explain how to use this function module or give someother solution for this....And if possible explain the parameters of the function module SAP_CONVERT_TO_XLS_FORMAT. Is there any function module for converting date as required format?
    Thanks,
    Amal

    Hi Amal...
    The Problem you are facing is because of Display properties of Microsoft Excel itself. I believe this can not be solver with in SAP. Instead I would suggest you to go for a .csv format. which can also be viewed in Excel.
    In any case if you get to find a different solution for this, I would appriciate if you can share it with me :).
    Santosh

  • Downloading records in in excel sheet from ALV.

    Hi,
    I am downloading Records from ALV GRID DIsplay to Excel sheet but i am unable to get all records that are displayed in ALV report.
    I am getting only 73 records if i have only 180
    Any inputs please for correctine the error
    Regards
    Rasheed.

    hi
    you can follow these stapes and get ur work done
    go to List > select Export  > Spreadsheet or just click the excel icon from the tool bar.This would download the data to excel.
    hope this helps
    regards
    Aakash Banga

  • How do I stop firefox from pre-downloading a file during a file download prompt?

    I use DownThemAll as my download manager for files generally over 10MB, as my internet connection is generally too slow for firefox to download a file larger then this without firefox "finishing" a download before it's complete, corrupting the file. This never happens with DownThemAll.
    For some sites, either there is no download link to right click or it starts automatically, launching the download prompt. Firefox's internal download manager automatically starts downloading the file (not visibly, but in the background) before I can choose to use DownThemAll from the prompt instead.
    This wastes bandwidth. Even worse, some hosting sites have randomly generated download gates for each session that expire after disconnection or limit you to a single download in a given time frame. This means that I effectively can't use DownThemAll on certain websites because firefox's own download manager steps in and gets in the way.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Download from ALV to excel sheet.

    When i am downloading the Alv to excel sheet. I want to get the field descritption also in the excel sheet.

    Refer:
    https://forums.sdn.sap.com/click.jspa?searchID=14433981&messageID=3603627

  • Download alv report in excel format in Linux

    Hi All,
    I am working on SAP GUI for Java in Linux PC. I have installed
    Open Office.
    After executing an alv report there is no spreadsheet option
    to download the report in excel format .
    Also, when doing Save as Local File -> Spreadsheet ,
    the report is not downloaded in proper format.
    So, how to download the alv reports in excel format ?

    Hi Vinod ,
    Save as Local File -> Spreadsheet
    It will ask for Directory and file name with .xls format . Give proper name e.g. test.xls and save, and after saving file right click on the file and click on Open with "OpenOffice.org calc".
    It will definetly work.
    Abhijeet

  • Report to display PO details and download details in an excel fil

    Hi,
    I have been asked to develop a report for "Develop report to display PO details and download details in an excel file".
    Could any one guide me technically what are the different tables i need to take to generate the report. Treat this is very urgent. Pls provide sample code too....
    Thanks in advance....

    Purchase Order PO
    Tcode for creation ME21,ME22,ME23. tables EKKO,EKPO.
    refer this program
    REPORT ZPOCHANGE.
    This is a subroutine perform in the Purchase order Layout sets.
    Description :  To retreive the details of changed remarks in PO output and to capture the retrival date
                         Additional features with the previous changed appearing.  e.g. from .... to
    Note        :  If the latest modification details required
    Please Uncomment the lines mentioned under  'Last Modified Remarks only'
    Information
    /: PERFORM CHDATE IN PROGRAM ZPOCHANGE
    /:               USING &EKKO-EBELN&
    /:               CHANGING &RVDATE2&
    /: ENDPERFORM.
    /: IF &RVDATE2& EQ ' '.
    /  Revision Date: NIL
    /: ELSE.
    /  Revision Date: &RVDATE2&
    /: ENDIF.
    Main Window
    /E CHANGE_REMARKS
    /: PERFORM CHDET IN PROGRAM ZPOCHANGE
    /:            USING &EKPO-EBELP&
    /:            USING &EKKO-EBELN&
    /:            USING &T166T-CHTXT&
    /:            USING &T166T-CTXNR&
    /:            CHANGING &ITAB1-F_NEW&
    /:            CHANGING &ITAB1-F_OLD&
    /:ENDPERFORM.
    /:IF &ITAB1-F_NEW& NE ' '
    =  &ITAB1-F_OLD(C)& CHANGED TO &ITAB1-F_NEW(C)&
    /:ENDIF
    You might need to apply Note 373524 - Message determination and printing
    TABLES : CDSHW , "Change documents, formatting table
             CDHDR , "Change document header
             EKPO  , "Purchasing Document Item
             EKKO  , "Purchasing Document Header
             T166C . "Print-Relevant Purchasing Document Changes
    DATA   : ITAB1 LIKE CDSHW OCCURS 100 WITH HEADER LINE.
    DATA   : ITAB2 LIKE EKPO  OCCURS 100 WITH HEADER LINE.
    DATA   : DOCUM LIKE EKKO OCCURS 100 WITH HEADER LINE.
    DATA   : TABKEY LIKE CDSHW-TABKEY.
    data    : begin of ctab occurs 10,
              tname like t166c-tname,
              fname like t166c-fname,
              TABKEY LIKE CDSHW-TABKEY,
              FLAG(3),
              end of ctab.
    DATA   : VAL1(15), VAL2(15).
    DATA : M1(20), M2(10), M3(10),M4(5).
    DATA : RVDATE(10),RVDATE2(10) , EBELN LIKE EKKO-EBELN, COUNT TYPE I.
    Text number for change text(CTXNR), CHANGE TEXT(CHTXT), Purchase order
    Number and item number are passed from Layoutset
          FORM CHDET                                                    *
    -->  ITAB                                                          *
    -->  OTAB                                                          *
    FORM CHDET TABLES ITAB STRUCTURE  ITCSY
                      OTAB STRUCTURE  ITCSY.
      LOOP AT ITAB.
        CASE ITAB-NAME.
          WHEN 'T166T-CHTXT'.
            MOVE ITAB-VALUE TO M1.
          WHEN 'T166T-CTXNR'.
            MOVE ITAB-VALUE TO M2.
          WHEN 'EKKO-EBELN'.
            MOVE ITAB-VALUE TO M3.
          WHEN 'EKPO-EBELP'.
            MOVE ITAB-VALUE TO M4.
        ENDCASE.
      ENDLOOP.
    Throught this function change details are retrived into itab1.
      CALL FUNCTION 'ME_CHANGES_READ'
           EXPORTING
                DOCUMENT_CATEGORY = 'F'
                DOCUMENT_NUMBER   = M3
           TABLES
                XCDSHW            = itab1.
      SELECT SINGLE * FROM T166C WHERE CTXNR = M2.
      IF SY-SUBRC = 0.
        CONCATENATE M3 M4  INTO TABKEY.
    ********Last Modified Remarks only**********************
       read table ctab with key  tname  = T166C-TNAME
                                         tabkey  = tabkey
                                         fname   = T166C-FNAME.
       if sy-subrc ne 0.
        LOOP AT ITAB1 WHERE TABNAME = T166C-TNAME
                                      AND   TABKEY+3(15) = TABKEY
                                      AND   FNAME = T166C-FNAME.
    *********Last Modified Remarks only**********************
           ctab-tname  = t166c-tname.
           ctab-fname  = t166c-fname.
           ctab-tabkey = tabkey.
           append ctab.
          delete itab1.
          exit.
        endloop.
    Captured details are exported to Layoutset
        LOOP AT OTAB.
          CASE OTAB-NAME.
            WHEN 'ITAB1-F_OLD'.
              OTAB-VALUE = ITAB1-F_OLD.
              MODIFY OTAB.
              CLEAR : ITAB1-F_OLD.
            WHEN 'ITAB1-F_NEW'.
              OTAB-VALUE = ITAB1-F_NEW.
              MODIFY OTAB.
              CLEAR : ITAB1-F_NEW.
          ENDCASE.
        endloop.
      endif.
    ******Last Modified Remarks only****************
    ENDIF.
      clear ctab.
    ENDFORM.
          FORM CHDATE                                                   *
    -->  ITAB                                                          *
    -->  OTAB                                                          *
    Form for revision date retrival. PO no. is passed from layoutset
    and in the change document header latest modified date is captured
    and passed to revision date field in Layoutset.
    FORM CHDATE TABLES ITAB STRUCTURE  ITCSY
                      OTAB STRUCTURE  ITCSY.
      CLEAR : RVDATE, EBELN.
      LOOP AT ITAB.
        CASE ITAB-NAME.
          WHEN 'EKKO-EBELN'.
            MOVE ITAB-VALUE TO EBELN.
        ENDCASE.
      ENDLOOP.
    SELECT UDATE INTO CDHDR-UDATE FROM CDHDR WHERE OBJECTCLAS = 'EINKBELEG'
                                                       AND OBJECTID = EBELN.
        IF RVDATE < CDHDR-UDATE.
          RVDATE = CDHDR-UDATE.
        ENDIF.
        COUNT = COUNT + 1.
      ENDSELECT.
      LOOP AT OTAB.
        CASE OTAB-NAME.
          WHEN 'RVDATE2'.
         CONCATENATE RVDATE6(2) '.' RVDATE4(2) '.' RVDATE(4) INTO RVDATE2.
            IF COUNT = 1.
              RVDATE2 = ''.
            ENDIF.
            MOVE RVDATE2 TO OTAB-VALUE.
            MODIFY OTAB.
        ENDCASE.
      ENDLOOP.
    CLEAR : COUNT.
    ENDFORM.
    Message was edited by:
            Karthikeyan Pandurangan

  • Generic Repository class to download BSP into Ms-excel

    Hi,
    we have developed the download utility for BSP-MVC application, we have many BSP-MVC applications so i have to  develop a generic Repository class to download BSP into ms-excel, which is usable for all, the data selection will be done from model at run time by using techniques (field symbols and data references)wolud you please suggest how to achive this.
    Thanks in advance !
    best regards
    ravi

    I have written a generic download utility as a custom BSP Extension Element.  Perhaps it will give you some ideas:
    <a href="/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table a BSP Extension for Downloading a Table</a>
    <a href="/people/thomas.jung3/blog/2005/07/18/bsp-extension-for-downloading-a-table-applying-an-iterator Extension for Downloading a Table: Applying an Iterator</a>

  • Some problem of download BSP data into excel using  cl_bsp_utility= download

    Hello Experts,
    I have read the blog of thomas.jung for download bsp data into excel, and it's working correct, and after some try and error, now I can download the excel with multi sheets.It's all cool except one thing.....when I add a button on the standard screen of the supplier qualification of the slc to download the excel file, after the popinp up screen, the standard screen can't do any operation at all......there are no any error message and the downloaded file is all correct .
    Does any one know what can I do?

    any ideas?
    By the way, after some research, maybe the issue was caused by the setup of the button, but I don't know how to fix it...0rz
    the standard code for buttton is
    lv_id = mv_id && '>display'.
    lo_edit_display_button = cl_thtmlb_button=>factory( id       = lv_id
                                                       text     = lv_button_text
                                                   tooltip  = lv_button_text
                                                   enabled  = 'TRUE'
                                                  onclick  = lv_button_action ).
    WHILE io_page_context->element_process( element = lo_edit_display_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.
    so I copy it and modify like this:
    lv_id = mv_id && '>download'.
        lo_download_excel_button = cl_thtmlb_button=>factory( id       = lv_id
                                                            text     = w_text
                                                        tooltip  = w_text
                                                        enabled  = 'TRUE'
        onclick  = /srmsm/if_ql_ext_ui_c=>ZC_ACTION_DOWNLOAD_EXCEL
    WHILE io_page_context->element_process( element = lo_download_excel_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.

  • Download internal table to excel with header

    Hi All,
    I have a requirement to download internal table contents to excel with field headings. I tried searching in forums before posting but didn't got much help.
    I have used GUI_DOWNLOAD, WS_DOWNLOAD and EXCEL_OLE_STANDARD_DAT.
    But unable to download the header in excel..along with data...
    EXCEL_OLE_STANDARD_DAT is getting field header in excel but not downloading automatically , need to save manually which is not the requirement.
    The data is huge with around 151 columns....I got 2 internal tables.
    One for the data and the other with field names.
    Many Thanks,
    Ravi K

    Hi Ravi,
    You need to have 2 different internal tables for achieving the needful. One internal table would be having your data and another would store your table field names i.e., declare a structure of length 100 characters,
    TYPES : BEGIN OF GTY_FIELDNAMES,
                    TITLE(100),
                  END   OF GTY_FIELDNAMES.
    DATA: GIT_FIELDNAMES TYPE STANDARD TABLE OF GTY_FIELDNAMES,
                GWA_FIELDNAMES TYPE GTY_FIELDNAMES.
    DATA : GD_FILENAME TYPE STRING,
                GD_PATH     TYPE STRING,
                GD_FULLPATH TYPE STRING,
                GD_RESULT   TYPE I.
    Now have a subroutine where by you append your headings into the internal table i.e.,GIT_FIELDNAMES
       CLEAR GWA_FIELDNAMES.
       GWA_FIELDNAMES-TITLE = 'Material Number'.
       APPEND GWA_FIELDNAMES TO GIT_FIELDNAMES.
       CLEAR GWA_FIELDNAMES.
       GWA_FIELDNAMES-TITLE = 'Material Description'.
       APPEND GWA_FIELDNAMES TO GIT_FIELDNAMES.
    Once you are done with it you can call up the save dialog
    * Display save dialog window
       CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
         EXPORTING
           WINDOW_TITLE           = 'Save File As...'
           DEFAULT_EXTENSION  = 'XLS'
           DEFAULT_FILE_NAME  = 'SalesPlan'
           INITIAL_DIRECTORY      = 'C:\'
         CHANGING
           FILENAME                      = GD_FILENAME
           PATH                               = GD_PATH
           FULLPATH                      = GD_FULLPATH
           USER_ACTION               = GD_RESULT.
    * Check user did not cancel request
       CHECK GD_RESULT EQ '0'.
       CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
           FILENAME              = GD_FULLPATH
           FILETYPE                = 'ASC'
    *     APPEND                = 'X'
           WRITE_FIELD_SEPARATOR = 'X'
    *     CONFIRM_OVERWRITE     = 'X'
         TABLES
           DATA_TAB                 = GIT_FINAL                  " Internal table having data
           FIELDNAMES            = GIT_FIELDNAMES     " Internal table having headings
         EXCEPTIONS
           FILE_OPEN_ERROR       = 1                         "#EC ARGCHECKED
           FILE_WRITE_ERROR      = 2
           OTHERS                           = 3.
    Hope this gets sorted your problem.
    Thanks & Regards,
    Varun Kumar Sahu

  • How to Download displayed output to Excel Using Bsp Application

    Hi Experts,
    please give me some idea because I am New In BSP.
    How to Download displayed output to Excel Using Bsp Application.
    If any sample code please do send me.
    In my condition I am getting data in  2-3 table view formats on one page and i want download that in Excel.
    please help me.
    Regards & Thanks,
    Yogesh

    Hi,
    This is more a question for the BSP forum.
    Anyway, as such it's realy easy since you can use HTML in order to import to Excel. All you need to do is add
    runtime->server->response->set_header_field( name = 'Contnet-Type'
    value = 'application/vnd.ms-excel' ).
    runtime->server->response->delete_header_field( name = 'Cache-Control' ).
    runtime->server->response->delete_header_field( name = 'Expires' ).
    runtime->server->response->delete_header_field( name = 'Pragma' ).
    Also check threads like
    Download BSP data into Excel
    export bsp-table to excel
    Export BSP Table to Excel
    Eddy
    PS. Reward useful answers and earn points yourself

  • Download & upload of an excel file

    Hi,
          I have a requirement where the data needs to be downloaded into an excel file and user will upload the same excel file after making required changes in the data.
    I have used 'GUI_DOWNLOAD' to download the data to excel file. I have tried to upload the same excel file using 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'TEXT_CONVERT_XLS_TO_SAP' function modules. But it is giving exceptions if I upload the same downloaded file directly. If I copy the data in the downloaded file to another excel file and upload this file, it is working.
    I have tried using 'GUI_UPLOAD' with field separator which was also specified in 'GUI_DOWNLOAD' but in this case the data is uploaded into the internal table like,.
    ###&jkj, 0000 .......
    Please suggest any other alternative.
    Thanks & Regards,
    Vishnu Priya

    Hi,
    You may like to give a try to this FM
    RH_START_EXCEL_WITH_DATA.it will take care of your formatting problem.
    go thru this program..
    *& Report  RHVERI_EXCEL_DOWNLOAD                                       *
    REPORT  rhveri_excel_download.
    DATA: g_excelpath    TYPE string,
          g_excelversion TYPE string,
          g_codepage     TYPE abap_encod,                       "XMK#754232
          g_return_code  TYPE i,                                "XMK#754232
          BEGIN OF gt_data OCCURS 0,
            f1 TYPE char20,
            f2 TYPE char20,
            f3 TYPE char20,
            f4 TYPE char20,
          END   OF gt_data.
    END-OF-SELECTION.
      gt_data-f1 = 'C1'.
      gt_data-f2 = 'C2'.
      gt_data-f3 = 'C3'.
      gt_data-f4 = 'C4'.
      APPEND gt_data.
      gt_data-f1 = '10'.
      gt_data-f2 = '11'.
      gt_data-f3 = '12'.
      gt_data-f4 = '13'.
      APPEND gt_data.
      gt_data-f1 = '20'.
      gt_data-f2 = '21'.
      gt_data-f3 = '22'.
      gt_data-f4 = '23'.
      APPEND gt_data.
      "XMK#754232
      gt_data-f1 = 'AEIOU'.                                     "#EC NOTEXT
      gt_data-f2 = 'aeiou'.                                     "#EC NOTEXT
      gt_data-f3 = '*?#/&§$#'.                                 "#EC *
      gt_data-f4 = 'äöüÄÖÜßaé'.                                 "#EC *
      APPEND gt_data.
      "XMK#754232
      CALL FUNCTION 'RH_CHECK_EXCEL_SUPPORT'
        IMPORTING
          excel_exe_path      = g_excelpath
          excel_version       = g_excelversion
        EXCEPTIONS
          no_batch            = 1
          internal_error      = 2
          excel_not_installed = 3
          wrong_frontend_os   = 4
          OTHERS              = 5.
      IF sy-subrc <> 0.
        WRITE / 'Testaufruf von Excel endete mit Fehlercode:'(002).
        WRITE: sy-subrc, / sy-msgv1, sy-msgv2, sy-msgv3, sy-msgv4.
        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ELSE.
        WRITE: / 'Pfad von Excel'(005), g_excelpath.
        WRITE: / 'Version von Excel'(006), g_excelversion.
      ENDIF.
      "XMK#754232
      IF cl_abap_char_utilities=>charsize <> 1.
        WRITE / 'Unicode system'(007).
        CALL METHOD cl_gui_frontend_services=>get_saplogon_encoding
          CHANGING
            file_encoding = g_codepage
            rc            = g_return_code
          EXCEPTIONS
            OTHERS        = 1.
        IF sy-subrc <> 0.
          g_codepage = '4110'.
        ENDIF.
        WRITE: / 'Codepage is'(009), g_codepage.
      ELSE.
        WRITE / 'Non-Unicode system'(008).
      ENDIF.
      "XMK#754232
      CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
       EXPORTING
         data_filename             = 'TEST.DAT'
         data_path_flag            = 'W'
       DATA_ENVIRONMENT          =
         wait                      = 'X'
         data_table                = gt_data[]
       EXCEPTIONS
         no_batch                  = 1
         excel_not_installed       = 2
         internal_error            = 3
         cancelled                 = 4
         download_error            = 5
         no_authority              = 6
         file_not_deleted          = 7
         OTHERS                    = 8.
      IF sy-subrc <> 0.
        WRITE / 'Aufruf von Excel endete mit Fehlercode:'(003).
        WRITE: sy-subrc, / sy-msgv1, sy-msgv2, sy-msgv3, sy-msgv4.
        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ELSE.
        WRITE / 'Aufruf von Excel lieferte keinen Fehler.'(004).
      ENDIF.
    Regards,
    Amit

Maybe you are looking for