ALV to Excel Export

Hi,
I want to export an ALV grid which has 88 columns to Excel Spreadsheet. The problem here I am facing is after 66  columns the heading and the relevant is going on the next row. I have tried searching SDN but found nothing in vain and finally posting this as a question.
The ALV is in OO.

Hi...
I check the problem which you are saying  into my IDES.. And I created an ALV using OOPS.. which is having more than 255 columns.. and when I m exporting to Excel then.. it will export only 99 columns not 66.
Kindly check it. May be it will solve your problem.. coz.. you column is 88 only..
My code is :
PARAMETERS : vbeln TYPE vbak-vbeln.
types : begin of struct,
  vbak type  vbak,
  vbap type  vbap,
  end of struct.
data : itab type TABLE OF struct,
       wa type struct.
data obj TYPE REF TO cl_Salv_table.
data REF_FUNC TYPE REF TO CL_SALV_FUNCTIONS.
select * from vbak into CORRESPONDING FIELDS OF TABLE itab where vbeln = vbeln.
try.
call method cl_salv_table=>factory
*  exporting
*    list_display   = IF_SALV_C_BOOL_SAP=>FALSE
*    r_container    =
*    container_name =
  importing
    r_salv_table   = obj
  changing
    t_table        = itab
catch cx_salv_msg .
endtry.
REF_FUNC = obj->GET_FUNCTIONS( ).
REF_FUNC->SET_ALL( ABAP_TRUE ).
obj->display( ).
Thanks,
Jhings.

Similar Messages

  • ALV to Excel Export Probelm

    Dear All,
                I want to export 80 Cols. ALV report of more than 3000 cols. into Excel, It doesnot export all the cols. but only export 28 cols. What can be the probelm
    Regards,
    Sohail

    hi,
    please go to the following link
    [CONSISTENCY CHECK|http://help.sap.com/saphelp_sm32/helpdata/EN/d6/23253963143e6ae10000000a11402f/frameset.htm]
    hope this helps you to solve your problem
    regards
    Ritesh

  • ALV to Excel export - rowmarks not considered any more?

    Dear experts,
    as you know there are at least 3 different ways to export ALV-Data to MS EXCEL:
    1. Switching the ALV View to Excel Inplace
    2. Export to Excel
    3. Export to local file -> Excel (just download, no automatic opening of the file)
    The last mentioned variant was up to now the only one that just downloaded the rows that were marked in the ALV.
    The first two variants always transfer all the lines regardless which rows have been marked or not.
    This was not only the case for the ALs in our own programs but also in standard programs as i.e. SE16/data browser.
    This seems to have changed now, and nobody (here) knows due to what kind of changes this had happened.
    Now the variant 3 also doesn't care any more about the row marks.
    Unfortunetaly our customers want to be able to specify the lines/rows that are supposed to be exported to Excel.
    Does anybody know what to do in order to get that functionality back again?
    Thanks in advance
    Andreas

    Why not simply add an event with a button that does a selected row download...you could get the rows selected into your rows table in your event, get the corresponding rows from your internal table that drives the ALV output, put them into a download table (after a clear, in case it aready had been used by this user/session), and proceed to download that to the desktop.
    Edited by: DaveL on Aug 29, 2011 1:43 PM

  • Reg alv grid display exporting to excel sheet

    hi experts,
    I have done an ALV report using reuse_alv_grid _display , out put is fine , but when i click on excel view icon i could only see an excel sheet without any data ., but when i use export to local file and choose spread sheet its giving  the data in excel, but the user wants to click only the excel view icon., please help me out.
    Note : i have already tried changing the macro security in excel to Low .

    see it will give you the   Status message  as  ...
    <b>View cannot be switched: Product is not installed or integration is not active.</b>
    it means the Excel  Integration was not  done in you  sap system .  ask basis   there  will be a Patch for it  ... once  it was applied   automatically in  all the   ALV  the excel view  will work
    in  my system it was  working 
    Girish

  • Export from ALV to Excel - problem with numeric values

    hi folks,
    when exporting from alv to excel and we have negative values (and using an u.s.a. setting where . and , are different to r/3) negetive values are not shown correctly in excel.
    when changing in win nt the regional settings to europe one's (e.g. germany) everything works fine.
    any hints welcome,
    kind regards
    oliver

    I guess this has something to do with the excel settings. In the control panel you have regional settings.try some options there. It might work.
    Regards
    Sudhi

  • Add columns to EXCEL exported from ALV

    Hi,
    I'm using the function module REUSE_ALV_GRID_DISPLAY, to display an ALV report. This report shows a standard text when users click on one column.
    I wanna know if its possible to add the standard text as a column into the EXCEL exported from this ALV? and if so, how can I do it?
    Regards.
    Gregory.

    Thanks again Raymond,
    With internal tables that have a type from ABAP dictionary works fine. My problem is that my internal table is declared into my program's global variables. My code bellow:
    DATA: BEGIN OF it_excel OCCURS 0,
             department  TYPE adcp-department,
             bname       TYPE usr02-bname,
             name_text   TYPE adrp-name_text,
             agr_name    TYPE agr_users-agr_name,
             text        TYPE agr_texts-text,
             from_dat    TYPE agr_users-from_dat,
             to_dat      TYPE agr_users-to_dat,
             tcode       TYPE agr_tcodes-tcode,
             ttext       TYPE tstct-ttext,
             tdesc       TYPE string,
          END OF it_excel.
    * fills the it_excel table
    perform fill_excel_data.
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = 'File location'
          file_filter          = cl_gui_frontend_services=>filetype_excel
          prompt_on_overwrite  = 'X'
        CHANGING
          filename             = v_file
          path                 = v_path
          fullpath             = v_fpath
          user_action          = v_useraction
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      CHECK sy-subrc EQ 0 AND v_useraction EQ 0.
      CREATE OBJECT v_excel 'EXCEL.APPLICATION'.
      SET PROPERTY OF v_excel 'VISIBLE' = 0.
      CALL METHOD OF v_excel 'WORKBOOKS' = v_workbooks.
      CALL METHOD OF v_workbooks 'ADD'.
      SET PROPERTY OF v_excel 'SHEETSINNEWWORKBOOK' = 1.
      CALL METHOD OF v_excel 'Worksheets' = v_sheet
        EXPORTING #1 = 1.
      CALL METHOD OF v_sheet 'Activate'.
      CLEAR v_subrc.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
        IMPORTING
          data                 = it_excel[]
        CHANGING
          rc                   = v_subrc
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      CHECK v_subrc EQ 0.
      GET PROPERTY OF v_excel 'ACTIVESHEET' = v_sheet.
      CALL METHOD OF v_sheet 'PASTE' NO FLUSH.
      CALL METHOD OF v_sheet 'SAVEAS'
        EXPORTING #1 = v_fpath #2 = 1.
    When calling cl_gui_frontend_services=>clipboard_export method the variable v_subrc is equal to 0 and sy-subrc is equal to 1 and the EXCEL file is not saved.
    Can you please tell me, what am I doing wrong?
    Regards,
    Gregory
    Edited by: Gregory Mayorga on Sep 7, 2010 10:56 AM

  • ALV TO EXCEL PROBLEM? ( 90 COLUMNS ALV CAN'T EXPORT TO EXCEL NORMALLY)

    HI ABAPERS,
    anyone have a alv that have over 90 columns and want to export to excel have experienced abnormal formating (like the header row show only up to 60 column and the rest show up in next row) and the data show in separate line.
    anyway can have a better format?
    also after 90 columns show up on alv, it can't show anymore except modify the layout in run time.
    can we do something before that?
    thanks & regards,
    HOWARD

    Hi HOWARD,
    My Report ouput having more than 90 columns in ALV, while downloading data from ALV to Excel sheet am facing alignment problem. (ie) the output column > 66 are appearing in next line of the excel sheet leads to improper alignment.
    Pls give me a solution as u had already come across this issue..
    Thank & Regards,
    Paramesh.

  • How to export only selected columns of WD ALV to excel

    Hi,
    I have WD ALV report with EXPORT button (since standard button was not working properly i just hide that and added custom one) & standard dropdown to choose layout. Out of 20 columns user may choose n number of columns, the same number of columns i need to transfer to xls. How to export only selected columns to xls. Any method or FM to filter number of columns being transfer to xls. please advise
    Rgds
    sudhanshu

    Hi,
    Where exactly we are (or going to be) using this reference i.e., CL_SALV_WD_CONFIG_TABLE. Im passing contents, filename & MIME type as:
    call function 'SCMS_STRING_TO_XSTRING'
        exporting
          TEXT   = TEXT
        importing
          BUFFER = XTEXT.
    WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
    **path to the word file
        I_FILENAME = 'WDP.xls'
    String Variable
        I_CONTENT =  XTEXT
    File Type
        I_MIME_TYPE = 'EXCEL' ).
    In CL_SALV_WD_CONFIG_TABLE we have few methods related to column settings however not sure where exactly we will be using this class reference. can you please give some idea so that i can do some r&d in that.
    Rgds
    Sudhanshu

  • How to export an ALV to Excel with its Header and Logo?

    Hi guys,
    I need to download to excel an ALV to excel. I already know how to download the ALV part, with its propertys, fonts, colors, etc. But I don't have a clue about how to download the header and the logo.
    Any suggestion?.
    Regards,
    Eric

    Hi Eric,
    Please check this link for sample code regarding LOGO to Excel
    How to Download ALV Output LOGO to Excel ?
    For Header to Excel check this link
    Export header of alv-oo into excel
    Hope this would help you.
    Good luck
    Narin

  • Excel Export From Web Dynpro Alv

    Hello,
    We are facing a problem and need suggestion. In one of our WD Abap applications the output is displayed in an ALV table. We have a button (provided by standard ALV functions) to export Excel.
    So far so good, but the issue is the amount columns display in the portal show the values as per user default settings. For example 123.456,78 whereas on export to excel it shows 12345.78
    Is there some way to export to excel with the users regional settings (same as displayed on portal). So far we check, almost all columns follow the regional user default settings except the amount column. Is there someway we can fix this.
    Users mention it worked before but not now. Its difficult to verify this statement now.
    Kindly help how we could solve this issue.
    Best regards,

    Hi,
    Just do the following in excel before downloading and check whether it works.
    Tools->Options->International tab.
    In that mention decimal separator as ,(comma).
    Thousand separator as .(dot).
    Uncheck use system separators.

  • ECC6: export ALV to 'Excel (in MHTML format)

    We have just upgraded to ECC6. When I try to export ALV to 'Excel (in MHTML format) I get a runtime error (GETWA_NOT_ASSIGNED). My list has 2 quantity fields. Tracing the error in the dump, i notice there is failure when processing quantity fields when the following SAP Standard method is called.
       >173      when if_salv_bs_c_data=>reffieldtype_quan.                 
       >174 *... get iso value for quantity value                              
       >           call method cl_alv_xslt_transform=>get_isonum_from_intnum
       >176             exporting                                              
       >177               i_value    = <l_data>                                
       >178               i_unit     = <l_reference>                           
       >179               i_decimals = ls_attribute-s_dfies-decimals           
       >180             importing                                              
       >181               e_value    = l_isovalue.    
    I have tried a few tricks with the FIELDCATALOG function without success. Does anyone know how I can overcome this.
    Regards.

    Hi.
    The quantity fields are coming from a table structure. I have tried making then character in the fieldcatalogue function but the runtime error was not eliminated.
    Regards.

  • Dump when exporting an ALV to excel at Portal

    Hi there,
    I am getting a dump ( Exception condition "CNTL_ERROR" raised) when exporting an ALV to an excel document. 
    I've done the following:
       1 - Create an ALV report at SAP R3 (with option export to excel);
       2 - Create a SAP transaction iview to show the ALV report at portal;
       3 - At portal, I am trying to export the ALV to excel.
    Isn't this correct?
    How can I get throught this problem. I really need to export this ALV to excel.
    Thanks and best regards,
    Vasco Brandã

    Hi,
    if it should not dump then it_output_alv-gehalt_eff this should be of type C. is it type char.
    and can you show the fieldcat of the field <b>gehalt_eff</b>, that might causing the problem. though you changed the type.
    Regards
    vijay

  • Download data from ALV to excel issue

    Hi All,
    Could you please tell me if there has any restriction on ALV grid data download to excel? I've a report contains 68 columns and about 500 rows, I want to download the data using the standard menu list->export->save to local file. but after I download them, I found the first 65 columns display in one line and the rest columns display in next line, just like ALV do not allow too many characters in one row and have to switch to new line. I can hide some columns but it's very strange that even after i hide 3 columns to fit the 500 rows download, then if the rows increase, the same problem occurs.
    I searched the forum and in the thread Re: Export ALV in EXCEL Issue Mr. Suvajit provided a solution by using menu List->export->spreadsheet, it looks very good. But I still want to know how this happen and is there a standard way to download data with more than 65 columns to local file with extension .xls so that user can open it directly?
    PS: I'm using FM REUSE_ALV_GRID_DISPLAY and the SAP version is SAP ECC6 with kernal package SAPKB70103.
    Thank you very much.
    Best Regards,
    Jeff
    Edited by: Jeff_liu_2010 on Mar 10, 2011 7:21 AM

    Hi Jeff,
    Please check if following analysis is helpful to you.
    Analysis/Solution:
    When we export ALV data to excel worksheet, as sap notes say the maximum lenght allowed is 1023 charaters and the max no of columns supported is 90.
    (I never faced any issue related to no of columns as it worked fine for columns >90 too)
    Issue occured when row size of exported data gets more than 1023 character.
    Therefore the row data must not exceed 1023 character, otherwise column splits and moves to next row.
    One additional aspect generally missed is that:
    When data in any particular column changes it's length, alv header also changes its lengh (short text, medium text, long text; depending on the length of of the longest cell in the column)
    therefore even if you have total length of row less than 1023 character, there might be cases when your ALV header size exceeds this length.
    Reducing the header size (by forcing to use short text or specifying own header names) should resolve the issue.
    Regards,
    Parveen

  • Problem in ALV to Excel Download

    Good Morning Experts,
      I am facing one issue related ALV to excel Download.
    I Developed one custom report the output is correct displaying.
    the output is like for example i am taking 3 columns (plant, material, amt).
    plant material amt
    1001  aaa     1000
    1001  bbb     2000
    while downloading to excel
    it displaying like
    plant
    material
    amt
    1001
    aaa
    1000
    1001
    bbb
    2000
    I dont know why its coming like that.
    this is my code
    DEFINE field_cat.
    wa_field-row_pos = &1.
    wa_field-fieldname = &2.
    wa_field-tabname = &3.
    wa_field-seltext_m = &4.
    wa_field-outputlen = &5.
    wa_field-currency = &6.
    wa_field-ref_fieldname = &7.
    wa_field-ref_tabname = &8.
    APPEND wa_field to it_field.
    clear wa_field.
    END-OF-DEFINITION.
    field_cat '1' 'BUKRS' 'IT_FINAL' 'Company Code' '6' '' '' ''.
    field_cat '2' 'BUTXT' 'IT_FINAL' 'Comp Descrip' '25' '' '' ''.
    field_cat '3' 'LIFNR' 'IT_FINAL' 'Vendor No' '10' '' '' ''.
    field_cat '4' 'NAME1' 'IT_FINAL' 'Vendor Name' '35' '' '' ''.
    field_cat '5' 'STRAS' 'IT_FINAL' 'Vendor Addres' '35' '' '' ''.
    field_cat '6' 'FDGRV' 'IT_FINAL' 'Nature Of Work' '30' '' '' ''.
    field_cat '7' 'DMBTR' 'IT_FINAL' 'Net Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    field_cat '8' 'QBSHB' 'IT_FINAL' 'TDS Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    field_cat '9' 'TOTAL' 'IT_FINAL' 'Total Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    it_layout-zebra = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = sy-repid
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       IS_LAYOUT                         = it_layout
       IT_FIELDCAT                       = it_field
       I_SAVE                            = 'X'
      TABLES
        t_outtab                          = it_final
    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.
    endform.                    " DISPLAY_ALV
    FORM TOP_OF_PAGE.
    REFRESH it_head. CLEAR it_head.
    wa_head-typ = 'H'.
    wa_head-info = 'Vendorwise Expense Details'.
    APPEND wa_head to it_head.
    wa_head-typ = 'S'.
    IF NOT s_MONAT-high is INITIAL.
      CONCATENATE 'Period : ' p_gjahr '.' s_MONAT-low ' to ' p_gjahr '.' s_MONAT-high INTO wa_head-info.
    ELSE.
      CONCATENATE 'Period : ' p_gjahr '.' s_MONAT-low INTO wa_head-info.
    ENDIF.
    APPEND wa_head to it_head.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = it_head.
    ENDFORM.
    Regards,
    Dhina..

    Hi,
    You can also try in this way
    in the output screen
      click List (in app tool bar) -> Export -> Spreadsheet
    and save at your desired location.
    (It will be save in .mhtml format , just rightclick on it and you can open it with excel )
    Then you will be able to view in your required format.
    Regards,
    koolspy.

  • REUSE_ALV_GRID_DISPLAY (column headings from ALV to EXCEL) Max please help

    Hi Max,
    If you remember in one of my last post I asked for changing the column headings in ALV display for example from 'Material' to 'Material used'.
    I am using
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
          I_CALLBACK_PROGRAM                = repid
          IT_FIELDCAT                       = field_body
          I_SAVE                            = g_save
          IS_VARIANT                        = g_variant
          IT_EVENTS                         = events
        TABLES
          T_OUTTAB                          = itab.
    And you suggested me the following way....
    loop at field_body into field_wa.
    case field_wa-fieldname.
      when 'Material'.
         field_wa-seltext_l = 'Material used'.
         field_wa-seltext_m = 'Material used'.
         field_wa-seltext_s = 'Material used'.
    endcase.
    modify field_body from field_wa.
    endloop.
    It is working well. In ALV display the column heading is changed to what I wanted. But the question is when I export the displayed ALV to Excel using ALV functionality, Export->Spreadsheet... I see that <b>I dont get the Column Heading into Excel as it was in the ALV display.</b>
    I get in the Excel as 'Material u' or 'Mat. Used'. But when I add this line in the code.....
    when 'Material'.
         field_wa-seltext_l = 'Material used'.
         field_wa-seltext_m = 'Material used'.
         field_wa-seltext_s = 'Material used'.
        <b> field_wa-outputlen = 20.</b>
    Then I see that I get the complete heading in the Excel. But this way the columns with outputlen 20 are taking much space in ALV display.
    Is there any fix for this. May be not mentioning the outputlen but still get the column headings into Excel as it was in ALV display.
    Anyone with ideas please respond. Waiting for replies. Thanks

    Hi
    The labels have a fixed size:
    seltext_l is long   text: 20 char
    seltext_m is medium text: 15 char
    seltext_s is short  text: 10 char
    The text 'Material used' is long 13 char so you should write:
    field_wa-seltext_l = 'Material used'.
    field_wa-seltext_m = 'Material used'.
    field_wa-seltext_s = 'Mat. used'.
    You can try to set the field colwidth_optimize of parameter IT_LAYOUT.
    This field should optimize the width of the colunm
    So
    data layout type SLIS_LAYOUT_ALV.
    layout-colwidth_optimize = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = repid
    IT_LAYOUT   = layout       
    IT_FIELDCAT = field_body
    I_SAVE = g_save
    IS_VARIANT = g_variant
    IT_EVENTS = events
    TABLES
    T_OUTTAB = itab.
    and you can decide which label has to be used:
    field_wa-seltext_l = 'Material used'.
    field_wa-seltext_m = 'Material used'.
    field_wa-seltext_s = 'Mat. used'.
    If you want to set the short text
    field_wa-ddictxt   = 'S'.
    ...medium
    field_wa-ddictxt   = 'M'.
    ...long
    field_wa-ddictxt   = 'L'.
    Max

Maybe you are looking for

  • Web Services in an EAR Deployment

    On deploying an EAR that includes a EJB web service JAR, I find that the WSDL url generated on the Web Services page is incorrect. For example for a web service named WebService1, the WSDL link shown on the WebServices page is ...oraclecloudapps.com/

  • Copy Control for Opportunity

    Folks, I have set up Copy Control for the 10 different Opportunity Types that I have, and have ensured that each oppty type is listed in as the Source and Target.  When I click on the 'Copy' icon for an existing opportunity, I am not prompted to sele

  • Missing iPhone BT Headset Charge Level on main Lock Screen since 1.1.1

    Hi prior to 1.1.1 the phone used to show the BT headset charging status on the mainscreen along with the phone's charge level... However since I installed 1.1.1 i don't get this here, but I will see the charge level in the main title bars when they a

  • Value not loading when using checkboxgroup.

    Hi       I am using a checkboxgroup as xtype. I have a cq:widget node whose xtype is checkboxgroup. Inside the node i have one items node. and inside items i have my individual checkboxes. In my dialog whatever i am selecting and submitting is goin t

  • I can't see my icloud files

    Hi, I get a Macbook Air and I have keynote and pages. I' m using my iCloud credentials, but i can't access to my files on iCloud. When I access through my iPad or my mac mini, I do can see and access to my keynotes, pages and numbers through the apps