ALV grid - Autoexport to Excel

Hi!
I am creating a report using REUSE_ALV_GRID_DISPLAY. On the selection screen I have a check box. When it is checked I want the program to press the Export to Excel button for me so the ALV-grid is exported to Excel automaticly. Is that possible?
Best regards,
Patrick de Sarrazin

Hi Patrick,
do you want to download or display the ALV in Excel?
If you whant to display it in Excel execute your Program,
change in Excel and save the Layout.
If your checkbox is set move your layout to VARIANT.
and call the FM like this.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            I_CALLBACK_PROGRAM       = PROGNAME
          I_CALLBACK_PF_STATUS_SET = 'MAIN'
            I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
            I_CALLBACK_TOP_OF_PAGE   = 'TOP_OF_PAGE_GRID'
            <b>IS_VARIANT               = VARIANT</b>
            IS_LAYOUT                = LAYOUT
            IT_FIELDCAT              = FIELDCAT
            IT_SORT                  = SORT
            IT_FILTER                = FILTER
            I_SAVE                   = 'A'
            IT_EVENTS                = EVENTS
            IT_EVENT_EXIT            = EVENT_EXIT
            IS_PRINT                 = PRINT
       TABLES
            T_OUTTAB                = ITAB
       EXCEPTIONS
            PROGRAM_ERROR            = 1
            OTHERS                   = 2.
Regards, Dieter

Similar Messages

  • Hi iam getting the alv grid data in excel format but iam facing one problem

    hi iam getting the alv grid data in excel format but iam facing one problem ,
    i.e., i want it read only  but iam getting it in edit mode i use layout default in excel iam getting in xl directly but in edit mode but i need it in read only mode
    what i have to do for that  and bdy knows reply me i need it urgently.

    there's always edit-mode if you choose excel-inplace - but noone can modify/rewrite the data
    A.

  • Save ALV grid to local excel-file in background

    Hi,
    i want to save a alv grid to an excel-file on a local fileshare using an background job..
    Does anybody know how this works?
    Thanks ahead

    DATA: file TYPE string VALUE `flights.dat`,
          wa   TYPE spfli.
    FIELD-SYMBOLS TYPE x.
    OPEN DATASET file FOR OUTPUT IN BINARY MODE.
    SELECT *
           FROM spfli
           INTO wa.
      ASSIGN wa TO CASTING.
      TRANSFER TO file.
    ENDSELECT.
    CLOSE DATASET file.
    <b>The binary data from database table SPFLI is transferred to a binary file flights.dat</b>

  • ALV grid export to Excel 2003-f.01

    Hi all,
    I have an issue with ALV grid export to excel 2003 ,when i tried to download with the option as local file > xls file ,the report downloads with page breaks which the user does not want , each break comeswith header .
    With the option of list>export>xml sheet - the report downloads with out page break but with no header information like the name of the report and reporting period .The tcode is f.01 and the system is ECC6.
    Can any one suggest  how to download the report with tiltle of the report with no page break ?
    Thanks
    ske

    Hi
    What happens if you use the export/local file option - does that help at all or can you change the layout? Haven't got access to your release to check.
    Cheers
    David
    Edited by: David Berry on Oct 28, 2010 9:38 PM

  • Leading Zeros Missing - When exporting data from ALV grid display to Excel

    Hi,
    Am exporting the data from ALV GRID DISPLAY to Excel sheet using standard toolbar icon 'Local file'
    the leading zeros displayed in the ALV output is missing in the EXCEL sheet.
    (eg)  in ALV o/p - 0029. 
            in Excel - Only 29 is appearing.
    As per the requiement i have to show the leading zeros in excel also.
    Pls help on this issue.
    Thanks in advance..

    Hi ,
      Please set the property  :
      wa_fieldcat-lzero = 'X' .
    when you are creating field catalog for display alv data .
    your prob will solved .
    Regards ,
    Nilesh Jain

  • Facing problem while downloading ALV grid Output into Excel

    Hi Guys,
    I am facing problem while downloading ALV grid Output into Excel.
    It is downloading into excel, but all character columns first and next all quantity columns it is displaying. But I need columns order as it is in the grid.
    If I take all columns as characters it works fine. But it will be problem for calculating total, subtotals of quantity columns
    Can someone help me regarding this
    thanks for your help

    Hi,
    Open up Excel on your desktop. Goto Tools > Macro > Security.
    Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
    Was this your problem? Don't forget those points, either.
    check with this wetther it is solved or not.
    Regards,
    sana.

  • ALV grid to protected Excel sheet

    Hi ABAP gurus,
    I Have developed an ALV report using OO concept and from the application toolbar i am able to change  the GRID output to Excel output using View -> Excel inplace. Belows are my requirement now.
    1. I need to change the standard template with my template for this particular ALV report or Transaction. PLease provide me  with steps details to do it.
    2. The Excel sheet should be in protected  mode and user should be able to only take print out from the excel sheet without modifying any columns .
    If there is no standard way  we can add an additional  appliaction menu and  code it to download  the ALV output into an  Excel sheet and display it .  However again the User should not be able to modify the sheet. please provide me with sample code to do it.
    PLease suggest  solution for this . Point will be awarded for all valuable answers.
    Please it is very urgent for me ...
    Thanks in advance.
    Iftekhar Alam

    Hi ABAP gurus,
    I Have developed an ALV report using OO concept and from the application toolbar i am able to change  the GRID output to Excel output using View -> Excel inplace. Belows are my requirement now.
    1. I need to change the standard template with my template for this particular ALV report or Transaction. PLease provide me  with steps details to do it.
    2. The Excel sheet should be in protected  mode and user should be able to only take print out from the excel sheet without modifying any columns .
    If there is no standard way  we can add an additional  appliaction menu and  code it to download  the ALV output into an  Excel sheet and display it .  However again the User should not be able to modify the sheet. please provide me with sample code to do it.
    PLease suggest  solution for this . Point will be awarded for all valuable answers.
    Please it is very urgent for me ...
    Thanks in advance.
    Iftekhar Alam

  • Exporting ALV Grid output to Excel sheet

    Hi All,
           How can i export the output displayed using Grid to an Excel sheet. I tried with default option from list->export->excel sheet/local file but i am not getting complete data and the data which i am getting also notin proper format. Please help me in this regard.
    Best Regards,
    Sunil

    Check out the ALV grid toolbar for export options.
    Regards
    Raja

  • ALV Grid Exporting to Excel - Columns out of order

    Hi,
    In my ALV grid everything is in order as it is in the structure. When however I export to excel from ALV grid, the columns are out of order. First it lists the string columns, then number columns and lastly date columns. Is there a way to make excel keep the same order as it is in ALV grid?
    Thanks,
    Sergiy

    I am not much of an ABAPer but I was able to set the column position during data declaration with
    gs_fcat_line-col_pos = 1, for example.
    That would put the column in the first position in ALV as well as the excel export.
    Thanks for your inputs.
    Sergiy

  • ALV GRID with own EXCEL-Template

    Hallo,
    I have Problem with using ALV-Grid with a own created
    template.
    At First I copy the SAP_OM.XLS template to CUS_OM.XLS.
    Then I update it by deleting all sheets, but not RAWDATA.
    When I use this template in ALV-GRID, it would be the right one, but it his no Data.
    The security settings in Excel are correct.
    Can anyone help me to show the data like the normal
    ALV-GRID??
    thanks Dieter

    Hi
    Check this link...
    How to send data  to different tabs of an excel sheet?

  • ALV GRID Export to Excel button Missing

    HI All,
    I am facing some problem with ALV GRID. When excuting the report with my user id I am able to see the 'Export to Local file' button in the ALV GRID where as if i am excuting with another user id which is having less authorisations than the button is greyed out.  I checked by giving all authorisation than we are able to see the button.
    Could anyone please tell me which authorisation object we have to assign to see the buttons.
    Thanks & Regards,
    Murali.

    Hi,
    Before clicking on the Export to Excel button, start the debugging session by placing the command /H in the command prompt.
    Now, put the break point at statement AUTHORITY-CHECK. Now it will trigger all the authorization objects relevant to this.
    check the sy-subrc value gets failed.
    Regards,
    Santhosh.

  • ALV Grid output to Excel Spreadsheet

    I have one that is hopefully easy for you guys and when I search on the forum nothing comes up.
    Maybe I am searching wrong.
    When you have a program that outputs to an ALV grid, there is a button you can output to a file.
    Like an excel document. Icon is a document with an x on it.
    First time you run it, it will give you the option of excel, star office, or all available formats.
    There is also a button at the bottom that says Always Use Selected Format. User
    wants to change this, but once the option is gone, you cannot undo it.
    How do I basically deactivate the button to not always use the selected format???
    Any suggestions would be terrific.
    Thanks for your help.
    Steve

    Steve,
    Try running report SALV_BS_ADMIN_MAINTAIN as indicated in [Note 1080608|https://service.sap.com/sap/support/notes/1080608]. 
    I found this Note with the following search string: "Always Use Selected Format ALV Excel".  You may also want to consider doing a search on the report name "SALV_BS_ADMIN_MAINTAIN" for further information.
    Also check [Note 1157927|https://service.sap.com/sap/support/notes/1157927] "Export Excel: Reset export parameter from ALV list."
    Best Regards,
    Jamie
    Edited by: James Gaddis on Nov 19, 2008 2:47 PM  - Added another Note reference

  • ALV Grid Download to Excel - Columns in wrong order

    I'm using the object cl_gui_alv_grid to output an ALV grid to the screen.  I've populated the field catalogue as follows:
    wa_alvfieldcat-col_pos = 1.
    wa_alvfieldcat-just = 'L'.
    wa_alvfieldcat-reptext = 'Customer Name'.
    wa_alvfieldcat-scrtext_s = 'Customer'.
    wa_alvfieldcat-scrtext_m = 'Customer'.
    wa_alvfieldcat-scrtext_l = 'Customer Name'.
    wa_alvfieldcat-outputlen = 35.
    wa_alvfieldcat-tabname = 'GTBL_REPORT'.
    wa_alvfieldcat-fieldname = 'CUST_NO'.
    The screen shows the table correctly in the order I've specified using COL_POS.  But when I select the download function from the ALV grid it moves all the date fields to the end instead of using the order I wanted.
    Any ideas?

      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'ZCONTRACT_REPORT'
        CHANGING
          ct_fieldcat      = tbl_alvfieldcat.
    then
      LOOP AT tbl_alvfieldcat INTO wa_alvfieldcat.
        MOVE 'GTBL_REPORT' TO wa_alvfieldcat-tabname.
        CASE wa_alvfieldcat-fieldname.
          WHEN 'DATE_ORDER'.
            wa_alvfieldcat-col_pos = 4.
            wa_alvfieldcat-just = 'L'.
            wa_alvfieldcat-reptext = 'Date Order'.
            wa_alvfieldcat-scrtext_s = 'Date Order'.
            wa_alvfieldcat-scrtext_m = 'Date Order'.
            wa_alvfieldcat-scrtext_l = 'Date Order'.
            wa_alvfieldcat-outputlen = 10.

  • ALV grid Download to excel not working

    Hi All,
    I am displaying an Alv list using the function Module
    REUSE_ALV_GRID_DISPLAY.
    The report is getting displayed correctly..But when Iam trying to downlaod the same in excel.It does not get downloaded correctly.
    All the fields get downloaded into one column of excel sheet.
    CAn anyone tell me what's going wrong on this.
    Thanks
    GT

    Hi GT,
    try this way,
    save as local file this option available on the grid.
    and while giving the file name give the name what you want with extension .xls
    then check that file all the data will be opend in excel sheet.
    http://help.sap.com/saphelp_erp2004/helpdata/en/e3/41a138c4397a42e10000009b38f842/frameset.htm
    reward points for helpfull answers and close the thread if your question is solved.
    regards,
    venu.

  • Problem in ALV grid download to excel

    Hello Gurus,
    I have a ALV report which has 40 columns but at a time it will only display 100 records(max). when I am trying to download it into excel (by using standard funcationality) only headings are getting downloaded. I checked out standard table download like MARA,VBAK but they are downloading properly.
    what could be the reason..?
    Thanks in advance.
    Thanks and Regards,
    Saurabh Chhatre

    Hi,
    i am implementing alv by grid method using function module. By my previous experience u do not need to do anything to get the alv in excel format(std. funcationality is provided by SAP itself). But this is not working right now .. apart from headings nothing is coming in file download.
    thanks and regards,
    saurabh chhatre

Maybe you are looking for

  • MCS-7835-H3 Hard Disk Led Amber Alarm

    Hello Everybody, I have a MCS-7835-H3 Server, running DMS 5.2.1. The Server has 4 hard disk, (300Gb every disk). I've noticed one hard disk is alarmed, the led is color amber. I was looking for some documentation about this but i can't find anything.

  • Problem installing ofbiz

    hi all, I want to install OFBIZ at windows XP. I have deployed the database successfully.but now i am facing a problem i.e java.lang.nosuchmehoderror exception error: java.nio.bytebuffer.array()i shall be thankfull if someone solves my problem wasim

  • Coding standards and naming convention

    Hi, Can anyone please provide any documentation available for BPM development. Would really appreciate for any pointers. Edited by: 905033 on Oct 23, 2012 2:54 AM

  • Thosand Separator in Smartform

    How do I display Thousands separator in text element window of the Smartforms ?? Like the value 1234.00 I wan to display it as 1,234.00 Thanks.

  • Query to Total Attendance by Months

    I need the following totals for each student based on the schools that they are enrolled for each month July through June. Total Days Suspended from each school Attendance Table Columns - Absent Date, Absent Code, Pupil_Number, School (Absent Codes f