Download of complete report in excel-S_ALR_87013533

Hi Gurus
How can we download the report S_ALR_87013533 completely in excel sheet
Thanks in advance
Regards
Abhijit Sen

Hi Abhijit,
Have u tried this?
Go to S_ALR_87013533 --> Select classical Drilldown
Click On Export--> On the Export to presentation Screen Give Output File Path ( You give this as .dat File ) and click on Enter.
The DAT file will be saved on the location specified by you.
Then open this file with Excel.
Regards,
Amit

Similar Messages

  • Problem while downloading a ALV report to excel

    Hi experts,
    I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
    There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
    Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
    But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
    regards,
    charles.

    If anybody have any solution please send me....

  • Download the alv report in excel

    dear experts
    I am creating ALV report and working fine, i want the report sould be viewed in excel format when i click the icon on AlV display
    with regards.
    Ajay Kumar.

    Hi Ajay,
    SAP has provided the user interface for downloading the data into an excel file in the tool bar there is an option for downloading into excel.
    Another way is to write a code using the function module alsm_excel and then downloading into the excel,
    please tell me whether this reply was useful or for further clarification revert back
    Thanks in advance
    Srikanth

  • Download custom generated reports in Excel from ITS

    Hi All,
    We have generated some custom reports and have used ALV reporting. Now from the GUI we are able to download the report in excel but from the ITS this functionality is not working,
    Has anybody idea how to achieve this for the custom reports.
    Thanks,
    Smita

    Hi Luciano,
    Thanks for your reply. I am really lost with your question. Before we were not able to download the standard SAP report and then we upgraded our Java Virtual Machine to V1.4 and its working for the standard report.
    Now my problem is that I am not able to download it from the custom generated report.
    As soon as I am clicking on export to local file the report screen is getting blank and not allowing for any further action.
    Any clue?
    Thanks,
    Smita

  • How can i download dynamic alv report into excel  ?

    when i create dynamic alv report and try to download it
    to my pc ( to excel file ) the data is not set in the
    write position , also i get message in the excel
    "Dynamic List Display " .
    how can i set the data like the alv display ?

    ALV has standard download functionality to Excel. Aren't you able to use this functionality? Have you written your own custom code for DOWNLOAD?

  • Excel Download to ALV report

    Hi Guys,
    I’m facing a peculiar problem.
    When I try to download an ALV report in excel format using (list ->export -> local file-> soread sheet )I’m not able to download complete set of records.
    Same is happening with ws_download,  even though the internal table contains all the record; the number of downloaded records are not same.
    Any one faced same problem. Pls. help me out.
    Regards,
    Sumit

    looks strange!!!!!!!!!!!
    change these in excel sheet and check out if it works
    Change the macro settngs in your excel sheet and checkout if it works
    Open empty excel sheet
    In menu Tools>Macros>Security , change the radiobutton to medium
    And also
    In the Same popup , goto the second tab Trusted Publishers and check the checkbox Trust access to visual basic Project

  • 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

  • Download ALV report to excel sheet

    halo fellow SAPiens,
    i want to download my alv report into excel sheet...........for tht i used UGI_DOWNLOAD........here if i use the file type as 'ASC' all the leading zeros of numeric values are removed and date format is "yyyy/mm/dd".......
    i need the leading zeros and date format in "dd/mmyyy"
    when i use file type 'DBF' i get the leading zeros but my date is replaced by '#####.............wht shld i do...........

    To get the leading zeros to come, append an apostrophe to the start of each field that has the leading zeros as shown
    loop at itab.
    concatenate '''' itab-field1 into itab-field1.
    modify itab.
    endloop.
    note that
    1. This sometimes doesnt show correctly in excel and you may have to double click on the cell to prevent the apostrophe from displaying in the sheet
    2. You field needs to have an extra character to add the apostrophe

  • Reg: Download report into Excel file

    Hi All,
    While downloading the ALV report into excel file(System -> List -> Save -> Local file) or (List -> Export -> Local file), i cannot download full report in to excel. Even though the report contains just 200 rows(I can able to download about 90 lines).
    Some reports can able to download all the data, even the report is very big. Currently I am blind to solve, anyone can help me to solve this issue.
    Thanks in advance.

    The most elegant way of downloading ALV display data to EXCEL is displaying the excel in the SAP GUI screen itself.  Select "Excel in Place" and then save it from there. Before that you need to let the VB script of SAP know as trusted macro. This is done by opening a blank excel file then go to Tools > options > Security > Macro Security > Trusted Publishers (tab) > (check) Trust access to Visual Basic Project.  This activation is one time activation. Once you do this you can see ALV display exactly like in normal ALV with all the colors fields etc.

  • Problem in downloading ALV report to Excel

    hi All,
    i am facing the problem when i am trying to download the ALV report to Excel format i should have the option to  save as  the Excel file from the dropdown where as instead of it i am getting the option to save as XML file.
    is it something related to settings in SAP or is it done through programatically.
    thanks,

    Anyways is this happening for every one in your team or just for one. If the latter, looks like the user has selected the download in XML format & checked the "remember these settings" checkbox
    You can refer to this link on how to change the default settings: [http://home4sap.com/Blog/2010/03/ecc5-0-alv-default-file-format-when-extracting-files-to-excel/|http://home4sap.com/Blog/2010/03/ecc5-0-alv-default-file-format-when-extracting-files-to-excel/]
    You can also check this SAP offers the possibility to make from transaction FAGLB03 a download
    Edited by: Suhas Saha on Apr 13, 2010 4:40 PM

  • Download alv report to excel 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 ?
    Edited by: Vinod Iyer on Jan 8, 2008 11:51 AM

    The problem of course is that you can't actually call up EXCEL on a Linux machine so such XXL functions  as  call function 'ALV_XXL_CALL' will not work.
    I don't think SAP has OPEN OFFICE integration -- and even if you use EXCEL via the Linux Cross Over Office it is unlikely to work.
    You might need to fiddle around with the internal file format yourself before saving it as a local file.
    For EXCEL 2007 you actually have a better chance since if you save in TRUE EXCEL 2007 format the data is saved in a type of XML file.
    You can read about the EXCEL 2007 new file formats on the M$ site. Note however that you will need to download the EXCEL 2007 file viwer to read the file with earlier versions of EXCEL.
    (You can use EXCEL 2007 in "compatability" mode but using an XML file IMO seems a better option).
    If you use a lot of EXCEL functionality probably the best option is to install Windows as a VM on your linux machine (VMWARE/PARALLELS/VMBOX etc) and then run the standard SAPGUI from the Windows VM.
    Probably not the answer you want but it's the best I can do.
    Cheers
    jimbo

  • Exporting a query report in Excel gives a wrong value.

    Hi All,
    After running the query report, from the menu path, I do List > Export > Spreadsheet.  At that point, you can save the file and Excel opens up.  The value for the amount are displaying with additional zeroes
    For example 14,000.00  is dispalyed as 14,000,00.00
    Please let me know the if you have solution for this are related OSS note for this
    Thanks,
    Karthikeyan.

    Hi David,
    Thanks for your response.
    The OSS notes are related to ALV display where when i check with other ALV program and export it is giving a correct total.Where when i download the qurey report in excel using file-> export to option i am getting  a additional zeroes.
    Please let me know if there is any other solution for this.
    Thanks for your help in advance.
    Thanks,
    Karthikeyan.

  • Problem when down loading a simple report to Excel sheet

    HI Frenz,
    When I download a Simple report to excel , The Excel shows a blank column in between two column, which should not be the case.
    Kindly let me know ASAP
    Regards
    Irfan

    Hi,
    Check out the below samle code
    Download a report to excel with format (border, color cell, etc) 
    REPORT ZSIRI NO STANDARD PAGE HEADING.
    * this report demonstrates how to send some ABAP data to an
    * EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    * handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_MAPL TYPE OLE2_OBJECT,         " list of workbooks
          H_MAP TYPE OLE2_OBJECT,          " workbook
          H_ZL TYPE OLE2_OBJECT,           " cell
          H_F TYPE OLE2_OBJECT.            " font
    TABLES: SPFLI.
    DATA  H TYPE I.
    * table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
    * read flights
      SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    * display header
      ULINE (61).
      WRITE: /     SY-VLINE NO-GAP,
              (3)  'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (4)  'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (8)  'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
      ULINE /(61).
    * display flights
      LOOP AT IT_SPFLI.
      WRITE: / SY-VLINE NO-GAP,
               IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
      ENDLOOP.
      ULINE /(61).
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = TEXT-007
           EXCEPTIONS
                OTHERS     = 1.
    * start Excel
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    *  PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    *  CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
    *  PERFORM ERR_HDL.
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = TEXT-008
           EXCEPTIONS
                OTHERS     = 1.
    * get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      PERFORM ERR_HDL.
    * add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
      PERFORM ERR_HDL.
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    * output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    * copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    * changes by Kishore  - start
    *  CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    * add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    * tell user what is going on
      SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    * output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    * copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    * changes by Kishore  - end
    * disconnect from Excel
    *      CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING  #1 = 'C:\SKV.XLS'.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
    *       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 H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL.
    ENDFORM.
    *&      Form  ERR_HDL
    *       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
    Cheers,
    Chandru

  • Down loading an ALV report in EXCEl

    my ALV report contains 76 columns, if i try to download it in an excel sheel its not getting displayed in correct format.
    Few columns are automatically displayed in the second row and also all my values are getting collapsed due to this display.
    In the print preview also i am getting the same problem.
    Is there any column limit in ALV display or i can make it to get display correctly as it is in the exact output.

    Hi,
    here is an example of downloading an alv report in excel...
    Download a report to excel with format (border, color cell, etc) 
    Try this program...it may help you to change the font ..etc.
    Code:
    REPORT ZSIRI NO STANDARD PAGE HEADING.
    this report demonstrates how to send some ABAP data to an
    EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_MAPL TYPE OLE2_OBJECT,         " list of workbooks
          H_MAP TYPE OLE2_OBJECT,          " workbook
          H_ZL TYPE OLE2_OBJECT,           " cell
          H_F TYPE OLE2_OBJECT.            " font
    TABLES: SPFLI.
    DATA  H TYPE I.
    table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
    read flights
      SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    display header
      ULINE (61).
      WRITE: /     SY-VLINE NO-GAP,
              (3)  'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (4)  'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (8)  'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
      ULINE /(61).
    display flights
      LOOP AT IT_SPFLI.
      WRITE: / SY-VLINE NO-GAP,
               IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
      ENDLOOP.
      ULINE /(61).
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-007
           EXCEPTIONS
                OTHERS     = 1.
    start Excel
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
    PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-008
           EXCEPTIONS
                OTHERS     = 1.
    get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
      PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - start
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    tell user what is going on
      SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - end
    disconnect from Excel
         CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING  #1 = 'C:\SKV.XLS'.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
          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 H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL.
    ENDFORM.
    *&      Form  ERR_HDL
          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

  • How to convert ALV report to Excel ??

    Hi,
    My requirement is to show ALV report in the excel .
    I have 2 radio buttons in Selection screen :
    1)  ALV  format                           2) Excel.
    If excel is selected then user will give a path : C :\newexcelreport.xls
    I knew that there is a way to download report through ALV report using download into local file. But the requirement is to create a report in Excel same like ALV report .
    I tried using GUI_Download . But it is displaying some fields wrongly, ex : Date , Time, without header .
    Date is showing year month date format in the excel .
    time is showing in a numeric format.
    But the ALV report is showing correct report . When I download into local then the report is showing correct results .
    Is there any function module to download exact ALV report into excel .??
    Thanks & Regards,
    Varma

    Use the FM - ALV_XXL_CALL. here is the sample -
    REPORT  ZSKC_ALV_XXL.
    TYPE-POOLS : KKBLO.
    DATA : ITAB LIKE T100 OCCURS 0,
           T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
           T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
    START-OF-SELECTION.
    Get data.
      SELECT * UP TO 20 ROWS
      FROM   T100
      INTO   TABLE ITAB
      WHERE  SPRSL = SY-LANGU.
      CHECK SY-SUBRC EQ 0.
    Create the field catalog.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
          I_STRUCTURE_NAME             = 'T100'
        CHANGING
          CT_FIELDCAT                  = T_FCAT_LVC[]
        EXCEPTIONS
          INCONSISTENT_INTERFACE       = 1
          PROGRAM_ERROR                = 2
          OTHERS                       = 3.
      CHECK SY-SUBRC EQ 0.
    make sure you pass the correct internal table name in the field catalog.
      t_fcat_lvC-tabname = 'ITAB'.
      MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
    Transfer to KKBLO format.
      CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
        EXPORTING
          IT_FIELDCAT_LVC                 = T_FCAT_LVC[]
        IMPORTING
          ET_FIELDCAT_KKBLO               = T_FCAT_KKB
       EXCEPTIONS
         IT_DATA_MISSING                 = 1
         IT_FIELDCAT_LVC_MISSING         = 2
         OTHERS                          = 3.
      CHECK SY-SUBRC EQ 0.
    Call XXL.
      CALL FUNCTION 'ALV_XXL_CALL'
        EXPORTING
          I_TABNAME                    = 'ITAB'
          IT_FIELDCAT                  = T_FCAT_KKB
        TABLES
          IT_OUTTAB                    = ITAB[]
        EXCEPTIONS
          FATAL_ERROR                  = 1
          NO_DISPLAY_POSSIBLE          = 2
          OTHERS                       = 3.
      IF SY-SUBRC <> 0.
      ENDIF.

Maybe you are looking for