Need to download the ALV blocked output in to excel sheet

I have a requirement where there is a need to download the Alv block output to excel sheet. when i click on excel button which is on output only header block data is coming in excel sheet.but i need both header block and item block data into excel.

Hi,
create a pushbutton on the toolbar,
whenever user clicks the pushbutton,
call the fm gui_download for 2 times
for the first time,
append = ' ',
and for second time.
append = 'X'.
check this thread.
Re: How to download multiple ALV Container data on a screen to a single Excel?
Regards.
R K.

Similar Messages

  • Regarding downloading from alv report o/p to excel sheet

    Hi gurus,
                       When i am trying to download the alv output to excel sheet it is downloading only titles, No data is getting displayed in it.No data is getting downloaded.
    Thnaks in advance.

    Hi,
    What are the steps you do to download ALV to excel? We need to replicate the case in order to find answer.
    Regards,
    Teddy Kurniawan

  • Download the ALV Report output into excel sheet or notepad

    Hi,
    how to downlaod the alv report out into excel sheet or notepad in a proper manner. program contain large number records....
    Thanks in advance!!!!
    Regards,
    kranthi.

    Hi
    Download a report to excel with format (border, color cell, etc) 
    Try this program...it may help you to change the font ..etc.
    Code:
    REPORT ZSIRI NO STANDARD PAGE HEADING.
    this report demonstrates how to send some ABAP data to an
    EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_MAPL TYPE OLE2_OBJECT,         " list of workbooks
          H_MAP TYPE OLE2_OBJECT,          " workbook
          H_ZL TYPE OLE2_OBJECT,           " cell
          H_F TYPE OLE2_OBJECT.            " font
    TABLES: SPFLI.
    DATA  H TYPE I.
    table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
    read flights
      SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    display header
      ULINE (61).
      WRITE: /     SY-VLINE NO-GAP,
              (3)  'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (4)  'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (8)  'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
      ULINE /(61).
    display flights
      LOOP AT IT_SPFLI.
      WRITE: / SY-VLINE NO-GAP,
               IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
      ENDLOOP.
      ULINE /(61).
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-007
           EXCEPTIONS
                OTHERS     = 1.
    start Excel
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
    PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-008
           EXCEPTIONS
                OTHERS     = 1.
    get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
      PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - start
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    tell user what is going on
      SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - end
    disconnect from Excel
         CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING  #1 = 'C:\SKV.XLS'.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    FORM FILL_CELL USING I J BOLD VAL.
      CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL.
    ENDFORM.
    *&      Form  ERR_HDL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
      WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
      STOP.
    ENDIF.
    ENDFORM.                    " ERR_HDL
    Please note that this example maybe slow at filling the excel table
    (perhaps four fields per second on a 900 MHz machine - almost 30 seconds
    for a short example).
    To get the data on properties and methods - there is a bit of smoke and mirrors
    going on here; they are EXCEL properties and methods, not sap ones - so you need
    to look at excel help to determine how a particular function is structured. then
    build the block in sap, as shown in the example.
    If you only want to transfer the data to Excel like when you transfer the data from
    ALV to Excel simply use the Function Modules:
    XXL_SIMPLE_API
    If you want more modifications when you transfer it to Excel use:
    XXL_FULL_API

  • Issue while downloading the alv report output in spreadsheet format .

    Hi,
    I have a report output, whenever I try to download it in the spreadsheet format to my desktop,
    I get the following issue:
    Say the correct material number is 10833340001218999 or 10030000063207001
    (This appears in the report output)
    But in the excel file the number is displayed as 10833340001218900 and 10030000063207000.
    Please help.
    Regards,
    Sucharita.

    Hi Sucharita,
    The reason for your problem could be that in excel 2007, characters more that 15 are replaced with 0.
    Or you can try downloading the data using FM 'GUI_DOWNLOAD' , if currently you are using stadard SAP functionality of data downloading.
    Best Regards,
    Vishal.

  • Downloading the List of iViews in a Excel Sheet in Sorted Order.

    Hi
    I have a requirement of getting a list of all the iviews that are created in a excel sheet in a sorted manner.
    Can anyone help how to get a list in a excel sheet in a sorted manner..
    Regards
    JM

    Hi John,
    Here is the code to get the list of all iviews..
         List iviewslist = null;
                        try
                             Hashtable map = new Hashtable();
                             map.put(IPcdContext.SECURITY_PRINCIPAL,request.getUser());
                             map.put(Context.INITIAL_CONTEXT_FACTORY,IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
                             map.put(Constants.REQUESTED_ASPECT,PcmConstants.ASPECT_SEMANTICS);
                             InitialContext ctx = null;
                             DirContext dirctx;
                            ctx = new InitialContext(map);
                             dirctx = (DirContext)ctx.lookup("pcd:portal_content/");
                             PcdSearchControls pcd_serachcontrol = new PcdSearchControls();
                             pcd_serachcontrol.setReturningObjFlag(false);
                             pcd_serachcontrol.setSearchScope(pcd_serachcontrol.SUBTREE_WITH_UNIT_ROOTS_SCOPE);
                             dirctx.addToEnvironment(Constants.APPLY_ASPECT_TO_CONTEXTS,Constants.APPLY_ASPECT_TO_CONTEXTS);
                             NamingEnumeration ne = dirctx.search("","(com.sap.portal.pcd.gl.ObjectClass=com.sapportals.portal.iview)",pcd_serachcontrol);
                             iviewslist = new ArrayList();
                             while(ne.hasMoreElements())
                                  IPcdSearchResult searchresult =(IPcdSearchResult)ne.next();
                                  String loc = "pcd:portal_content/"+searchresult.getName();
                                  iviewslist.add(loc);
                                 response.write(loc+"<br>");
                        catch (Exception e) {
                             response.write(e.toString());

  • Downloading the multiple columns(Multiple fields) into excel sheet in OLE

    HI friends,
                    I am using OLE method to download 3 internal tables data into 3 worksheeets in one excel file. i am able to create 3 worksheets.but i am getting the whole data merged into one column(A column) where as i want 5 columns in one sheet if i have 5 database table fields.can anybody check my code and propose the solution for this.
      INCLUDE ole2incl.
      DATA: w_cell1 TYPE ole2_object,
            w_cell2 TYPE ole2_object.
    *--- Ole data Declarations
      DATA: h_excel TYPE ole2_object,     "Excel object
            h_mapl TYPE ole2_object,      "list of workbooks
            h_map TYPE ole2_object,       "workbook
            h_zl TYPE ole2_object,        "cell
            h_f TYPE ole2_object,         "font
            gs_interior TYPE ole2_object, "Pattern
            worksheet TYPE ole2_object,
            h_cell TYPE ole2_object,
            h_cell1 TYPE ole2_object,
            range TYPE ole2_object,
            h_sheet2 TYPE ole2_object,
            h_sheet3 TYPE ole2_object,
            gs_font TYPE ole2_object,
            flg_stop(1) TYPE c.
      DATA gv_sheet_name(20) TYPE c .
    * start Excel IF h_excel-header = space OR h_excel-handle = -1.
      CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    *--- get list of workbooks, initially empty
      CALL METHOD OF h_excel 'Workbooks' = h_mapl.
      SET PROPERTY OF h_excel 'Visible' = 1.
      CALL METHOD OF h_mapl 'Add' = h_map.
      gv_sheet_name = 'SM37'.
      GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
      SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
    *--Formatting the area of additional data 1 and doing the BOLD
      CALL METHOD OF h_excel 'Cells' = w_cell1
           EXPORTING #1 = 1
                     #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
           EXPORTING #1 = 1
                     #2 = 50.
      CALL METHOD OF h_excel 'Range' = h_cell
           EXPORTING #1 = w_cell1
                     #2 = w_cell2.
      GET PROPERTY OF h_cell 'Font' = gs_font.
      SET PROPERTY OF gs_font 'Bold' = 1 .
      DATA l_rc TYPE i.
      DATA : y_file TYPE string.
       y_file = x_file.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
          data = tab_sm37[]
      CHANGING
           rc = l_rc
       EXCEPTIONS
            cntl_error = 1
            error_no_gui = 2
         not_supported_by_gui = 3
            OTHERS = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
          #1 = 1
          #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
      CALL METHOD OF h_excel 'Range' = range
           EXPORTING
                #1 = w_cell1
               #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
      gv_sheet_name = 'ST22'.
      GET PROPERTY OF h_excel 'Sheets' = h_sheet2 .
      CALL METHOD OF h_sheet2 'Add' = h_map.
      SET PROPERTY OF h_map 'Name' = gv_sheet_name .
      GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
      CALL METHOD OF h_excel 'Cells' = w_cell1
           EXPORTING
                #1 = 1
                #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
                 #1 = 1
                 #2 = 50.
      CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
                 #1 = w_cell1
                #2 = w_cell2.
      GET PROPERTY OF h_cell 'Font' = gs_font .
      SET PROPERTY OF gs_font 'Bold' = 1 .
      CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
          data = tab_sm37[]
      CHANGING
           rc = l_rc
       EXCEPTIONS
            cntl_error = 1
            error_no_gui = 2
         not_supported_by_gui = 3
            OTHERS = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
                #1 = 1
                #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
             EXPORTING
               #1 = 1
               #2 = 1.
      CALL METHOD OF h_excel 'Range' = range
             EXPORTING
                #1 = w_cell1
                #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
      gv_sheet_name = 'WE02'.
      GET PROPERTY OF h_excel 'Sheets' = h_sheet3 .
      CALL METHOD OF h_sheet3 'Add' = h_map.
      SET PROPERTY OF h_map 'Name' = gv_sheet_name .
      GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
      CALL METHOD OF h_excel 'Cells' = w_cell1
               EXPORTING
                     #1 = 1
                     #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
               #1 = 1.
      CALL METHOD OF h_excel 'Range' = h_cell
              EXPORTING
                  #1 = w_cell1
                 #2 = w_cell2.
      GET PROPERTY OF h_cell 'Font' = gs_font.
      SET PROPERTY OF gs_font 'Bold' = 1 .
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
          data = tab_sm37[]
      CHANGING
           rc = l_rc
       EXCEPTIONS
            cntl_error = 1
            error_no_gui = 2
         not_supported_by_gui = 3
            OTHERS = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
              EXPORTING
                  #1 = 1
                  #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
              EXPORTING
                   #1 = 1
                   #2 = 1.
      CALL METHOD OF h_excel 'Range' = range
              EXPORTING
                   #1 = w_cell1
                   #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
    *--- disconnect from Excel
      FREE OBJECT h_zl.
      FREE OBJECT h_mapl.
      FREE OBJECT h_map.
      FREE OBJECT h_excel.
    thanks in advance.
    Edited by: MAHESH MUMAR on Feb 27, 2009 2:58 PM

    try this code
    INCLUDE ole2incl.
    DATA: w_cell1 TYPE ole2_object,
    w_cell2 TYPE ole2_object.
    DATA: h_excel TYPE ole2_object, "Excel object
          h_mapl  TYPE ole2_object, "list of workbooks
          h_map   TYPE ole2_object, "workbook
          h_zl    TYPE ole2_object, "cell
          h_f     TYPE ole2_object, "font
          gs_interior TYPE ole2_object, "Pattern
          worksheet TYPE ole2_object,
          h_cell   TYPE ole2_object,
          h_cell1   TYPE ole2_object,
          range     TYPE ole2_object,
          h_sheet2  TYPE ole2_object,
          h_sheet3  TYPE ole2_object,
          gs_font    TYPE ole2_object,
          flg_stop(1) TYPE c.
    DATA gv_sheet_name(20) TYPE c .
    * start Excel IF h_excel-header = space OR h_excel-handle = -1.
    CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    *--- get list of workbooks, initially empty
    CALL METHOD OF h_excel 'Workbooks' = h_mapl.
    SET PROPERTY OF h_excel 'Visible' = 1.
    CALL METHOD OF h_mapl 'Add' = h_map.
    gv_sheet_name = 'SM37'.
    GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING #1 = 1
      #2 = 50.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell 'Font' = gs_font.
    SET PROPERTY OF gs_font 'Bold' = 1 .
    DATA l_rc TYPE i.
    DATA : y_file TYPE string.
    y_file = x_file.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = tab_sm37
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    gv_sheet_name = 'ST22'.
    GET PROPERTY OF h_excel 'Sheets' = h_sheet2 .
    CALL METHOD OF h_sheet2 'Add' = h_map.
    SET PROPERTY OF h_map 'Name' = gv_sheet_name .
    GET PROPERTY OF h_excel 'ACTIVESHEET' = gv_sheet_name.
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 50.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell 'Font' = gs_font .
    SET PROPERTY OF gs_font 'Bold' = 1 .
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = tab_sm37[]
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    gv_sheet_name = 'WE02'.
    GET PROPERTY OF h_excel 'Sheets' = h_sheet3 .
    CALL METHOD OF h_sheet3 'Add' = h_map.
    SET PROPERTY OF h_map 'Name' = gv_sheet_name .
    GET PROPERTY OF h_excel 'ACTIVESHEET' = gv_sheet_name.
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell 'Font' = gs_font.
    SET PROPERTY OF gs_font 'Bold' = 1 .
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = tab_sm37[]
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    free object h_zl.
    FREE OBJECT h_mapl.
    FREE OBJECT h_map.
    FREE OBJECT h_excel.

  • Output to an excel sheet

    Hi all,
    How do we send the 1)script output 2)ALV report output to an excel sheet
    please expedite
    thanks

    Hi arun,
    Check the below example, to download the ALV report output to an excel sheet.
    REPORT Z_CONCEPTALV .
    TABLES: KNA1,VBAK.
    DATA: ITAB TYPE TABLE OF VBAK,
          CONTAINER TYPE SCRFNAME VALUE 'ALVCONTROL',
          CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          GRID TYPE REF TO CL_GUI_ALV_GRID,
          L_CONTAINER TYPE SCRFNAME VALUE 'LOGO',
          I_PARENT TYPE REF TO CL_GUI_CONTAINER,
          L_CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          TREE TYPE REF TO CL_GUI_ALV_TREE_SIMPLE,
          LT_LIST_COMMENTARY TYPE SLIS_T_LISTHEADER,
          L_LOGO TYPE SDYDO_VALUE.
    DATA: OK_CODE(4).
    CALL SCREEN 1100.
    *&      Module  STATUS_1100  OUTPUT
          text
    MODULE STATUS_1100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    CASE OK_CODE.
    WHEN 'DISP'.
    SELECT * FROM VBAK INTO TABLE ITAB WHERE KUNNR = KNA1-KUNNR.
    IF CUST IS INITIAL.
    CREATE OBJECT CUST EXPORTING CONTAINER_NAME = CONTAINER.
    CREATE OBJECT GRID EXPORTING I_PARENT = CUST.
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING I_STRUCTURE_NAME
    = 'VBAK' CHANGING IT_OUTTAB = ITAB.
    ENDIF.
    IF L_CUST IS INITIAL.
    CREATE OBJECT L_CUST EXPORTING CONTAINER_NAME = L_CONTAINER.
    CREATE OBJECT TREE EXPORTING I_PARENT = L_CUST.
    PERFORM BUILD_COMMENT USING LT_LIST_COMMENTARY.
    CALL METHOD TREE->CREATE_REPORT_HEADER EXPORTING IT_LIST_COMMENTARY =
    LT_LIST_COMMENTARY I_LOGO = L_LOGO.
    ENDIF.
    WHEN 'DOWN'.
    PERFORM F_DOWNLOAD_TO_EXCEL.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " STATUS_1100  OUTPUT
    FORM BUILD_COMMENT USING LT_LIST_COMMENTARY.
    L_LOGO = 'ENJOYSAP_LOGO'.
    ENDFORM.
    FORM F_DOWNLOAD_TO_EXCEL.
    CALL FUNCTION 'DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
       FILENAME                       = ' '
       FILETYPE                       = 'DAT'
      ITEM                          = ' '
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      FILEMASK_MASK                 = ' '
      FILEMASK_TEXT                 = ' '
      FILETYPE_NO_CHANGE            = ' '
      FILEMASK_ALL                  = ' '
      FILETYPE_NO_SHOW              = ' '
      SILENT                        = 'S'
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      ACT_FILENAME                  =
      ACT_FILETYPE                  =
      FILESIZE                      =
      CANCEL                        =
      TABLES
        DATA_TAB                      = ITAB
      FIELDNAMES                    =
    EXCEPTIONS
      INVALID_FILESIZE              = 1
      INVALID_TABLE_WIDTH           = 2
      INVALID_TYPE                  = 3
      NO_BATCH                      = 4
      UNKNOWN_ERROR                 = 5
      GUI_REFUSE_FILETRANSFER       = 6
      CUSTOMER_ERROR                = 7
      OTHERS                        = 8
    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.

  • How to download the ALV output with colors into the excel sheet

    Hi,
      I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
    can anyone tell how to get the colors in the excel sheet also. thanks...
    Regards,
    Rose.

    Hi Camila,
    Use the OLE concept.
    Check the below threads:
    Colors in Excel Sheet
    colors in alv
    Regards,
    Soumya.

  • Problem while downloading the alv output to excel file.

    Hii,
    While downloading the alv output to an excel file i am facing a problem. Either the output comes as 1.23456E+11 or the values get cut .
    Cant put in txt file  as the users require to calculate directy and i have even tried to increase the output length .But both doesnt help.
    So what are the other ways to do so.
    Edited by: mansi_v27 on Mar 24, 2010 12:35 PM

    Hi,
    Welcome to SCN!!!.
    Please go through the forum rules. This has been discussed many times. You can search in the forum for this.
    Infact there is no problem. Just expand that excel cell. You can see the full value. This is standard excel property.
    Thanks,
    Vinod.

  • Excel download for ALV Block report (List- export- spreadsheet)

    Dear friends,
    I want to download the output into Excel...
    I am using all SAP standards and using the ALV Block list
    Ex: List->export->local file..  is anable from here i can download to excell .....but the same there is anothere option : List->export->spreadsheet...( this one inactive.)
    I want to activate the  List->export->spreadsheet option.
    how to do this???
    Thanks,
    Sridhar.

    hi Sridhar,
    there is already an option to download in spreadsheet format when saving to local file...then why do you want to activate List->export->spreadsheet ????
    regards,
    madhu

  • Problem when dowloading the ALV report output to Excel Sheet.

    Hi ,
    I am dowloading the ALV report output to Excel Sheet.
    There is field Condition Unit(KOMP-KMEIN) in the output of the ALV, this has values PC and CSE , but when I download to Excel Sheet, CSE is appearing as CSE ,but PC is appearing as ******.
    Can you please help me in knowing the reson for this.
    Regards,
    Madhu.

    hi
    refer to following link
    http://www.****************/Tutorials/ALV/ColorSALV/Demo.htm
    http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm
    Cheers
    Snehi
    Edited by: snehi chouhan on Jul 11, 2008 12:42 PM

  • How to send the ALV GRID output to spool by using the print button in std t

    How to send the ALV GRID output to spool by using the print button in standard tool bar.
    We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept.  But i am unable to send the output to spool using the print button in the standard tool bar.
    I am able to display the Print parameter dialog box but i am not able to send it to spool.
    Kindly help.
    Thanks In Advance.
    G.V.Ramana

    Hi Shaik,
    There is not properties button in my print screen.
    MODULE user_command_0900 INPUT.
        WHEN 'EXCEL'.
          PERFORM excel_download.                              
        WHEN 'PRI'.
          PERFORM print_output.
    form Print_output.
    CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
               EXPORTING
                    columns        = 80
                    device         = 'ANY '
                    lines          = 65
                    maxpenality    = 1999
               TABLES
                    layouts        = lt_layouts1
               EXCEPTIONS
                    unknown_device = 1
                    OTHERS         = 2.
          IF sy-subrc = 0.
            LOOP AT lt_layouts1.
              IF lt_layouts1-penality < 1000        AND
                 lt_layouts1-penality < l_min_penality.
                l_layout       = lt_layouts1-layout.
                l_min_penality = lt_layouts1-penality.
              ENDIF.
            ENDLOOP.
            IF NOT l_layout IS INITIAL.
              CALL FUNCTION 'GET_PRINT_PARAMETERS'
                   EXPORTING
                        mode                   = 'CURRENT'
                        line_size              = 80             "#EC *
                new_list_id            = l_new_list_id
                        no_dialog              = l_no_dialog
                        layout                 = l_layout
                   IMPORTING
                        out_archive_parameters = rs_arc_params
                        out_parameters         = rs_pri_params
                        valid                  = l_valid
                   EXCEPTIONS
                        archive_info_not_found = 1
                        invalid_print_params   = 2
                        invalid_archive_params = 3
                        OTHERS                 = 4.
              IF sy-subrc NE 0.                                 " INS SLIN
              ENDIF.                                            " INS SLIN
              IF rs_pri_params-linsz LT 80 OR
                 rs_pri_params-linsz LT gt_stack-s_lprint-width.
                gt_stack-print_line_break = 'X'.
              ELSE.
                CLEAR gt_stack-print_line_break.
              ENDIF.
              IF l_valid NE 'X'.
                rs_pri_params = ls_pri_params_sav.
                rs_arc_params = ls_arc_params_sav.
              ENDIF.
            ENDIF.
          ENDIF.
    endform.                    " Print_output
        CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
                EXPORTING
                   is_layout         = gs_layout_cost_tot_grand
                CHANGING
                   it_fieldcatalog   = gt_fcat_cost_tot_grand[]
                   it_outtab         = gt_cost_tot_grand[].
    Please check my code

  • How can I get my safari 5.1.10 to download the java update so I won't continue to get notices that my browser is out of date and I need to download the update, which then won't download.  Cannot view anything in youtube or most other places.

    Jeez.  Trying to view items in youtube.  I keep getting a blacked out picture telling me my browser is out of date and I need to download the update.  I do that and then it doesn't connect so I'm back at square one. 

    Hi MiMattheMac, you probably won't have any problems but just be aware upgrading from Snow Leopard to anything later is a big leap. Old, PowerPC - only programs won't work, for example, and even more recently developed programs won't work if their developers have not been updating them for recent OS X versions.
    If you haven't made a backup of your Mac yet, and you consider the information on it important, please consider doing that. It is the only practicable way to "undo" an OS X upgrade should you want to. Merely having a backup seems to preclude the need to ever use it.
    If the information on your Mac is not important to you, upgrading to Mavericks is even easier since you can completely erase the Mac first.
    In any event let the download complete.
    If this raises any concerns about installing it, and you need to ask questions to alleviate those concerns, you can just close this window when it eventually appears:
    The 5 GB downloaded file will not be deleted and will remain available until you actually install Mavericks. You can do that at any time convenient for you.

  • Itunes is not recognizing my ipod.  there is no sync under file.  I need to download the music just purchased from itunes.

    itunes is not recognizing my ipod.  there is no sync under file.  I need to download the music just purchased from itunes.
    can anyone help?

    Do you see your iPod under Devices on the left side of the iTunes window in the source list when it's connect to your Mac?
    BTW...  you sync iTunes media from the tabs in the iTunes menu, not from the File menu unless you are transferring iTunes purchases from the iPod to your Mac.
    Might need to zoom to see this graphic. I have "Music" selected as an example.

  • HT1386 When I try to synch my husband's Iphone, it tells me that I need to download the latest version of Itunes.  So I did that, still tells me to download.  I can synch my phone just fine, its exactly the same as my husbands.

    I am trying to synch my husband's I Phone and cannot.  i have already done mine, which is identical to his.  When I try to synch his, I get the message that i need to download the latest version of i tunes, which i have done.  Each time i try to synch, it tells me the same thing.  I have downloaded Itunes 10 to bvoth teh phone and to my PC.  Help!

    When I try to synch his, I get the message that i need to download the latest version of i tunes, which i have done.  Each time i try to synch, it tells me the same thing.
    Let's try a standalone Apple Mobile Device Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of why it's not installing under normal conditions.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleMobileDeviceSupport.msi (or AppleMobileDeviceSupport64.msi) to do a standalone AMDS install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleMobileDeviceSupport.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If so, can you get a normal iTunes install to go through properly now?
    If instead you get an error message during the install (or uninstall), let us know what it says. (Precise text, please.)

Maybe you are looking for