Download ALV in Excel format to AL11

Hello ppl,
I have a requirement for ALV report program where the selection screen has two radio buttons.
One of them is for 'download'.
If the user selects this option, then the ALV report should be downloaded in excel format in the application server (AL11).
How to achieve this?
Please help.
Thanks,
David.
Edited by: Alvaro Tejada Galindo on Feb 22, 2008 4:18 PM

use the event AT SELECTION-SCREEN OUTPUT event...
at this event do the coding for ALV .. whether to download it or to display it...

Similar Messages

  • Problem while downloadind data from ALV in excel format.

    Hi Experts,
    I have developed one ALV Report.
    it have 53 columns. when i tried to download it in excel format using standard functionality, all columns are not coming in one line i.e 50 cloumns in one line and rest columns to the next line.
    For Example.
    Row 1 Header->    Fld1    Fld2    Fld3   Fld4   Fld5 
                               Fld6    Fld7
    Row 2 Values->    Val1    Val2    Val3  Val4   Val5
                               Val6    Val7
    how i will get all these 53 columns in one line in EXCEL..
    its urget........
    Usefull answer will be rewarded...

    hi,
    there are some specific restrictions in downloading data in alv.
    i.e you cannot have morethan 1024 characters that can be downloaded in single row.
    so change your report columns accordingly.

  • Download files in excel format

    Hi,
    Can anyone help me for downloading file in excel format? I have scheduled a job repeated everyday at a particular time, but it dumps a text file, NOT in excel format. My programme is an ALV.
    Code snippet would be verymuch helpfull.
    Thank,
    Thushara.

    Hello Thushara,
    here is a code i am giving you . It will take the data from a database , and download it into the excel format..
    You just can customize this program to download the data from an ALV ....
    Here is the sample code...
    REPORT  ZKUN_FILE4                              .
    TABLES: USR03,DD02L.
    DATA: ZX030L LIKE X030L.
    DATA BEGIN OF ZDFIES OCCURS 0.
         INCLUDE STRUCTURE DFIES.
    DATA END OF ZDFIES.
    DATA: BEGIN OF FLDITAB OCCURS 0,
          FLDNAME(11) TYPE C,
          END OF FLDITAB.
    DATA ITABUSR03 LIKE USR03 OCCURS 0 WITH HEADER LINE.
    DATA TNAME LIKE DD02L-TABNAME.
    SELECT * FROM USR03 INTO TABLE ITABUSR03.
    TNAME = 'USR03'.
    PERFORM GETFIELEDS.
    PERFORM SHOW123.
    FORM GETFIELEDS.
         CALL FUNCTION 'GET_FIELDTAB'
          EXPORTING
              LANGU              = SY-LANGU
              ONLY               = SPACE
              TABNAME            = TNAME
              WITHTEXT           = 'X'
          IMPORTING
              HEADER             = ZX030L
          TABLES
              FIELDTAB           = ZDFIES
          EXCEPTIONS
              INTERNAL_ERROR      = 01
              NO_TEXTS_FOUND      = 02
              TABLE_HAS_NO_FIELDS = 03
              TABLE_NOT_ACTIV     = 04.
         CASE SY-SUBRC.
            WHEN 0.
              LOOP AT ZDFIES.
                   FLDITAB-FLDNAME = ZDFIES-FIELDNAME.
                   APPEND FLDITAB.
              ENDLOOP.
            WHEN OTHERS.
                 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  with  SY-SUBRC.
          ENDCASE.
    ENDFORM.
    FORM SHOW123.
    CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
         EXPORTING
              FILE_NAME                 = 'C:\USR03.XLS'
              DATA_SHEET_NAME           = 'USER LIST'
        TABLES
             DATA_TAB                  =  ITABUSR03
             FIELDNAMES                =  FLDITAB
        EXCEPTIONS
             FILE_NOT_EXIST            = 1
             FILENAME_EXPECTED         = 2
             COMMUNICATION_ERROR       = 3
             OLE_OBJECT_METHOD_ERROR   = 4
             OLE_OBJECT_PROPERTY_ERROR = 5
             INVALID_FILENAME          = 6
             INVALID_PIVOT_FIELDS      = 7
             DOWNLOAD_PROBLEM          = 8
             OTHERS                    = 9.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    Hope this solves your problem.
    Regards,
    Kunal.
    Note : Reward points if found useful.

  • Downloading ALV to excel file

    Hi all,
       i am trying to download ALV to excel file.
       but as the alv contains many fields,
       the row in the excel is automatically wrapped to the
       next row ..
       what i want is the row in excel should come as it is
       in the ALV (whole thing in one line) and should not wrap to next row
      Regards,
      Tarang

    Hi Shah,
    <b>
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'</b>
        EXPORTING
          I_CALLBACK_PROGRAM      = V_REPID
          I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
          IS_LAYOUT               = WA_LAYOUT
          I_SAVE                  = 'A'
          IT_FIELDCAT             = I_FLDCAT_HEAD
          IT_SORT                 = IT_SORT
          IT_EVENTS               = I_EVENTS
        TABLES
          T_OUTTAB                = IT_FINAL
        EXCEPTIONS
          PROGRAM_ERROR           = 1
          OTHERS                  = 2.
      IF SY-SUBRC = 0.
    <b>     CALL FUNCTION 'GUI_DOWNLOAD'</b>
         EXPORTING
          BIN_FILESIZE                    =
            FILENAME                        = 'C:\Documents and Settings\vikranthk\Desktop\vikranth.xls'
           FILETYPE                        = 'ASC'
          APPEND                          = ' '
          WRITE_FIELD_SEPARATOR           = ' '
          HEADER                          = '00'
          TRUNC_TRAILING_BLANKS           = ' '
          WRITE_LF                        = 'X'
          COL_SELECT                      = ' '
          COL_SELECT_MASK                 = ' '
          DAT_MODE                        = ' '
          CONFIRM_OVERWRITE               = ' '
          NO_AUTH_CHECK                   = ' '
          CODEPAGE                        = ' '
          IGNORE_CERR                     = ABAP_TRUE
          REPLACEMENT                     = '#'
          WRITE_BOM                       = ' '
          TRUNC_TRAILING_BLANKS_EOL       = 'X'
          WK1_N_FORMAT                    = ' '
          WK1_N_SIZE                      = ' '
          WK1_T_FORMAT                    = ' '
          WK1_T_SIZE                      = ' '
        IMPORTING
          FILELENGTH                      =
          TABLES
            DATA_TAB                        = it_final.
          FIELDNAMES                      =
        EXCEPTIONS
          FILE_WRITE_ERROR                = 1
          NO_BATCH                        = 2
          GUI_REFUSE_FILETRANSFER         = 3
          INVALID_TYPE                    = 4
          NO_AUTHORITY                    = 5
          UNKNOWN_ERROR                   = 6
          HEADER_NOT_ALLOWED              = 7
          SEPARATOR_NOT_ALLOWED           = 8
          FILESIZE_NOT_ALLOWED            = 9
    Thanks
    Vikranth Khimavath
    Message was edited by: Khimavath Vikranth

  • How to Download Data in Excel Formate

    Hi  Friend,
    I have one doubt on webdynpro with java.  Req: For download data in Excel formate.
    I will follow this http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3596. [original link is broken] [original link is broken] [original link is broken]
      i am doing upto 3rd Step here.. Up to Step 3 i am doing after 3rd Step  I am not understand. Could u explain 4step.
    1. I have to place TableUtilities.java
    2. I have Create tableutilities value attribute
    3. in Modify view--- This is -SecondView -
    This is having Table UI Element.
         if(firstTime)
    IWDTextView tv = (IWDTextView)view.getElement("total");
    wdContext.currentContextElement().setTableutility(new TableUtilities(wdContext.nodeDepartments()));
    //Returns attribute info of a dynamically created attribute which can be bound to the UI element neeed.
    tv.bindText(wdContext.currentContextElement().getTableutility().CalculateSum("Departments","NoOfPeople"));
    4. Creating an Excel File
    How to Create Excel File here can u explain
    I am not understand this 4th step. Pls give me Breef Explanation. How to write this code...here...
    Regards
    Vijay Kalluri
    Edited by: KalluriVijay on May 4, 2010 8:00 PM
    Edited by: KalluriVijay on May 4, 2010 8:02 PM

    Hi Vijay,
    Please open Microsoft Excel from your system and then create some entries (ex. having 3 columns and 3 rows). Save this file to some location in your system. Later you will need to give the location path of this saved file when uploading it from your web dynpro application.
    Creating of an Excel file (i.e the 4th step) is no where related to Web Dynpro and NWDS.
    Hope this helps!
    Regards,
    Kishan

  • Downloading report in excel format.

    Hi,
    I'm newbie on apex. I'm trying to make a report which is enabled to download in excel format. Report is working correctly what I expected.
    But I found single colume data was split multiple cell in downloaded excel file. I don't know how I can merge this cells into one.
    I made a sample report with data.
    http://apex.oracle.com/pls/apex/f?p=9971:2:0::NO
    If you download this report, you can see 'Long Text' is split into two or three cells.
    Any information will be welcomed.
    Thanks
    Jaenyun

    Thanks for your reply.
    If I change column display type in input form to text field from textarea, It makes to prevent to input enter key in text data.
    But I hope user can input enter key in text data. So still I need another way to download data into single cell.

  • Error while downloading output in excel format using FM Gui_download

    Hello All,
    <removed by moderator>
    While downloading the necessary output of a Ztransaction in excel format the excel file only shows one 1 record whereas in the output there were 88 records.
    When I am downloading it in other formats like Rich text etc. the data is getting downloaded correctly as per the output.
    Now this problem is occuring in Production & Quality whereas in Development the excel file is downloading data correctly.
    I have compared the code in the different clients as well as debugged it but the code is the same in each case.
    There is no data corruption in the final internal table as well.
    So what else can be done?....
    The data needs to be downloaded as it is in the output in the excel format.
    Kindly give me some suggestion and help me out in this regard.
    Edited by: Thomas Zloch on Nov 1, 2011 10:04 AM

    Hi,
    Did you the use the GUO_download using the following values:
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename         = fullpath
        filetype         = 'ASC'
        codepage         = space
        write_bom        = 'X'
      TABLES

  • Download ALV to EXcel- Urgent pls help me

    Please help me in this...
    I have an ALV report around 120 column. The report is displayed perfectly on screen. But when I use the Export option to download as an excel file, some data is missing in SAP No field
    For example
    My report output is like this
    sap No    Name    Jobdes.   Dept
    00021     AAA      clerk1      FI
    00022     BBB      clerk1      FI
    00023     CCC      clerk1      FI
    00024     DDD      clerk1      FI
    00025     EEE      clerk1      FI
    00026     FFF      clerk1       FI
    Excel output is
    sap No    Name    Jobdes.   Dept
    00021     AAA      clerk1      FI
    Blank     BBB      clerk1      FI
    Blank     CCC      clerk1      FI
    Blank     DDD      clerk1      FI
    00025     EEE      clerk1      FI
    Blank    FFF      clerk1       FI
    Pls help me

    Hi Kumar,
              Pls try the below Function Modules to download the data to excel.
    ALSM_EXCEL_TO_INTERNAL_TABLE
    KCD_EXCEL_OLE_TO_INT_CONVERT – Uploads data directly from Excel sheet
    RH_START_EXCEL_WITH_DATA – Starts Excel with contents of an internal table
    or the below links also might help you.
    For uploading Excel to Internal Table??????
    Data from Excel sheet to my internal table
    Check the following link:
    http://www.sap-img.com/abap/upload-direct-excel.htm
    or even the below code might be helpful.
    Multiple excel sheets generation in a workbook
    CREATE OBJECT EXCEL 'EXCEL.SHEET'.
    GET PROPERTY OF EXCEL 'Application' = APPLICATION.
    SET PROPERTY OF APPLICATION 'Visible' = 1.
    CALL METHOD OF APPLICATION 'Workbooks' = BOOKS.
    CALL METHOD OF BOOKS 'Add' = BOOK.
    CALL METHOD OF BOOK 'WORKSHEETS' = SHEET.
    CALL METHOD OF SHEET 'ADD'.
    Fill all the sheets with relavant data
    PERFORM SHEET1 TABLES ITAB1.
    PERFORM SHEET2 TABLES ITAB2.
    PERFORM SHEET3 TABLES ITAB3.
    PERFORM SHEET4 TABLES ITAB4.
    Quit the excel after use
    CALL METHOD OF EXCEL 'QUIT'.
    FREE OBJECT: COLUMN,SHEET,BOOK,BOOKS,APPLICATION,EXCEL. "NO FLUSH.
    CLEAR V_SHEET.
    FORM FILL_CELL USING ROW COL VAL.
    CALL METHOD OF SHEET 'cells' = CELL NO FLUSH
    EXPORTING #1 = ROW #2 = COL.
    SET PROPERTY OF CELL 'value' = VAL.
    FREE OBJECT CELL NO FLUSH.
    ENDFORM. " FILL_CELL
    FORM SHEET1 TABLES ITAB1 STRUCTURE ITAB1.
    V_SHEET = Sheet Name.
    V_NO = V_NO + 1.
    CALL METHOD OF BOOK 'worksheets' = SHEET NO FLUSH EXPORTING #1 = V_NO.
    SET PROPERTY OF SHEET 'Name' = V_SHEET NO FLUSH.
    PERFORM FILL_SHEET1 TABLES ITAB1 USING V_NO V_SHEET.
    CALL METHOD OF SHEET 'Columns' = COLUMN.
    FREE OBJECT SHEET.
    CALL METHOD OF COLUMN 'Autofit'.
    FREE OBJECT COLUMN.
    ENDFORM.
    Repeat above procedure for all sheets you want to add
    FORM FILL_SHEET1
    TABLES ITAB1 STRUCTURE ITAB1
    USING V_NO V_SHEET.
    ROW = 1.
    PERFORM FILL_CELL USING ROW 1 'Column1 Name'.
    PERFORM FILL_CELL USING ROW 2 'Column2 Name'.
    PERFORM FILL_CELL USING ROW 3 'Column3 Name'.
    ROW = ROW + 1.
    LOOP AT ITAB1.
    PERFORM FILL_CELL USING ROW 1 ITAB1-Column1.
    PERFORM FILL_CELL USING ROW 2 ITAB1-Column2.
    PERFORM FILL_CELL USING ROW 3 ITAB1-Column3.
    ROW = ROW + 1.
    ENDLOOP.
    ENDFORM.
    Repeat above procedure for all sheets you want to add
    Try this also
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    field_name = 'P_FILE'
    IMPORTING
    file_name = p_file.
    Upload Excel file
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_FIELD_SEPERATOR =
    i_line_header = 'X'
    i_tab_raw_data = it_raw
    i_filename = p_file
    TABLES
    i_tab_converted_data = i_XCEL[]
    EXCEPTIONS
    conversion_failed = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Pls reward if useful.
    THanks,
    Sirisha

  • Downloading ALV to EXCEL - in some fields the last character is missing ...

    Hi,
    I am experiencing this kind of problem when downloading ALV report into Excel :-
    "You are downloading an ALV result to an EXCEL file. In some fields the last character is missing."
    For example, if MATNR is 0000234567 in display but after downloading to excel it becomes only 23456.
    I found another related forum thread : Pronlem while downloading ALV grid to excel
    I tried the suggested method to apply OSS note 1075315. However, the note cannot be implemented in the system. I am working in a ECC6 environment (SAP version 700, 701).
    Kindly please help me if you came across the similar kind of issue. Thanks much.

    Hi gkGoh8     ,
    The link thread that you just gave already provided the answer, in your field catalog you need to activate field lzero.
    1. Check FM : REUSE_ALV_GRID_DISPLAY
    2. Import Parameter tab :IT_FIELDCAT
    3. Double click SLIS_T_FIELDCAT_ALV
    4. On type group SLIS, check line 93
    Regards,
    JQC

  • Download ALV into excel file

    Hi experts,
                   I used subtotals in ALV.first three columns I claculated based on the addition of individual column.In fourth column i calculated the value based on three calculated values ...It is  not problem.
              when i download this into excel file the original value is only coming .the calculated value i.e) calculated based on three values didnt get displayed in excel file..Help me please...
    Thank u,
    Manjula Devi.D

    Hi.
    I find that
    List > Export > Spreadsheet
    gives no subtotals, but
    List > Export > Local File and then Spreadsheet
    does give subtotals.
    I find that
    Views > Microsoft Excel
    followed by
    Save As
    does give subtotals.
    John

  • ALV to Excel Format problem

    Hello Freinds,
    I am trying to download the o/p of ALV report into an excel sheet.But the o/p in excel sheet is distorted to some extent.Some of the headers appear in the next line even if there is no limit of rows in office 2007 which is there on my machine.This issue is not on all servers.In development and quality servers the format is correct but when the same report is downloaded from Production server,the o/p appears distorted.
    Please advice as to what could be the reason !

    Hi Jazz,
    You can very well do what our friend Avinash told the easier way . 
    But if you want it to be done programmaticlly,then plz revert with the following details
    1) Whether the file is excel (any specifications)
    2) Whether any special characters are present in the int table
    3) Whether the ALV has colour and other formats
    Thanks and Regards
    Srikanth.P

  • How to download alv to excel but translate char to number  ?

    i have alv report that the user want to download the
    result to excel , ok you have two ways  :
    1) excel inplace , its work good but in big amount of
       data the option is working slow and the user
       dont want to use it .
    2) download it as local file , the problem is that
    the fields that contain the amount is char format
    due to using dynamic columnes,
    so how can i convert the field that it will be download
    to excel as number  ?
    i tried to change the fieldcatalog to :
    LS_FCAT-DATATYPE  = 'QUAN'.
    LS_FCAT-INTTYPE = 'P' .
    but its not help .
    thanks .

    hi dakota,
    you could make your own download-routine.
    before downloading you move the data in an internal table where all fields have the wanted format.
    then download it with function module "GUI_DOWNLOAD" name the file ".xls" and use filetype "DBF".
    this way you get an excel with formatted rows as you like.
    br,
    matthias

  • Download Alv into excel sheet according to variant fields

    Hi All,
    I have more than 100 fields in the ALV report, now i want to download the report according to the fields are choosen in the variant. I am getting all the fields in excel sheet but i need some fileds that is selected in the variant.
    Thanks in advance.
    Rudhir

    use your own excel button and program this steps:

    * Get the frontend fieldcatalog
    CALL METHOD go_grid->get_frontend_fieldcatalog
    IMPORTING
    et_fieldcatalog = lt_fieldcat.
    DELETE lt_fieldcat WHERE no_out EQ 'X'.

    *create dynamic table with the frontend fieldcatalog
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = lt_fieldcat
    IMPORTING
    ep_table = lt_data
    EXCEPTIONS
    generate_subpool_dir_full = 1
    OTHERS = 2.
    IF sy-subrc EQ 0.
    ASSIGN lt_data->* TO <lt_table>.
    ENDIF.
    3° Fill the dynamic table
    4° export to excel using
    CALL FUNCTION 'XXL_SIMPLE_API'
    TABLES
    col_text = xmplt_v1
    data = <lt_table>
    online_text = xmplt_o1
    print_text = xmplt_p1
    EXCEPTIONS
    dim_mismatch_data = 1
    file_open_error       =2
    file_write_error      = 3
    inv_winsys            =4
    inv_xxl                   =5
    OTHERS                = 6.
    Check the complete example here

  • DOWNLOAD ALV TO EXCEL

    I HAVE AN ALV REPORT,
    <b>1.</b>1 FIELD IS EISBE LIKE MARC-EISBE,WHEN I DOWNLOAD TO EXCEL AND I WANT TO MAKE FUNC LIKE SUM IT IS NOT MAKE NOTHING, IF I HAVE VALUE 10 AND MAKE SUM I GET 0 ZERO <b>why?</b>
    <b>2.</b> I WANT TO DOWNLOAD AND GET THE DATE IN THE EXCEL REPRORT
    I USE THIS
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                it_fieldcat = alv_fldcat
           TABLES
                t_outtab    = <dyn_table>.
    THANKS

    Hi Liat,
    Check this thread out
    'REUSE_ALV_GRID_DISPLAY' Excel-download without dialog
    Regards,
    Santosh

  • Program about download alv to excel

    i have a program,when run it ,there to be a alv display,in the alv display,the unit is 'PC',but after  download it to the excel,the unit
    'PC' all turn to '*****',does anybody know why?
    thanks for your replay.

    hi,
    first you  try to drag teh column width in the excel sheet, you may get to see the desired output.
    if its not helpful,  then you need to use conversion routine for this.
    regards
    geeta gupta

Maybe you are looking for

  • CC Crashing when copy / saving files to the network

    Example crash report below from a very active user of CC in our photo editing suite.  He claims the crashes are random and there is no pattern. This can be opening the first file of the day, or the thousandth. I have removed all the plug-ins -  this

  • Early 2009 Mac Pro:  Adding a Firewire 400 card

    I want to add a firewire 400 PCIe card to my Mac Pro as a last ditch effort to get my Presonus Firepods working properly. Presonus recommends the firewire card have a TI chipset. See my thread: http://discussions.apple.com/thread.jspa?threadID=277020

  • Database Microsoft Access

    This is my website http://www.academytexas.com/index.asp, currently I'm using Microsoft access to do the database storing and updating of News, when i upload to this sever it start giving problem of loading the page why?is because i am using microsof

  • I can't load Movie Magic scheduling on my Macbook Air. It loads fine on my Macbook Pro. Any suggestions?

    I've tried downloading directly from the Movie Magic website. I've tried loading it from an external disc drive but it keeps failing to install. It takes me all the way through the installation process but then won't open at the end. AS I mentioned,

  • Compile flexfield data in AOL tables

    Hai all, Am applying a patch, for which the post patching step is Compile flexfield data in AOL tables.. but no where i can find this under ADADMIN.. I understand that this should be under maintain database entities menu.. but not seen Any idea ? Kai