ALV Excel View Problem

Hi All,
    I have a problem with the ALV display problem.
    When I click on the 'Microsoft Excel View' button at the top of the ALV display, I can view the data in Excel View.
    However, when my user click it on his computer, he saw the excel view is blank without data (even there are data at the initial ALV display screen).
    May I know what is the root cause of this problem? I've no idea of how to investigate it or solve it.
    Many Thanks.

HI try with this code------
*& Report  ZTEST_DOWNLOAD1
report  ztest_download1.
tables : trdir.
type-pools: slis.
types: begin of gt_output,
        progname type progname,
        strct_type(14) type c,
        strct_name(50) type c,
        serial(8) type c,
        mainfieldname(50) type c,
        offset(17) type c,
        leng(8) type c,
        decimals(8) type c,
        inttype(15) type c,
        datatype(9) type c,
        scrtext_m type scrtext_m,
        tabname type tabname,
        fieldname type fieldname,
        rollname type rollname,
        domname type domname,
        default(100) type c,
        end of gt_output.
types: begin of gt_header,
        name(300) type c,
end of gt_header.
data : gi_output type standard table of gt_output,
       wa_output type gt_output,
       gi_header   type standard table of gt_header.
data: d_filename like ibipparms-path,
      gi_fieldcat type slis_t_fieldcat_alv,
      wa_fieldcat type slis_fieldcat_alv,
      wa_header type gt_header.
selection-screen:
begin of  block b1 with frame title text-001.
parameter: program(150) type c default 'ZTOOL_TEST'.
select-options so_incl for trdir-name default 'ztool_test' no intervals .
selection-screen begin of line.
parameters :pa_check as checkbox default 'X'.
selection-screen comment (29) text-t01.
parameters :pa_path type rlgrap-filename default 'D:\TRIAL.XLS'.
selection-screen end of line.
selection-screen end of block b1.
at selection-screen.
  perform download_excel_template.
at selection-screen on value-request for pa_path.
  perform f4_file_help.
*&      Form  F4_file_help
      text
-->  p1        text
<--  p2        text
form f4_file_help .
  call function 'KD_GET_FILENAME_ON_F4'
    exporting
      program_name  = sy-repid
      dynpro_number = syst-dynnr
      field_name    = pa_path
    changing
      file_name     = d_filename
    exceptions
      mask_too_long = 1
      others        = 2.
  if sy-subrc <> 0.
   MESSAGE ID gv_msgid TYPE 'I' NUMBER 000.
  endif.
endform.                    "f4_file_help
form download_excel_template .
  refresh gi_header.
  wa_header-name = text-t01.
  append wa_header to gi_header.
  wa_header-name = text-t02.
  append wa_header to gi_header.
  wa_header-name = text-t03.
  append wa_header to gi_header.
  wa_header-name = text-t04.
  append wa_header to gi_header.
  wa_header-name = text-t05.
  append wa_header to gi_header.
  wa_header-name = text-t06.
  append wa_header to gi_header.
  wa_header-name = text-t07.
  append wa_header to gi_header.
  wa_header-name = text-t08.
  append wa_header to gi_header.
  wa_header-name = text-t09.
  append wa_header to gi_header.
  wa_header-name = text-t10.
  append wa_header to gi_header.
  wa_header-name = text-t11.
  append wa_header to gi_header.
  wa_header-name = text-t12.
  append wa_header to gi_header.
  wa_header-name = text-t13.
  append wa_header to gi_header.
  wa_header-name = text-t14.
  append wa_header to gi_header.
  wa_header-name = text-t15.
  append wa_header to gi_header.
  wa_header-name = text-t16.
  append wa_header to gi_header.
  wa_output-strct_name = 'abc'.
  append wa_output to gi_output.
  call function 'MS_EXCEL_OLE_STANDARD_DAT'
    exporting
      file_name                 = pa_path
      data_sheet_name           = 'Structure details'
    tables
      data_tab                  = gi_output
      fieldnames                = gi_header
    exceptions
      file_not_exist            = 1
      filename_expected         = 2
      communication_error       = 3
      ole_object_method_error   = 4
      ole_object_property_error = 5
      invalid_pivot_fields      = 6
      download_problem          = 7
      others                    = 8.
  if sy-subrc <> 0.
   MESSAGE ID gv_msgid TYPE 'E' NUMBER 002.
  endif.
endform.                    " DOWNLOAD_EXCEL_TEMPLATE
regards
prashant

Similar Messages

  • Excel View Problem

    Hello,
    I have an ALV report.  The output of the report is OK.  But, when I see it in Excel view(Ctrl + Shift + F7), then also data output is coming in the proper format.  But, the only problem is I don't see my Header informations(Report Headings/Subheading) in any of the sheet even not in the RAWHEADER sheet also.  Does anybody have any idea why the Header  informations are not coming in Excel view.
    Thanks and regards,
    Ajay Ahuja

    hi ajay,
               In the EXCEL VIEW u have the HEADER as the FIRST ROW IN EXCEL SHEET..
               i have sent a sample code of mine..u can check it also... hope u will have ur problem solved..
    TYPE-POOLS slis.
    TYPES  :BEGIN OF ty_mm,
            sl_no type i,
            werks TYPE marc-werks,
            matnr TYPE mara-matnr,
            maktx TYPE makt-maktx,
            mtart TYPE mara-mtart,
            volum TYPE mara-volum,
            ntgew TYPE mara-ntgew,
            ersda TYPE mara-ersda,
            laeda TYPE mara-laeda,
            END OF ty_mm.
    DATA :       it_mm TYPE TABLE OF ty_mm,
                 wa_mm TYPE ty_mm.
    field catalog declaration, only if u do so u can display heading in alv            
    DATA :       it_fc TYPE slis_t_fieldcat_alv,
                 wa_fc TYPE slis_fieldcat_alv.
    PARAMETERS : p_werks TYPE marc-werks.
    SELECT  marc~werks
            mara~matnr
            makt~maktx
            mara~mtart
            mara~volum
            mara~ntgew
            mara~ersda
            mara~laeda
    FROM marc
    INNER JOIN mara  ON marcmatnr = maramatnr
    INNER JOIN makt  ON maramatnr = maktmatnr
    INTO CORRESPONDING FIELDS OF TABLE it_mm
    WHERE marc~werks = p_werks and spras = 'EN'.
    loop at it_mm into wa_mm.
    wa_mm-sl_no = sy-tabix.
    modify it_mm from wa_mm transporting sl_no .
    endloop.
    this is how u append the header to an alv grid
    wa_fc-col_pos = 1.
    wa_fc-seltext_l = 'SLNO'.
    wa_fc-fieldname = 'SL_NO'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    wa_fc-col_pos = 2.
    wa_fc-fieldname = 'WERKS'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-ref_fieldname ='WERKS'.
    wa_fc-ref_tabname = 'MARC'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    wa_fc-col_pos = 3.
    wa_fc-fieldname = 'MATNR'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-ref_fieldname ='MATNR'.
    wa_fc-ref_tabname = 'MARA'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    wa_fc-col_pos = 4.
    wa_fc-fieldname = 'MAKTX'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-ref_fieldname ='MAKTX'.
    wa_fc-ref_tabname = 'MAKT'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    wa_fc-col_pos = 5.
    wa_fc-fieldname = 'MTART'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-ref_fieldname ='MTART'.
    wa_fc-ref_tabname = 'MARA'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    wa_fc-col_pos = 6.
    wa_fc-fieldname = 'VOLUM'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-ref_fieldname ='VOLUM'.
    wa_fc-ref_tabname = 'MARA'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    wa_fc-col_pos = 7.
    wa_fc-fieldname = 'NTGEW'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-ref_fieldname ='NTGEW'.
    wa_fc-ref_tabname = 'MARA'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    wa_fc-col_pos = 8.
    wa_fc-fieldname = 'ERSDA'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-ref_fieldname ='ERSDA'.
    wa_fc-ref_tabname = 'MARA'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    wa_fc-col_pos = 9.
    wa_fc-fieldname = 'LAEDA'.
    wa_fc-tabname = 'IT_MM'.
    wa_fc-ref_fieldname ='LAEDA'.
    wa_fc-ref_tabname = 'MARA'.
    wa_fc-hotspot = 'X'.
    APPEND wa_fc TO it_fc.
    CLEAR wa_fc.
    fn module to display alv grid
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        i_grid_title       = 'PLANT'
        it_fieldcat        = it_fc[]
      TABLES
        t_outtab           = it_mm
      EXCEPTIONS
        program_error      = 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.
    regards
    Rajkumar.G

  • ALV Excel download problem

    Hi,
    I am trying to download ALV report to excel but the columns in the o/p is appearing in two rows.
    THe ALV report has 82 columns in o/p.Is there any restriction on the no of columns that can be downloaded in excel.Please help.
    Thanks,
    Sutapa.

    Hi Sutapa,
    Kindly go through this link below for ALV Excel Download:
    Re: how to view alv grid output in excel format(not downloading to pc)
    Hope it helps
    Regrds
    Mansi

  • ALV Excel view missing data on last row

    Hi all,
    I'm having a bug using ALV report.
    I've created a report using "REUSE_ALV_GRID_DISPLAY" FM with the standard user command "USER_COMMAND".
    In this menu, there is the bouton "Microsoft Excel" (CtrlShiftF7) that allows to switch the ALV to an excel view.
    My report has 21 columns.
    If I'm displaying 38 rows, the excel view is fine.
    But if I'm displaying 39 rows, the last 5 cells are empty...
    Does somebody has any idea of what could be the reason ?
    Thanks for your help.
    Pierre

    Hi Andreas,
    I didn't apply the note you mentionned because it was already done on my system.
    But I've found another one that was related to "your" note and it fix my issue.
    The note is 1115435.
    Thanks for your help.
    Best regards,
    Pierre

  • IPad - excel viewer problem

    Hi
    I have a serious problem with my iPad.  I'm going to the Olympics in London and I receive a lot of excel documents in email and I use the excel viewer to go through time results etc.  Here is the problem: On a PC using latest version of MS Excel we use custom format for time results in swimming.  There we use the format hh:mm:ss,00 which return normal times in swimming like 24,79 or 1:01,97 - we use , (comma) as a decimal seperator. On my iPad these times comes in excel viewer as 24.00 and 1:01.00.
    I don't have to explain further, this is absolutely a turnoff.  I can't use my iPod on the OL with this "error" so I', trying to push forward an enhancement request.
    Thanks,
    Ragnar +354 896 0609

    If you wish to report this issue to Apple, use their feedback page:
    http://www.apple.com/feedback/ipad.html
    It's unlikely that anyone at Apple in a position to do anything about such an error will see your post here. Do not expect this to be corrected quickly, if at all.
    For now, you may want to try one of the third-party apps that support Excel documents. Apple makes an iOS versions of Numbers which can import Excel documents. There are also 3rd party combined suites that cost less than the separate Apple apps. Ones often recommended include Documents 2 Go,  Quickoffice and Office2 HD. Whether any of them can handle custom time formats I don't know, but you could ask the developer.
    Regards.
    P.S. It's usually not a good idea to post your phone number in an open forum. The only calls you'll get when you do so are from scammers and telemarketers.

  • ALV Excel Download problem ( Special Character)

    Hi,
    I am unable to download completely in XLS format from ALV grid. When i tried in couple of ways there is a special character( " ) in one of the filed. Due to the same Excel download has some problem. I tested by removing those and it worked fine, 
    Please suggest me to solve the issue.
    Thanks,
    Bhanu Gattu,

    Data strings with special characters can not be downloaded into XLS format from ALV grid. In my case, I replaced the special character " with space and I could download the data into excel.

  • ALV Excel View - how to save the excel sheet

    Hi,
    i've a colored ALV, when the user is choosing the excel button from the ALV menu bar the alv is shown as an excel. But: the sace button in the upper left corner has now a mouse-over text named "update" and the file tab is missing.- So how can he save this now as an excel sheet? We are using excel 2010. Saving as spreadsheet is not an option cause all colors are lost.

    We have had this same issue since we upgraded to EXCEL-10.
    Here is what I came up with.
    First, open a new EXCEL spreadsheet from the PC (not from within the SAP application)
    Select the “Customize Quick Access Toolbar”, then select “More Commands”
    Under the “Popular Commands” select “Save As” and press the “Add” button.
    Then the “OK” button
    You should now see the “Save As” button in the upper left hand corner of the screen (with the Save, Undo and Redo buttons.)
    When you display the next SAP report as EXCEL, you should have access to this button.

  • ALV Grid and Excel view

    Hi,
    I'm searching anywhere on this forum for a solution but up to now I did only partial progress.
    I've already seen dozens of sap notes about this problem.
    When I pressed "view in Microsoft Excel" (code &VEXCEL) on an ALV grid list, a popup appeared noticing that no template was found. Looking around on this forum I managed to discover how to load these templates from local (BC_ALVEXCEL_SAP_TEMPL, BCALV_BDS_MAINTENANCE) or from client 000 (BCALV_BDS_IMPORT_SAP_TEMPLATE).
    Anyway, I managed to restore the templates on the system, but excel view still doesn't work:
    wheh I press the button now I only see a blank screen in place of the excel; if excel was already open (not in sap), then an excel view is actually shown, but the sheet is empty, no data in it.
    Any hints?
    thank you

    Hi,
    Just open Excel, then Goto Menu -> Tools -> Options -> Security Tab -> Macro Security ->Set Medium and in Trusted publisher tab select the checkbox Trust Access to Visual Basic Project Now Press Ok.
    This will solve your problem.
    Regards
    Karthik D

  • ALV to excel download problem through standard tool bar

    I am downloading data into excel from ALV , When there are 128 column data in execl coming as 2 row for 1 row of data in alv. This problem is not there for 78 columns report.
    Kindly suggest some solution.

    i think there is a limit to the number of columns for ALV and which is i think 92 ..this can be the cause of the issue
    amit

  • How to open an ALV (the OO way) in Excel-View  right away?

    Dear experts,
    i'm creating an ALV Grid by using method set_table_for_first_display and I wonder if I can initially choose the Excel-view for it as if the user had switched over to it by using the standard "view" function. I figured that this might be posible by using the "FRONTEND" field in the Layout-structure, but this has no efect. Does anybody know how to do that? (if possible without creating an instance of the office integration class).
    regards
    Andreas

    Yeah, it is possible
    Check this code
    *   Container auxiliar
        create object g_o_container
          exporting
            container_name              = 'G_D_CONTAINER'
          exceptions
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            others                      = 6.
        create object g_d_grid
          exporting
            i_parent          = g_o_container
            i_parentdbg       = cl_gui_custom_container=>default_screen
          exceptions
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            others            = 5.
      endif.
      perform layout.
      perform fieldcat.
      call method g_d_grid->set_table_for_first_display
       exporting
          is_layout                     = gs_layout
    *     is_print                      =
    *     it_special_groups             =
    *     it_toolbar_excluding          =
        changing
          it_outtab                     = g_t_alv
          it_fieldcatalog               = g_t_fieldcatalog
        exceptions
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4
    The key is using the i_parentdbg parameter when creating the ALV Grid, it's kind of a trick, but it worked for me.

  • Excel view in ALV Grid---- Urgent

    Hi,
    On executing sample porgram BCALV_FULLSCREEN_DEMO, we get ALV grid display. After that, on Clicking "<b>Microsoft Excel View(controlshiftF7)</b>" we are getting blanck Excel screen view instead of the field values.
    I have the same scenario requirement in real time. I want the excel screen with values from ALV Grid.
    Thanks in Advance.
    -Mohan.

    Hi Mohan,
    Try this:
    Download Data in EXCEL from ALV list display
       1) Once you have alv report displayed in the screen.
       2) Click button 'View' ( next to print button) on application toolbar
       3) Select Excel in Place
       4) This will download the same format as of Report
    I hope your ALV have all the Standard functions in Toolbar. If not copy the status from and get the function as mentioned above.
    <b>Program - SAPLSALV
    Status  -  STANDARD</b>
    Reward points if this Helps.
    Manish

  • Excel View from an ALV Report

    Hi,
    How I can use the Excel View correctly?. I have a User that want to see this view from an ALV Report. The user clicks on "Views" -> "Microsoft Excel" then in the ALV area appears the excel workarea but all the cells are blank.
    Is there an option or previous configuration than make the data appear?
    Regards,
    CL

    carlos,
    Check this out.
    1) To change the current layout, show additional information, or hide unnecessary information, choose  next to  and then Change Layout. 
    The Define Layouts dialog box appears. All of the fields displayed in the report are listed in the left column. All of the available information you can display is listed in the right column. This information is grouped. Through the list box, you can select a certain field group and display the available fields in the right column.
    Make the desired changes and select  Enter.
    2) Select the desired fields and use the arrow keys to transfer the selected fields or all fields. These fields are now shown in the left column.
    3) End your selection with Enter. The layout you have defined is applied to the report immediately.
    4) To save this selection, select Save. Name your layout. The name of the layout must begin with a slash (/) or with a letter (user-specific).
    5) Decide whether you want to save the layout as a user-specific layout. If you save it as a user-specific layout, it is only available to you. If you don’t save the variant as a user-specific layout, it is also available to other users.
    Hope this helps u,
    Regards,
    Nagarajan.

  • How to automate ALV to Excel View selection?

    How to automate ALV to Excel View selection?
    I'd like to view ALV data in Excel sheet. The standard way is to select "View" tab in "Change Layout" window, then click "Excel" radio button, then I should select document template from list, then I should select it again, then I need to press "Copy" button.
    This is very long way! Is it possible to do it automatically, without multiple selection and pressing lots of buttons.

    Hello Vladimir,
    Use FM 'XXL_SIMPLE_API ' or XXL_FULL_API .
    Also go thru the link :
    http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm

  • Excel viewer not installed problem

    Dear all,
    i am getting error message  "excel viewer not installed"  with error code UMC030  .
    Getting this error message when running a report under management cockpit walls.
    Any help?
    thanks
    john

    ok its sorted

  • Excel view-very urgent

    Hi
    In my alv grid display i am not able to view the content in excel view .how to solve this problem?

    Hi
    There will be something wrong with the PF status which you are using
    Take some STd ALV report and copy its status to your report and use that
    it will come
    Regards
    anji

Maybe you are looking for

  • Getting on a domain

    Just got a iMac for the office with Tirger; however, we cannot connect to the network domain. Tried going through Connect to Server and still nothing. It recognizes that I am on the domain and I can ping various computers throughout the Village but c

  • Restoring iPhone after trying to install 3.0

    First off, let me just say I would have posted this topic in the dev forums if they worked. After trying to restore my iPhone 3G with the new 3.0 GM Seed using Xcode I get the error message "ERROR: Connected to device: Unable to open file" Now my iPh

  • Is there any possibility that we will see a bluetooth presenter for the ipad?

    As a professional public speaker I can't walk around with a 50m VGA cable holding onto this giant device, on stage, to control my slides.... I know there are bluetooth presenters that can be connected to my mac without any usbs but I want to use the

  • Material Usuage by Vendor..

    Dear Friends, Our Client need a report, that contains the material consumption value for a year, with vendor details (how much value of that material delivered and also how much the vendor got paid - the total sum value for that year). Is there any r

  • User exit to check the component in BOM

    Hi I am performing BOM change in SAP using change number. and this change number is maintained in the ztable with parent / child and required change details. When perform BOM Change using CS02, i need to compare this table and trigger error message.