ALV output when transporting to spread sheet

Hi all ,
  I am finding problem when I am transporting my ALV grid output to spread sheet. Irrespective of order all integer fields are moving to right most of the spread sheet.
  Actually i need to export that as it is in the output. Hope this is  a common problem. If any one faced this previously or know solution for this please let me know.
regards
raghav

Raghav,
You will need to create some custom functionality for your needs.
I would suggest passing your internal table in this Func Module - MS_EXCEL_OLE_STANDARD_DAT.
You can also pass a listing of field headers will be placed above each column in the Excel output as well (if needed).
Example:
TYPES:  BEGIN OF t_output,
          text80(80),
          kgoal(20),
          ytd(20),
          p1(20),
          p2(20),
          p3(20),
          p4(20),
          p5(20),
          p6(20),
          p7(20),
          p8(20),
          p9(20),
          p10(20),
          p11(20),
          p12(20),
          rowcolor(4),
        END OF t_output.
DATA: single_output_tbl TYPE TABLE OF t_output WITH HEADER LINE.
  DATA: sname LIKE rlgrap-filename.
  data: outname LIKE rlgrap-filename.
  DATA: BEGIN OF fnames OCCURS 0,
          cname(80),
        END OF fnames.
  sname = 'Output'.
  outname = 'c:\outfile'.
  PERFORM insert_headings.
   CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
    EXPORTING
      file_name                       = outname
    CREATE_PIVOT                    = 0
      data_sheet_name                 = sname
    PIVOT_SHEET_NAME                = ' '
    PASSWORD                        = ' '
    PASSWORD_OPTION                 = 0
   TABLES
    PIVOT_FIELD_TAB                 =
     data_tab                        = single_output_tbl
     fieldnames                      = fnames
   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 s000(zz) WITH 'Export to Excel failed.'.
  ENDIF.
FORM insert_headings.
  CLEAR fnames.  REFRESH fnames.
  MOVE ' ' TO fnames-cname.
  APPEND fnames.
  MOVE 'Company Goals' TO fnames-cname.
  APPEND fnames.
  MOVE 'YTD' TO fnames-cname.
  APPEND fnames.
  MOVE 'P1' TO fnames-cname.
  APPEND fnames.
  MOVE 'P2' TO fnames-cname.
  APPEND fnames.
  MOVE 'P3' TO fnames-cname.
  APPEND fnames.
  MOVE 'P4' TO fnames-cname.
  APPEND fnames.
  MOVE 'P5' TO fnames-cname.
  APPEND fnames.
  MOVE 'P6' TO fnames-cname.
  APPEND fnames.
  MOVE 'P7' TO fnames-cname.
  APPEND fnames.
  MOVE 'P8' TO fnames-cname.
  APPEND fnames.
  MOVE 'P9' TO fnames-cname.
  APPEND fnames.
  MOVE 'P10' TO fnames-cname.
  APPEND fnames.
  MOVE 'P11' TO fnames-cname.
  APPEND fnames.
  MOVE 'P12' TO fnames-cname.
  APPEND fnames.
ENDFORM.                    " Insert_Headings
Please points for helpful answers.

Similar Messages

  • Short dump when exporting the ALV grid report in to spread sheet

    HI,
    I am facing a problem when downloading ALV grid report in to spread sheet LIST>EXPORT>LOCAL FILE -->SPREADSHEET.
    in shotdump the cursor shows : "assign cline+cbegin(clength) to <field_cont>."
    In SAP internal table LIST,in the first record the value of the filed LENG is 0. when i have changed this value ex:10 etc it is coming properly.
    Kindly help me
    Nagendra

    Is this a standard SAP report, or your own? Can you tell what your report does, if it is a custom ALV report?

  • ALV Edit Mask isn't applied when exporting as "Spread Sheet".

    Hi all,
    One of our program has "Edit Mask" as XXXXX____ for displaying data in ALV (Mask first 5 numbers as X, display last 4 numbers as it is).  However, when data is exported as "Spread Sheet", the edit mask is not applied.  Does anyone know how to force edit mask when data is exported as SpreadSheet (MHTML)?  If you export as "local File" and then do "SpreadSheet", the edit mask works.. it is just when the direct "SpreadSheet" done, it doesn't work. 
    (i.e. CL_GUI_ALV_GRID->EXPORT_TO_SPREAD_SHEET doesn't apply EDIT Masks set in Field Catalog.)
    Here is more technical info.  We are on ECC 6.
    Field Catalog is of type LVC_T_FCAT.
    for a specific field, "EDIT_MASK" is set to XXXXX____.
    The ALV is called using
    My_ALV_CLASS->SET_TABLE_FOR_FIRST_DISPLAY
    exporting
    is_layout = My_layout
    is_toolbar_excluding = my_toolbar_exclude
    changing
    it_outtab = My_data_table
    it_fieldcatalog = MY_FIELD_CATALOG_DEFINATION_WHERE_EDIT_MASK_IS_SET
    exceptions...
    Thanks in advance!

    Hello,
    This is first time I am giving an answer.
    Instead of using a function module to merge the field catalog, try doing it one by one.
    for example,
    pt_fieldcat-col_pos = 01.
    pt_fieldcat-fieldname = 'KUNNR'.
    APPEND pt_fieldcat.
    pt_fieldcat-col_pos = 02.
    pt_fieldcat-fieldname = 'IP'.
    pt_fieldcat-edit = 'X'.
    pt_fieldcat-edit_mask = '-.-.-.-'.
    APPEND pt_fieldcat.
    and use the structure Z_IPADDR in method parameters instead of a function.
    CALL METHOD go_grid_ip->set_table_for_first_display
    EXPORTING
         i_structure_name = 'Z_IPADDR'
         it_toolbar_excluding = lt_exclude
         is_layout = ls_layout
    CHANGING
         it_fieldcatalog = pt_fieldcat
         it_outtab = p_t_auth_ip.
    CALL METHOD go_grid_ip->set_ready_for_input
    EXPORTING
    i_ready_for_input = 1.
    and also you can use following function module to check if the edited value is still in ALV or not
    CALL METHOD grid->check_changed_data
        IMPORTING
          e_valid = l_valid.
      IF l_valid IS NOT INITIAL.
    then the edited data in alv is successfully changed in internal table behind that.
    Debugging may find you an answer.
    Kind Regards,
    Manisha

  • ALV - Mass edit grid like spread sheet

    Hi,
    Users wanted to edit ALV grid similar to spread sheet for ex: drag a column from right hand botton corner to copy values from first column etc.
    Is it possible? if atleast I could display grid in spred sheet and save it back.
    Regards
    Kasi

    Created a ALV grid event DOUBLE CLICK and maintained code for this event

  • Truncation of Heading characters when an ALV is exported to an excel sheet

    Hi All,
    I am facing a problem while printing an ALV output on to an excel sheet. In the header the last characters are being truncated in the excel.
    Now, I have the entire data in tb_output itab. So using REUSE_ALV*, i printed the output. Here comes the problem.
    I heard about LIST_FROM_MEMORY and LIST_TO_ASCI which can solve this problem. But not much sure how to use those. Whether I need to pass my itab tb_output into any of these?
    Please help me out from this problem.
    Thanks a lot.
    Regards,
    Seenu

    Hi!
    You have 2 options:
    1. Shorten your headings so that their length is LE to the fieldlength of the data they are displaying. E.g. for PO number maximum possible is 10.
    2. Try using the parameter OUTPUTLEN in the field catalog. You can increase this to be equal to the length of your column heading.
    Hope this helps.
    Cheers!

  • Excel Addin stops working when an other excel spread sheet is open

    Hi,
    I'm sure many would have faced this issue of,excel addin retreive either gets no results or gives an error message when an other spread sheet is active.
    Is there a work around or any option set up to get over this isssue. The version of essbase 11.1.2.1
    Thanks
    SC

    it happens when you open many excels ..and which u cant see in ur own desktop ..where when u go to task manager u can see excel process running at back end by killing those u can overcome the issue
    more over some time .xla gets corrupted or disabled which can be solved by going to excel help >about excel u can find disabled .xla files which u can refresh ...
    l..
    And some time u can see u try to retrive data in one sheet where data will be retrieved in another sheet ...like this there are many where the list is endless .. so mostly restarting excel will do ..Hope this gives u some workaround :)

  • Refreshing alv output

    Hi gurus,
    My requirement is that i want to refresh my alv output when i click a particular button. and all the data displayed should be deleted and empty lines should be there.
    i have done till the refreshement but i am not getting empty lines. i am not getting any line . i have to click insert row everytime i need  a new entry.
    i have written this code:
    REFRESH  gt_output.
    CALL METHOD gv_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'V_T001B'
          i_save           = 'A'
         it_toolbar_excluding = lt_exclude
        CHANGING
          it_outtab        = gt_output
          it_fieldcatalog  = gt_fieldcat[].
    DO anyone have the answer

    Hi,
    Refersh
    call the method gv_grid->refresh_table_display
    Delete
    clear your final internal table gt_output which is displaying the data in the grid
    refersh gt_output.
    Refersh the grid using the method refresh_table_display.
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • ALV Output to Spread sheet.. all integer,date fields are moved to last .

    My requirement is that, Downloading the ALV displayed data into Excel.
    So, I gone Menu>List>Export-->Spreadsheet
    But, I observed that, the Currency, Date, Unit columns r coming in the last of spread sheet and with out any color(where as other columns does hv some color!)
    I am expalining with the example .
    when we take the table SFLIGHT.
    Go To SE16 and give table SFLIGHT
    and then go for it contents..
    then the sequence of cloumns in ALV o/p is as follows..
    Carrid,Connid,Fldate,Price,Currency ,PlaneType,seats Max,Setats Occ and others..
    But when I goto TableEntry>List>Export-->Spreadsheet
    ->Table->Micro soft Excel..
    we will ge the excel Carrid,Connid,Currency ,PlaneType,
    Fldate,Price,seats Max,Setats Occ and others..
    The Order is Changed.
    1 - So, its the SAP default property? OR Do I need do/code some thing, to resemble the ALV displayed data(to meet my requiremenet)?
    2- Generally, Wht is the procedure to get thru my requirement? I mean, am I doing correct?
    Your help is appreciated.
    With Regards,
    Satish.
    Edited by: satish akkina on Jan 17, 2008 7:34 PM

    Hi Satish,
    I am also facing this problem in one of my programs. Though I solved this problem temporarily by adding a new button to the Screen and have downloaded the file using GUI_DOWNLOAD function module, I would really like to know the reason for this and also the solution for this if you have known it by now.
    Regards,
    Amit.

  • Resetting the export to excel sheet on ALV output

    Hi !
    One of the user ran an ALV report and then tried to expot the report output to spread sheet . When she clicked on the export tab it poped her a screen to enter the format in which she wanted to export it and then checked the checkbox * Always use the selected format. Now whenever she clicks the export button on the ALV output it directly directs her to the spread sheet with the export. We would like to reset that so that she can choose back the desired format from the list of options. I would like to know where do we have to go or which table its gets stored so that we can re-set it back to original?
    Help would be really appreciated.
    Thanks

    Hi,
    Run program SALV_BS_ADMIN_MAINTAIN
    Best regards;
    Guillaume

  • ALV standard function Spread sheet not working

    Hi
    I am using ALV class CL_GUI_ALV_GRID (with check box). When i want to trnsfer output using Spread sheet then its giving the error message "Cannot open spreadheet". Please suggest.
    Thanks and Regards
    Aditya

    Hi,
    Check if MS excel is installed on your machine ?
    Regards

  • Problem in downloading the alv on spread sheet..... ??

    Hi Expert gurus..
    When i am running the report in foreground and downloading the output on spreadsheet ... the output layout is coming fine....NO. OF COLUMNS AND ROWS ARE COMING SEPERATELY
    But when i am running the report in background and the downloading the output in the spreadsheet ...... all the  NO. OF COLUMNS OF ALV ARE MERGING INTO SINGLE COLUMNS OF SPREAD SHEET........................
    what can be the problem ..................
    Please help........
    I will reward points for all the question....
    thanks.

    Hi,
    How are you downloading in background.
    You need to read the spool output into an internal table RSPO_DOWNLOAD_SPOOLJOB or RSPO_RETURN_ABAP_SPOOLJOB and use GUI_DOWNLOAD to download the data.
    Best regards,
    Prashant

  • Blank column in spread sheet when i am downloading?

    hai  fnds...any one help for the below issue
      i have developed ALV report used ( layout also in that ).displaying 19 fields in the  output. but when i am downloading spread sheet iam getting one blank column in spread sheet.(but all 19 fields are comming ). i dont know why i am getting second  column is blank? but otherthan spreadsheet format is not getting any blank column.
    here for the purpose of change layout and save layout i am using
    DATA: gv_boxnam         TYPE slis_fieldname   value  'VENUM'.
    VENUM field which is in internal table but not displaying the output. is this any problem?
    Suppose if i take   DATA: gv_boxnam         TYPE slis_fieldname   value  'VBELN'. which is in internal table and displaying the output..in this case i m not getting the VBELN in the output..i am getting only 18 fields in the output.
    Thanks,
    Raghu.

    the download is a copy of the table behind the ALV display.  It sounds like the table for the ALV display contains a column that is flagged as no output?

  • Download colored ALV output in to EXCEL sheet

    Hi ,
    I want to download colored ALV output to Excel sheet with color.
    one of the field in ALV is with 4 colors depending on condition.
    i am unable to download the color using download option(that field is comming with out color).
    Please help me by providing the solution.
    Thanks in advance.
    Regards
    sarath

    Hi Srini,
    thanks for the reply.
    i am using standard download function only.
    if i use download->local file->HTML Format only the font is appearing in colors.in case of spread sheet no color comming.
    but my requirement is to download into excel and  background also with color(green...) font in black like that.
    (exactly appearing in the ALV)
    Thanks
    sarath

  • ALV truncation while download using  List--Save/send--File--Spread sheet

    Experts,
    In ALV output, I am trying to download using menu item
    "List --> Save/send  --> File --> Spread sheet" then in the popup appears
    here if i GIVE the FILE NAME THEN,material number is getting truncated.
    If I don't give any file name it is storing as ".xls" and not getting truncated.
    How to correct this or avoid this truncation.
    OR
    If we can't do correction about truncation ...my function consultant is asking to
    to disable "List --> Save/send  --> File".
    Thanks in advance.
    Sam

    Solved by my own....
    We need to pass
    i_fieldcat-no_zero = 'X'.
    so that the zeros at the end  won't get truncated.

  • Reg. ALV output transported into Excel

    Dear All,
                   when i transported my ALV report output to excel file , amount column is suppressed from decimal places .
    i.e. in excel file ,  decimal values of amount column is not shown in some amounts.
    Please provide some inputs
    Thanks & Regards
    shailesh

    Hi ,
    Check this [LINK|ALV List output to Excel file; for  ALV output transported into Excel.
    hope it will help you .
    Regards,
    Saravana.S

  • Export ALV Grid Header to spread sheet

    Hi,
       I created ALV report using OO ABAP where i splitted the container into 3 parts , one for header , one for Grid and the other for Footer. When i export it to a spred sheet , i could not able to get the header and footer into the Spread sheet. I want the header and the footer to be exported to the spred sheet. Can any one of you help me out in this.
    Thanks,
    Kishore.

    Use the events PRINT_TOP_OF_PAGE and PRINT_END_OF_PAGE for printing the Header and Footer.
    Sample routine for the method PRINT_TOP_OF_PAGE is given below:
      METHOD M_HANDLE_TOP_OF_PAGE.
    *Local variables declaration
        DATA:
         V_TEXT                 TYPE SDYDO_TEXT_ELEMENT,                                 " Text
          V_DATE                 TYPE CHAR10,                                             " Date
          V_TIME                 TYPE CHAR10,                                             " Time
          V_TEXT2                TYPE CHAR30.
    *To display Current Date
        WRITE SY-DATUM TO V_DATE.
        WRITE SY-UZEIT TO V_TIME.
        CONCATENATE 'Current Date :'(076)
                    V_DATE
                    V_TIME
               INTO V_TEXT2 SEPARATED BY SPACE.
        WRITE:/ V_TEXT2.
    *To print Report Date
        CLEAR: V_DATE, V_TEXT2.
        WRITE P_CURDT TO V_DATE.
        CONCATENATE 'Report Date :'(077)
                    V_DATE
               INTO V_TEXT2 SEPARATED BY SPACE.
        WRITE:/ V_TEXT2.
      ENDMETHOD.                                                                        " M_HANDLE_TOP_OF_PAGE
    If you are satisfied, please give points to my reply.
    Regards,
    Sumanth.

Maybe you are looking for

  • Can labview be used in high vacuum systems?

    I want to use Labview to control carbon dating sample processing which occurs in a high vacuum system. My question is, it is possible to use labview?

  • STRANGE BEHAVIOR OF NVL

    Hi everybody, Can you please explain me this strange behavior of NVL function: SQL> select nvl(10000,'none') from dual; select nvl(10000,'none') from dual ERROR at line 1: ORA-01722: invalid number SQL> select nvl('none',10000) from dual; NVL( none C

  • Costing Issue

    I have Run Cost Estimate by Ck11n and Save than i run CK24 and makring than release than Execute and test run successful system given message 1 estimate for 1 material updated successful and i saved it than i check in material master costing view 2 h

  • Photos dont sync in order...why?

    i have an iphone 3gs 32g... i did the software update in June 22 to iOS 4... now when i sync my cell my photos don't sync in order. all the albums are there, but all the pictures in the albums are in random order... is there something i can do to fix

  • Opening raw file in Lightroom

    All of a sudden, I am not able to open my Nikon D80 raw files via Lightroom; when I go to open the file in Photoshop CS3, it only offers me the option to open it as a copy with Lightroom adjustments, not as an original file, and it opens as a psd. Tr