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.

Similar Messages

  • ALV to Excel download problem

    Hi Experts,
       I display around 15 fields(columns) in ALV output. When I download it to Excel, it downloads exactly.
    Then dynamically, when I increase the  number of fields to be displayed in ALV it is displaying correctly. But when I download
    to excel, half of the fields are coming in one line of excel sheet and remaining fields are coming in the second line of excel.
    Why am I not getting all the fields in one line itself in the excel sheet?
    Is it a problem in standard ALV?
    I am using cl_gui_alv_grid class to display ALV output.
    Thanks and regards,
    Venkat.

    Hi!
    Which function module you are using for downloading?

  • 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

  • ALv to excel download problems

    HI friends,
    Probelm I'm facing while saving an ALV report to Excel Sheet by clicking
    on the 'Save as File Icon' button on the ALV output.=0D
    Here data is going into a new Line after 65 columns.I've used Function
    Module 'RSAQ_ALV'.This function module is ultimately using
    'REUSE_ALV_GRID_DISPLAY' and 'REUSE_ALV_LIST_DISPLAY' function
    modules.ALV output I'm getting correctly but when I save this ALV output
    to Excel,columns are getting wrapped and going into 2nd row after 65
    columns.=0D
    Could anybody tell me what could be the reason ?=0D
    Thanks,
    Sreekanth.G
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on Jul 9, 2010 12:36 PM

    ch_alv_layout-info_fieldname = 'COLOR'. "infofield for listoutput
      ch_alv_layout-colwidth_optimize = 'X'.
    try commenting the above values.and also check the Fieldcatlog.
    Check the issue similar issue was resolve by checking catalog and layout:
    [ALV Issue solution|Re: Problem when export ALV.]
    Regards,
    Gurpreet

  • Material Number Truncated in ALV to Excel Download

    Hi Guru,
    I have a ALV program report. It has about 18 columns, but for some strange reason, when we download this report to an ALV the 3rd column which host the material number as the last digit missing/truncated.
    For example if we have a material number in SAP ALV Grid as 1234567, when we download this the excel, what we get in excel is 123456. with the last number missing.
    What is the best solution to fix this issue.
    Thanks for you help in advance.

    Hi Keshav,
    Previously I faced the same situation, like in ALV grid I was displaying the material nos with output length as 15. Since in the Grid display you can readjust the columns, So after displaying we just expanded in the grid and try to download the same in excel. But at that time the ALV was downloading with material number field length as 15 ( What I set in my field catalog). Even when I saw the print priview I saw only the length it is showing as 15.  After changing the output length as 18 in field cat  I got the correct download.
    (Here I am assuming that the question is raised for  ALV grid display since no where it is mentioned the type of ALV).
    Sorry it was mentioned in the question itself
    Regards
    Shiba
    Edited by: Shiba Prasad Dutta on Feb 22, 2010 2:41 PM

  • Problem with ALV and EXCEL in 710...

    Hi,
    We have BI 710 and ECC6. When using ALV-GRID and when we try to change the output to excel-inplace, we get the error:
    "View cannot be switched. Product not installed or integration not active"...
    What do i have to install?
    Please suggest...
    Regards,
    Gunjan.

    Cover flow shows a thumbnail or icon for each file much like album covers in iTunes. The first is cover flow and the second shot is list view. If you choose list view the shaking vanishes.

  • Alv to excel download

    Probelm I'm facing while saving an ALV report to Excel Sheet by clicking
    on the 'Save as File Icon' button on the ALV output.=0D
    Here data is going into a new Line after 65 columns.I've used Function
    Module 'RSAQ_ALV'.This function module is ultimately using
    'REUSE_ALV_GRID_DISPLAY' and 'REUSE_ALV_LIST_DISPLAY' function
    modules.ALV output I'm getting correctly but when I save this ALV output
    to Excel,columns are getting wrapped and going into 2nd row after 65
    columns.=0D
    Could anybody tell me what could be the reason ?=0D
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on Jul 9, 2010 12:37 PM

    I do not have the answer but I have experienced the same issue.  I believe the issue arrises not as a limit of the number of columns, but based upon the length of the entire data structure, as I recall.  As a work around, we use the MS Excel icon versus the Save as Local file icon.

  • 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.

  • 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

  • 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

  • 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

  • Avoid splitting of columns ALV report while download output to Excel sheet

    Hi friends,
                  I have 170 columns in my ALV report
    while downloading the report to Excel sheet
    the column descriptions and values are splitting in two lines.
    How can i avoid the problem.
    before calling REUSE_ALV_GRID_DISPLAY function module in my code
    for the Layout i assigned LS_LAYOUT-MAX_SIZE = 1023.
    but still the problem is not solved.
    Please help me in this Issue.
    Thanks in Advance,
    Ganesh

    Hi friends,
    I dont want to use and Keyboard shiftcntrl....
    or dont want to change any code in ALV report
    by simply assigning some value to any of the export parameter in ALV function module
    can we achieve the functionality
    Thanks in Advance,
    Ganesh

  • Display of leading zeroes when downloaded from ALV to excel

    Hi All,
    I have a problem in ALV grid display.
    There is a specific field which has value starting from '001' to '999'. This is a char(3) type of variable.
    The problem is that the display shows the value as '001' which is correct. but when the same file is dwnloaded to excel using standard SAP functionality, the value of the field gets changed to '1' instead of '001'.
    Is there any option by which this can be controlled. Please let me know, its urgent!!
    thanks

    hi Ankur,
    the Excel download is done by Z program? IF yes you have to do:
       SET PROPERTY OF go_cell 'NumberFormat' = '@'.
    this will set the Excel cell to Text type and leading zeros won't be lost.
    ec

  • 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.

  • The data type DEC while downloading from ALV to EXCEL

    The data type DEC while downloading from ALV to EXCEL is giving some invalid data .
    Ex : In ALV field is the time difference in  hours:minutes
      if the value is  :23 in Excel it will be 22:59 .
    Please Suggest immediately

    Hi ....
    I have the similar problem. My coumns are not in any sequence when I download it to excel sheet.
    How do I fix it.
    Neha

Maybe you are looking for

  • How do I post an Invoice with 'on hold' status using this BAPI?

    Hey everyone, Okay, I'm working on an interface that will take Incoming Invoice information we receive from vendors and post it into the SAP system.  I'm still relatively new to ABAP, so it's a little slow-going for me... The BAPI is IncomingInvoice.

  • Flat keyboard - no help key - eclipse

    Hi all, on eclipse, context-sensitive help is called by "help"-button. And it works fine with a standard mac-keyboard. But there's no help-button on the new flat keyboards or macbooks. Using AppleShift? doesn't work, creating a new shortcut in eclips

  • LMS 4.2 Create Portlet from Custom Poller

    Hi folks, I create a custom poller, and would like to add it as a portlet.  I see that histo and live-graph it allow you to configure custom values, but they don't seem to accomplish what I need.  I'd just like a portlet showing the specific output f

  • Upgrade of ACS 5.4 to 5.5

    Need a sanity check on our proposed upgrade of our ACS. There is a preupgrade entitled  "Pointed-PreUpgrade-CSCum04132-5-4-0-46-0a.tar.gpg " which I'm not sure I need if I am running version 5.4.0.46.2. Here is the output from our CLI. Do I need the

  • How to get current user in Exchange 2007 OWA customization page?

    Hi,all I customize an ASPX page(smsconfig.aspx) in Exchange 2007 OWA( this file in ..\Exchange\ClientAccess\OWA\smsconfig.aspx, I don't modify registry.xml & web.config). My Exchange 2007 OWA has been configurated with Forms-Based Auth. https://mail.