Download data to multiple workbooks

Hi,
Is it possible to download data to multiple workbook in single excel sheet.
Can u please provide me code or function module.
Thanks & Regards
Santhosh

hi santosh,
Multiple excel sheets generation in a workbook
CREATE OBJECT EXCEL 'EXCEL.SHEET'.
GET PROPERTY OF EXCEL 'Application' = APPLICATION.
SET PROPERTY OF APPLICATION 'Visible' = 1.
CALL METHOD OF APPLICATION 'Workbooks' = BOOKS.
CALL METHOD OF BOOKS 'Add' = BOOK.
CALL METHOD OF BOOK 'WORKSHEETS' = SHEET.
CALL METHOD OF SHEET 'ADD'.
Fill all the sheets with relavant data
PERFORM SHEET1 TABLES ITAB1.
PERFORM SHEET2 TABLES ITAB2.
PERFORM SHEET3 TABLES ITAB3.
PERFORM SHEET4 TABLES ITAB4.
Quit the excel after use
CALL METHOD OF EXCEL 'QUIT'.
FREE OBJECT: COLUMN,SHEET,BOOK,BOOKS,APPLICATION,EXCEL. "NO FLUSH.
CLEAR V_SHEET.
FORM FILL_CELL USING ROW COL VAL.
CALL METHOD OF SHEET 'cells' = CELL NO FLUSH
EXPORTING #1 = ROW #2 = COL.
SET PROPERTY OF CELL 'value' = VAL.
FREE OBJECT CELL NO FLUSH.
ENDFORM. " FILL_CELL
FORM SHEET1 TABLES ITAB1 STRUCTURE ITAB1.
V_SHEET = Sheet Name.
V_NO = V_NO + 1.
CALL METHOD OF BOOK 'worksheets' = SHEET NO FLUSH EXPORTING #1 = V_NO.
SET PROPERTY OF SHEET 'Name' = V_SHEET NO FLUSH.
PERFORM FILL_SHEET1 TABLES ITAB1 USING V_NO V_SHEET.
CALL METHOD OF SHEET 'Columns' = COLUMN.
FREE OBJECT SHEET.
CALL METHOD OF COLUMN 'Autofit'.
FREE OBJECT COLUMN.
ENDFORM.
Repeat above procedure for all sheets you want to add
FORM FILL_SHEET1
TABLES ITAB1 STRUCTURE ITAB1
USING V_NO V_SHEET.
ROW = 1.
PERFORM FILL_CELL USING ROW 1 'Column1 Name'.
PERFORM FILL_CELL USING ROW 2 'Column2 Name'.
PERFORM FILL_CELL USING ROW 3 'Column3 Name'.
ROW = ROW + 1.
LOOP AT ITAB1.
PERFORM FILL_CELL USING ROW 1 ITAB1-Column1.
PERFORM FILL_CELL USING ROW 2 ITAB1-Column2.
PERFORM FILL_CELL USING ROW 3 ITAB1-Column3.
ROW = ROW + 1.
ENDLOOP.
ENDFORM.
Repeat above procedure for all sheets you want to add
<b>Hope this is helpful, Do reward.</b>

Similar Messages

  • How to download data in multiple sheets of one excel file

    Hello,
    I want to download data in multiple sheets of one excel file ..through ole2_object.
    i have created program but it is not it is not giving the desird op.
    here is the  code..
    create object excel 'EXCEL.APPLICATION'.
      call method of excel 'WORKBOOKS' = books.
      call method of books 'ADD' = book1.
    *****************" Here we r creating the first  sheet.
      if flag1 = 'X'.
        call method of book1 'WORKSHEETS' = SHEET
          EXPORTING
            #1 = 1.                           " here 1 indicating the position of sheet means first position.
        call method of sheet 'Activate'.
        set property of sheet 'Name' = 'Developments_Summary_Report'.
        perform excel_fill.
      endif.
    *****************" Here we r creating the second  sheet.
    if flag2 = 'X'.
        call method of book1 'WORKSHEETS' = SHEET
          EXPORTING
            #1 = 2.                           " here 2 indicating the position of sheet means second position.
        call method of sheet 'Activate'.
        set property of sheet 'Name' = 'BDC_Developments_Report'.
        perform excel_fill.
      endif.
      set property of excel 'VISIBLE' = 1.   " due to this property excel window is visible.
      call method of excel 'QUIT'.
    but it is generating the two different excel file ..
    Thanks in advance,
    Paresh.

    Hi,
    Copy and paste this code in your SAP
    *& Report ZETA_EXCEL_DOWNLOAD_CLIPBOARD *
    report zeta_excel_download_clipboard .
    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.
    ** Internal table Declaration
    data: begin of t_excel occurs 0,
    vkorg(20) type c, "Sales Org
    vbtyp(20) type c, "Document Category
    auart(20) type c, "Document Type
    ernam(20) type c, "Created By
    vbeln(20) type c, "Document Number
    posnr(20) type c, "Item Number
    erdat(20) type c, "Created Date
    vdatu(20) type c, "Header Requested Delivery Date
    reqdat(20) type c, "Request date
    condat(20) type c, "Confirm date
    lifsk(20) type c, "Header Block
    txt30(30) type c, "Order User Status Description
    lifsp(20) type c, "Line Block
    dispo(20) type c, "MRP Controller
    dsnam(20) type c, "MRP Controller Description
    vmsta(20) type c, "Material Sales Status
    kunnr(20) type c, "Sold To
    cname(35) type c, "Sold To Name
    regio(20) type c, "State
    cufd(10) type c, "CUD
    bstnk(20) type c, "PO#
    bsark(20) type c, "Ordering Method
    matnr(20) type c, "Material
    maktx(35) type c, "Material Description
    t200(20) type c, "T200
    vtext(20) type c, "T200 Description
    matkl(20) type c, "Material Group
    zzbomind(7) type c, "BOM Indicator
    ostat(20) type c, "Order Status
    cmgst(20) type c, "CRD
    inco1(20) type c, "Incoterms
    oqty(20) type c, "Order Quantity
    pqty(20) type c, "Open Quantity
    unit(20) type c, "UOM
    onet(20) type c, "Order Value
    pnet(20) type c, "Open Value
    curr(20) type c, "Currency key
    so_bezei like tvkbt-bezei,"Sales Office
    sg_bezei like tvgrt-bezei,"Sales Group
    bname(20) type c, "Ordering Party
    contact(20) type c, "Contact Name
    telf1(20) type c, "Contact telf1
    reqqty(20) type c, "Item Request qty
    reqval(20) type c, "Item Request value
    conqty(20) type c, "Item Confirm qty
    conval(20) type c, "Item Confirm value
    zzrev(02) type c, "Revenue recognition acceptance
    bezei(20) type c, "Revenue recognition text
    vgbel(20) type c, "Reference Order for RETURNS
    0008text(255) type c, "Internal Order Comment Text
    end of t_excel.
    data: t_excel_bckord like t_excel occurs 0 with header line,
    t_excel_bcklog like t_excel occurs 0 with header line,
    t_excel_blkord like t_excel occurs 0 with header line.
    types: data1(1500) type c,
    ty type table of data1.
    data: it type ty with header line,
    it_2 type ty with header line,
    it_3 type ty with header line,
    rec type sy-tfill,
    deli(1) type c,
    l_amt(18) type c.
    data: begin of hex,
    tab type x,
    end of hex.
    field-symbols: <fs> .
    constants cns_09(2) type n value 09.
    assign deli to <fs> type 'X'.
    hex-tab = cns_09.
    <fs> = hex-tab.
    data gv_sheet_name(20) type c .
    * M A C R O Declaration
    define ole_check_error.
    if &1 ne 0.
    message e001(zz) with &1.
    exit.
    endif.
    end-of-definition.
    t_excel_bckord-vkorg = 'ABC'.
    t_excel_bckord-vbtyp = 'DEF'.
    t_excel_bckord-auart = 'GHI'.
    t_excel_bckord-ernam = 'JKL'.
    t_excel_bckord-vbeln = 'MNO'.
    t_excel_bckord-0008text = 'XYZ'.
    append t_excel_bckord.
    t_excel_bckord-vkorg = 'ABC1'.
    t_excel_bckord-vbtyp = 'DEF1'.
    t_excel_bckord-auart = 'GHI1'.
    t_excel_bckord-ernam = 'JKL1'.
    t_excel_bckord-vbeln = 'MNO1'.
    t_excel_bckord-0008text = 'XYZ1'.
    append t_excel_bckord.
    t_excel_bckord-vkorg = 'ABC2'.
    t_excel_bckord-vbtyp = 'DEF2'.
    t_excel_bckord-auart = 'GHI2'.
    t_excel_bckord-ernam = 'JKL2'.
    t_excel_bckord-vbeln = 'MNO2'.
    t_excel_bckord-0008text = 'XYZ2'.
    append t_excel_bckord.
    t_excel_bcklog-vkorg = 'ABC'.
    t_excel_bcklog-vbtyp = 'DEF'.
    t_excel_bcklog-auart = 'GHI'.
    t_excel_bcklog-ernam = 'JKL'.
    t_excel_bcklog-vbeln = 'MNO'.
    t_excel_bcklog-0008text = 'XYZ'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC1'.
    t_excel_bcklog-vbtyp = 'DEF1'.
    t_excel_bcklog-auart = 'GHI1'.
    t_excel_bcklog-ernam = 'JKL1'.
    t_excel_bcklog-vbeln = 'MNO1'.
    t_excel_bcklog-0008text = 'XYZ1'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC2'.
    t_excel_bcklog-vbtyp = 'DEF2'.
    t_excel_bcklog-auart = 'GHI2'.
    t_excel_bcklog-ernam = 'JKL2'.
    t_excel_bcklog-vbeln = 'MNO2'.
    t_excel_bcklog-0008text = 'XYZ2'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC3'.
    t_excel_bcklog-vbtyp = 'DEF3'..
    t_excel_bcklog-auart = 'GHI3'.
    t_excel_bcklog-ernam = 'JKL3'.
    t_excel_bcklog-vbeln = 'MNO3'.
    t_excel_bcklog-0008text = 'XYZ3'.
    append t_excel_bcklog.
    t_excel_blkord-vkorg = 'ABC'.
    t_excel_blkord-vbtyp = 'DEF'.
    t_excel_blkord-auart = 'GHI'.
    t_excel_blkord-ernam = 'JKL'.
    t_excel_blkord-vbeln = 'MNO'.
    t_excel_blkord-0008text = 'XYZ'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC1'.
    t_excel_blkord-vbtyp = 'DEF1'.
    t_excel_blkord-auart = 'GHI1'.
    t_excel_blkord-ernam = 'JKL1'.
    t_excel_blkord-vbeln = 'MNO1'.
    t_excel_blkord-0008text = 'XYZ1'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC2'.
    t_excel_blkord-vbtyp = 'DEF2'.
    t_excel_blkord-auart = 'GHI2'.
    t_excel_blkord-ernam = 'JKL2'.
    t_excel_blkord-vbeln = 'MNO2'.
    t_excel_blkord-0008text = 'XYZ2'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC3'.
    t_excel_blkord-vbtyp = 'DEF3'..
    t_excel_blkord-auart = 'GHI3'.
    t_excel_blkord-ernam = 'JKL3'.
    t_excel_blkord-vbeln = 'MNO3'.
    t_excel_blkord-0008text = 'XYZ3'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC4'.
    t_excel_blkord-vbtyp = 'DEF4'..
    t_excel_blkord-auart = 'GHI4'.
    t_excel_blkord-ernam = 'JKL4'.
    t_excel_blkord-vbeln = 'MNO4'.
    t_excel_blkord-0008text = 'XYZ4'.
    append t_excel_blkord.
    loop at t_excel_bckord.
    concatenate
    t_excel_bckord-vkorg
    t_excel_bckord-vbtyp
    t_excel_bckord-auart
    t_excel_bckord-ernam
    t_excel_bckord-vbeln
    t_excel_bckord-posnr
    t_excel_bckord-erdat
    t_excel_bckord-vdatu
    t_excel_bckord-reqdat
    t_excel_bckord-condat
    t_excel_bckord-lifsk
    t_excel_bckord-txt30
    t_excel_bckord-lifsp
    t_excel_bckord-dispo
    t_excel_bckord-dsnam
    t_excel_bckord-vmsta
    t_excel_bckord-kunnr
    t_excel_bckord-cname
    t_excel_bckord-regio
    t_excel_bckord-cufd
    t_excel_bckord-bstnk
    t_excel_bckord-bsark
    t_excel_bckord-matnr
    t_excel_bckord-maktx
    t_excel_bckord-t200
    t_excel_bckord-vtext
    t_excel_bckord-matkl
    t_excel_bckord-zzbomind
    t_excel_bckord-ostat
    t_excel_bckord-cmgst
    t_excel_bckord-inco1
    t_excel_bckord-oqty
    t_excel_bckord-pqty
    t_excel_bckord-unit
    t_excel_bckord-onet
    t_excel_bckord-pnet
    t_excel_bckord-curr
    t_excel_bckord-so_bezei
    t_excel_bckord-sg_bezei
    t_excel_bckord-bname
    t_excel_bckord-contact
    t_excel_bckord-telf1
    t_excel_bckord-reqqty
    t_excel_bckord-reqval
    t_excel_bckord-conqty
    t_excel_bckord-conval
    t_excel_bckord-zzrev
    t_excel_bckord-bezei
    t_excel_bckord-vgbel
    t_excel_bckord-0008text
    into it
    separated by deli.
    append it.
    clear it.
    endloop.
    loop at t_excel_bcklog.
    concatenate
    t_excel_bcklog-vkorg
    t_excel_bcklog-vbtyp
    t_excel_bcklog-auart
    t_excel_bcklog-ernam
    t_excel_bcklog-vbeln
    t_excel_bcklog-posnr
    t_excel_bcklog-erdat
    t_excel_bcklog-vdatu
    t_excel_bcklog-reqdat
    t_excel_bcklog-condat
    t_excel_bcklog-lifsk
    t_excel_bcklog-txt30
    t_excel_bcklog-lifsp
    t_excel_bcklog-dispo
    t_excel_bcklog-dsnam
    t_excel_bcklog-vmsta
    t_excel_bcklog-kunnr
    t_excel_bcklog-cname
    t_excel_bcklog-regio
    t_excel_bcklog-cufd
    t_excel_bcklog-bstnk
    t_excel_bcklog-bsark
    t_excel_bcklog-matnr
    t_excel_bcklog-maktx
    t_excel_bcklog-t200
    t_excel_bcklog-vtext
    t_excel_bcklog-matkl
    t_excel_bcklog-zzbomind
    t_excel_bcklog-ostat
    t_excel_bcklog-cmgst
    t_excel_bcklog-inco1
    t_excel_bcklog-oqty
    t_excel_bcklog-pqty
    t_excel_bcklog-unit
    t_excel_bcklog-onet
    t_excel_bcklog-pnet
    t_excel_bcklog-curr
    t_excel_bcklog-so_bezei
    t_excel_bcklog-sg_bezei
    t_excel_bcklog-bname
    t_excel_bcklog-contact
    t_excel_bcklog-telf1
    t_excel_bcklog-reqqty
    t_excel_bcklog-reqval
    t_excel_bcklog-conqty
    t_excel_bcklog-conval
    t_excel_bcklog-zzrev
    t_excel_bcklog-bezei
    t_excel_bcklog-vgbel
    t_excel_bcklog-0008text
    into it_2
    separated by deli.
    append it_2.
    clear it_2.
    endloop.
    loop at t_excel_blkord.
    concatenate
    t_excel_blkord-vkorg
    t_excel_blkord-vbtyp
    t_excel_blkord-auart
    t_excel_blkord-ernam
    t_excel_blkord-vbeln
    t_excel_blkord-posnr
    t_excel_blkord-erdat
    t_excel_blkord-vdatu
    t_excel_blkord-reqdat
    t_excel_blkord-condat
    t_excel_blkord-lifsk
    t_excel_blkord-txt30
    t_excel_blkord-lifsp
    t_excel_blkord-dispo
    t_excel_blkord-dsnam
    t_excel_blkord-vmsta
    t_excel_blkord-kunnr
    t_excel_blkord-cname
    t_excel_blkord-regio
    t_excel_blkord-cufd
    t_excel_blkord-bstnk
    t_excel_blkord-bsark
    t_excel_blkord-matnr
    t_excel_blkord-maktx
    t_excel_blkord-t200
    t_excel_blkord-vtext
    t_excel_blkord-matkl
    t_excel_blkord-zzbomind
    t_excel_blkord-ostat
    t_excel_blkord-cmgst
    t_excel_blkord-inco1
    t_excel_blkord-oqty
    t_excel_blkord-pqty
    t_excel_blkord-unit
    t_excel_blkord-onet
    t_excel_blkord-pnet
    t_excel_blkord-curr
    t_excel_blkord-so_bezei
    t_excel_blkord-sg_bezei
    t_excel_blkord-bname
    t_excel_blkord-contact
    t_excel_blkord-telf1
    t_excel_blkord-reqqty
    t_excel_blkord-reqval
    t_excel_blkord-conqty
    t_excel_blkord-conval
    t_excel_blkord-zzrev
    t_excel_blkord-bezei
    t_excel_blkord-vgbel
    t_excel_blkord-0008text
    into it_3
    separated by deli.
    append it_3.
    clear it_3.
    endloop.
    if h_excel-header = space or h_excel-handle = -1.
    * start Excel
    create object h_excel 'EXCEL.APPLICATION'.
    endif.
    * PERFORM err_hdl.
    *--- get list of workbooks, initially empty
    call method of h_excel 'Workbooks' = h_mapl.
    * PERFORM err_hdl.
    set property of h_excel 'Visible' = 1.
    * add a new workbook
    call method of h_mapl 'Add' = h_map.
    * PERFORM err_hdl.
    *GV_SHEET_NAME = '1st SHEET'.
    gv_sheet_name = 'Back Orders'.
    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.
    *CALL METHOD OF gs_cells 'Select' .
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
    data l_rc type i.
    call method cl_gui_frontend_services=>clipboard_export
    importing
    data = it[]
    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.
    * PERFORM err_hdl.
    call method of h_excel 'Range' = range
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    call method of range 'Select'.
    * PERFORM err_hdl.
    call method of worksheet 'Paste'.
    * PERFORM err_hdl.
    * CALL METHOD OF h_excel 'QUIT'.
    *GV_SHEET_NAME = '2ND SHEET'.
    gv_sheet_name = 'Backlog'.
    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 = it_2[]
    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.
    * PERFORM err_hdl.
    call method of h_excel 'Range' = range
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    call method of range 'Select'.
    * PERFORM err_hdl.
    call method of worksheet 'Paste'.
    *GV_SHEET_NAME = '3rd SHEET'.
    gv_sheet_name = 'Blocked Orders'.
    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
    #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 = it_3[]
    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.
    * PERFORM err_hdl.
    call method of h_excel 'Range' = range
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    call method of range 'Select'.
    * PERFORM err_hdl.
    call method of worksheet 'Paste'.
    *--- disconnect from Excel
    free object h_zl.
    free object h_mapl.
    free object h_map.
    free object h_excel.
    Regards
    Sudheer

  • Downloading data into multiple work sheets in excel

    Hi All,
    Could you please tell me the way of downloading data into multiple work sheets .
    Now, we are downloading  data into  multiple excel files and after that  copying  all the excel file data in to different work sheets of the single excel manually.
    So , here I want directly download the data into different work sheets of single excel file.
    Regards,
    Siddivinesh Jogu

    Hi,
    Down load into three worksheets in one XL
    REPORT  ZKC_TEST1.
    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,
          e_color     TYPE ole2_object,
          gs_italic   TYPE ole2_object,
          flg_stop(1) TYPE c.
    ** Internal table Declaration
    DATA: BEGIN OF t_excel OCCURS 0,
          MATNR type mara-matnr, "(18) type c,
          ERSDA type mara-ersda, " (8)  type c,
          ERNAM type mara-ernam, "(12) type c,
          LAEDA type mara-laeda, "(8)  type c,
          AENAM type mara-aenam, "(12) type c,
          VPSTA type mara-vpsta, "(15) type c,
          PSTAT type mara-pstat, "(15) type c,
          END OF t_excel.
    DATA: t_excel_bckord LIKE t_excel OCCURS 0 WITH HEADER LINE,
          t_excel_bcklog LIKE t_excel OCCURS 0 WITH HEADER LINE,
          t_excel_blkord LIKE t_excel OCCURS 0 WITH HEADER LINE.
    data: wa_excel_bckord like line of t_excel.
    TYPES: data1(1500) TYPE c,
           ty          TYPE TABLE OF data1.
    DATA: it        TYPE ty WITH HEADER LINE,
          it_2      TYPE ty WITH HEADER LINE,
          it_3      TYPE ty WITH HEADER LINE,
          rec       TYPE sy-tfill,
          deli(1)   TYPE c,
          l_amt(18) TYPE c.
    DATA: BEGIN OF hex,
           tab TYPE x,
          END OF hex.
    FIELD-SYMBOLS: <fs> .
    CONSTANTS cns_09(2) TYPE n VALUE 09.
    ASSIGN deli TO <fs> TYPE 'X'.
    hex-tab = cns_09.
    <fs> = hex-tab.
    DATA gv_sheet_name(20) TYPE c .
    *---selecting into tables
    select MATNR
           ERSDA
           ERNAM
           LAEDA
           AENAM
           VPSTA
           PSTAT
           from mara into table t_excel_bckord
           where pstat = 'KVELBCD'.
    wa_excel_bckord-matnr = 'MATNR'.
    wa_excel_bckord-ersda = 'ERSDA'.
    wa_excel_bckord-ernam = 'ERNAM'.
    wa_excel_bckord-laeda = 'LAEDA'.
    wa_excel_bckord-aenam = 'AENAM'.
    wa_excel_bckord-vpsta = 'VPSTA'.
    wa_excel_bckord-pstat = 'PSTAT'.
    INSERT wa_excel_bckord
             INTO t_excel_bckord INDEX 1 .
    select MATNR
           ERSDA
           ERNAM
           LAEDA
           AENAM
           VPSTA
           PSTAT
           from mara into table t_excel_bcklog
           where pstat = 'KVELBCDP'.
    INSERT wa_excel_bckord
             INTO t_excel_bcklog INDEX 1 .
    select MATNR
           ERSDA
           ERNAM
           LAEDA
           AENAM
           VPSTA
           PSTAT
           from mara into table t_excel_blkord
           where pstat = 'KEBC'.
    INSERT wa_excel_bckord
             INTO t_excel_blkord INDEX 1 .
    LOOP AT t_excel_bckord.
      CONCATENATE
      t_excel_bckord-MATNR
      t_excel_bckord-ERSDA
      t_excel_bckord-ERNAM
      t_excel_bckord-laeda
      t_excel_bckord-aenam
      t_excel_bckord-vpsta
      t_excel_bckord-pstat
      INTO it
      SEPARATED BY deli.
      APPEND it.
      CLEAR it.
    ENDLOOP.
    LOOP AT t_excel_bcklog.
      CONCATENATE
      t_excel_bcklog-matnr
      t_excel_bcklog-ersda
      t_excel_bcklog-ernam
      t_excel_bcklog-laeda
      t_excel_bcklog-aenam
      t_excel_bcklog-vpsta
      t_excel_bcklog-pstat
      INTO it_2
      SEPARATED BY deli.
      APPEND it_2.
      CLEAR it_2.
    ENDLOOP.
    LOOP AT t_excel_blkord.
      CONCATENATE
      t_excel_blkord-matnr
      t_excel_blkord-ersda
      t_excel_blkord-ernam
      t_excel_blkord-laeda
      t_excel_blkord-aenam
      t_excel_blkord-vpsta
      t_excel_blkord-pstat
      INTO it_3
      SEPARATED BY deli.
      APPEND it_3.
      CLEAR it_3.
    ENDLOOP.
    *--- start Excel
    IF h_excel-header = space OR h_excel-handle = -1.
      CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    ENDIF.
    *--- 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 = 'Back Orders'.
    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 .
    SET PROPERTY OF gs_font 'Name' = 'Arial' .
    GET PROPERTY OF h_cell 'Interior' = e_color.
    SET PROPERTY OF e_color 'ColorIndex' = 35.
    GET PROPERTY OF h_cell  'Font' = gs_italic .
    SET PROPERTY OF  gs_italic 'Italic' = 1 .
    DATA l_rc TYPE i.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = it[]
      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 = 'Backlog'.
    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 .
    GET PROPERTY OF h_cell 'Interior' = e_color.
    SET PROPERTY OF e_color 'ColorIndex' = 40.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = it_2[]
      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 = 'Blocked Orders'.
    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
      #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 .
    GET PROPERTY OF h_cell 'Interior' = e_color.
    SET PROPERTY OF e_color 'ColorIndex' = 45.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = it_3[]
      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,
    Krishna..

  • Download data from multiple tabs of ALV to tabs of Excel

    Hi,
    I have a requirement where ALV is being displayed in 6 tabs. Can a download functionality be provided in such a way that data from all the tabs gets downloaded into multiple sheets of Excel document.
    In the attached file, expected output with ALV in multiple tabs is displayed. Are there any Function modules which can be used to download data from ALV in each tab into Excel document sheets in one go?
    Thanks,
    Tejaswini.

    This is a FAQ, did you use search tool with keywords like worksheet, activate and OLE to find many threads and (some examples)
    a sample like XLSX Upload - A Unified Approach
    a project like abap2xlsx
    Regards,
    Raymond

  • How to Download data - exceeding 65000 rows into multiple spreadsheet

    Hi all,
    I am having some issues with the download.
    The user is trying to download certain reports generated in the application into an excel sheet. He is not able to download beyond 65000 records. What I need is a way to automatically download the data into multiple spreadsheet if it exceeds 65000 rows (limit for excel 2000).
    Please let me know if there is any web service which does this or any other solution to this problem.
    Regards,
    t

    Hi Arie,
    thank you for your suggestion.
    I am using almost a similar procedure to download the records into excel. But the problem is its only downloading 65000 records because of the limit excel has.
    I am pasting the code which will give you a idea.
    It would be great if you help me modifying the code such that if the records exceeds 65000, remaining data gets downloaded to sheet2.
    for example if there are 70000 records, the first 65000 records gets loaded into sheet1 and remaining 5000 into sheet2.
    begin
    -- Set the MIME type
    owa_util.mime_header( 'application/octet', FALSE );
    -- Set the name of the file
    htp.p('Content-Disposition: attachment; filename="emp.csv"');
    -- Close the HTTP Header
    owa_util.http_header_close;
    -- Loop through all rows in EMP
    for x in (select e.emp_id, e.s_id, e.emp_number
    from test2_csv_download1 e where rid between 1 and 65000 )
    loop
    -- Print out a portion of a row,
    -- separated by commas and ended by a CR
    htp.prn(x.emp_id ||','|| x.s_id ||','||
    x.emp_number || chr(13));
    end loop;
    -- Send an error code so that the
    -- rest of the HTML does not render
    htmldb_application.g_unrecoverable_error := true;
    end;
    thanks
    T

  • How to download data into one cell of excel in different lines

    Hi All,
    My Report downloads data from R/3 to excel. Now one particular field contains multiple lines, which i needs to download into different lines into that particular cell(of excel). how can i do this.
    I found one method for this and that is cl_abap_char_utilities=>newline.But this is in abap version 6.0.
    But i am working in version 4.6c. do we have any method or anything that meets my requirement in 4.6c.
    Please let me know.
    Thanx in Advance
    Subhani.

    why do you split them to the internal table ,then download it?
    Is you special field long text?
    If is ,you can use FM READ_TEXT to put it into an internal table ,then download it.

  • Downloading data from a different carrier

    is it possible to set the iphone to download date from a different network,
    im with telstra who have horrible data prices, so i i could manage to get a prepaid data pack through someone else it would be helpful. Otherwise ill just try to shut out 3g data from the phone and just do wifi.
    thanks

    Hello noboo79,
    And welcome to Apple Discussions!
    On the computer you have initially the set the iPod up on and for, you can enable the "manually manage music and videos" option from under the iPod's Summary tab in iTunes. This will allow you to sync contect to the iPod from multiple computers. Otherwise, there is no other way.
    Here is more on using your iPod with multiple computers as well as manually managing your iPod's contents.
    [Using iPod with multiple computers|http://support.apple.com/kb/ht1202]
    [Managing content manually on iPhone, iPad, and iPod|http://support.apple.com/kb/HT1535]
    B-rock

  • HT2486 Iam trying to download data from a group in my address book into Numbers.  When I click on the data to move and drag to Numbers nothing happens.  Using OS X ver 10.9.2 iMac

    Iam trying to download data from a group in my address book into Numbers.  When I click on the data to move and drag to Numbers nothing happens.  Using OS X ver 10.9.2 iMac

    With Numbers 3.2 (released April 2014) drag and drop works on my machine again, either onto the canvas or into an existing table.
    What also works (as Wayne described): select multiple contacts, command-c to copy, and (after clicking the canvas or a cell) command-v to paste.
    SG

  • Inserting data into multiple tables(Oracle Version 9.2.0.6)

    Hi,
    we are going to receive the following XML file from one of our vendor. We need to parse the file and then save the data to multiple database tables (around 3).
    <?xml version="1.0"?>
    <datafeed xmlns:xsi="ht tp://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="DailyFeed.xsd" deliverydate="2007-02-14T00:00:00" vendorid="4">
    <items count="1">
    <item feed_id="001379" mode="MERGE">
    <content empbased="true">
    <emp>10000000</emp>
    <value>
    </value>
    <date>2006-01-16</date>
    <unit>CHF</unit>
    <links>
    <link lang="EN">
    <url>www.pqr.com</url>
    <description>pqr website</description>
    </link>
    <link lang="DE">
    <url>www.efg.com</url>
    <description>efg website</description>
    </link>
    </links>
    </content>
    <content empbased="true">
    <emp>10000001</emp>
    <value>
    </value>
    <date>2006-01-16</date>
    <unit>CHF</unit>
    <links>
    <link lang="EN">
    <url>www.abc.com</url>
    <description>abc website</description>
    </link>
    <link lang="DE">
    <url>www.xyz.com</url>
    <description>xyz website</description>
    </link>
    </links>
    </content>
    <content empbased="true">
    <emp>10000002</emp>
    <value>
    </value>
    <date>2006-01-16</date>
    <unit>CHF</unit>
    <links>
    <link lang="IT">
    <url>www.rst.com</url>
    <description>rst website</description>
    </link>
    </links>
    </content>
    </item>
    </items>
    </datafeed>
    Now the operation to be done on the table depends on the mode attribute. Further, there are some basic validations need to be done using count attribute. Here the item tag, content tag & link tag are recurring elements.
    The problem is I am not able to find the correct attributes like mode, feed_id, lang through SQL query(they are getting duplicated) though I was able to find the deliverydate & vendorid attribute as they are non-repeatitive. Here are the scripts :
    create table tbl_xml_rawdata (xml_content xmltype);
    create directory xmldir as 'c:\xml';
    --put the above xml file in this directory and name it testfile.xml
    Declare
    l_bfile BFILE;
    l_clob CLOB;
    BEGIN
    l_bfile := BFileName('XMLDIR', 'testfile.xml');
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
    dbms_lob.loadFromFile(dest_lob => l_clob,
    src_lob => l_bfile,
    amount => dbms_lob.getLength(l_bfile));
    dbms_lob.close(l_bfile);
    insert into test_xml_rawdata values(xmltype.createxml(l_clob));
    commit;
    end;
    My query is:
    select extractvalue(value(b),'/datafeed/@deliverydate') ddate, extractvalue(value(b),'/datafeed/@vendorid') vendorid,
    extractvalue( value( c ), '//@feed_id') feed_id,
    extractvalue( value( a ), '//@empbased') empbased,
    extractvalue( value( a ), '//emp') emp,
    extractvalue( value( a ), '//value') value,
    extractvalue( value( a ), '//unit') unit,
    extractvalue( value( a ), '//date') ddate1,
    extract( value( a ), '//links/link/url') url,
    extract( value( a ), '//links/link/description') description
    from tbl_xml_rawdata t,
    table(xmlsequence(extract(t.xml_content,'/datafeed/items/item/content'))) a,
    table(xmlsequence(extract(t.xml_content,'/'))) b ,
    table(xmlsequence(extract(t.xml_content,'/datafeed/items/item'))) c;
    If the above query is run, the feed_id is cartesian joined with other data ,which is wrong.
    How should I go with this so that I can have 1 relational record with respect to each element & sub-elements.
    Also, if this is not doable in SQL, can someone direct me to some plsql example to do this. I read that dbms_xmldom & dbms_xmlparser can be used to travel through XML doc but I don't know how to use them.
    Any help please ??

    I'm still getting the same error while installing Oracle Patch set 9.2.0.6. I downloaded the patchset 2 weeks back.
    Pls help where download the correct version ?

  • Error in importing data from multiple ASCii files, Concatenat​e

    I am trying to use the "Importing Data From Multiple ASCII FIles.VBS" and the "Concatenate Groups.VBS" scripts downloaded from here, http://zone.ni.com/devzone/cda/epd/p/id/3870. When I run the importing data script and test it by highlighting the example data that comes with the download I get an error. "Error in <Importing Data From Multiple ASCII Files.VBS> (Line:60, Column: 11):  Variabls is undefined: 'AscIIAssocSet'  "
    The offending line of code is "  Call AsciiAssocSet(FilePaths(i), StpFilePath) ' assign STP file    "
    Screenshots of the error are attached.
    Can anyone tell me what this error is?  Am I just doing something wrong? Getting quite frustrated.
    Thanks in advance.
    Attachments:
    concactenate1.png ‏261 KB
    concactenate2.png ‏243 KB

    Please have a look at the DIAdem Example to concanate channels. Its delivered with DIAdem.
    Examples > Creating Scripts > Scripts > Appending Channels to Each Other
    Please use a dataplugin (File -> Text DataPlugin Wizard...) or the csv plugin to load your data.
    Greetings
    Andreas
    P.S.: The one you have downloaded needs the old Ascii Wizard that is not activated by default in newer DIAdem versions.
    If you want to use it anyway:
    Settings -> Options -> Extensions -> GPI Extensions ...
    Add gfsasci.dll

  • OLE Programe to Download Data to EXECL

    Im using the OLE programe to Download data from Application Server to My EXCEL file.REPORT ZTEST_34331_OLE_EXCEL NO STANDARD PAGE HEADING.
    {Code INCLUDE OLE2INCL.
    DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
    H TYPE I,
    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 : MSEG.
    DATA : ld_file LIKE rlgrap-filename.
    DATA : wa_string(1000) TYPE c.
    CONSTANTS: con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    table of Material number
    TYPES : BEGIN OF int_final,
             employee_sno(12),
             employee_code(13),
             first_name(40),
             last_name(40),
             gender(8),
             work_address(200),
             department(40),
             location(40),
             designation(40),
             employee_level(40),
             supervisor(40),
             mobile(40),
             work_phone(40),
             email(40),
             ice_contact(40),
             bloodgroup(12),
             dob(12),
             doj(12),
             dom(12),
             status(20),
             END OF int_final.
    DATA : wa_final TYPE int_final.
    DATA : wa_final1 TYPE int_final.
    DATA: int_temp TYPE int_final OCCURS 0 WITH HEADER LINE.
    DATA file_in TYPE rlgrap-filename.
    DATA file_out TYPE rlgrap-filename.
    DATA excel TYPE ole2_object.
    DATA workbook TYPE ole2_object.
    DATA SHEET TYPE ole2_object. "changed
    file_in = 'C:\it_results.xls'.
    file_out = 'c:\hr_data.xls'.
    *& Event START-OF-SELECTION
    START-OF-SELECTION.
    read material document Number
    ld_file = '/usr/sap/trans/abap/HR_DATA.xls'.
      OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc = 0.
        DO.
          CLEAR: wa_string, wa_final.
          READ DATASET ld_file INTO wa_string.
          IF sy-subrc NE 0.
            EXIT.
          ELSE.
            SPLIT wa_string AT con_tab INTO  wa_final-employee_sno
                                             wa_final-employee_code
                                             wa_final-first_name
                                             wa_final-last_name
                                             wa_final-gender
                                             wa_final-work_address
                                             wa_final-department
                                             wa_final-location
                                             wa_final-designation
                                             wa_final-employee_level
                                             wa_final-supervisor
                                             wa_final-mobile
                                             wa_final-work_phone
                                             wa_final-email
                                             wa_final-ice_contact
                                             wa_final-bloodgroup
                                             wa_final-dob
                                             wa_final-doj
                                             wa_final-dom
                                             wa_final-status.
            MOVE-CORRESPONDING wa_final TO wa_final1.
            APPEND wa_final1 TO int_temp.
          ENDIF.
        ENDDO.
        CLOSE DATASET ld_file.
    ENDIF.
    CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    IF sy-subrc NE 0.
      WRITE: / 'No EXCEL creation possible'.
      STOP.
    ENDIF.
    data:w_filename1 LIKE rlgrap-filename value 'c:\hr1_data.xls'.
    *SET PROPERTY OF H_EXCEL 'Visible' = 1.
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
    GET PROPERTY OF excel 'ActiveSheet' = sheet.  " changed
    *CALL METHOD OF H_MAPL 'Open' EXPORTING #1 = w_filename1.
    *CALL METHOD OF H_MAPL 'Add' = H_MAP.
    LOOP AT int_temp INTO WA_FINAL1.
    H = H + 1.
    PERFORM FILL_CELL USING H 1 0 WA_FINAL1-employee_sno.
    PERFORM FILL_CELL USING H 2 0 WA_FINAL1-employee_code.
    PERFORM FILL_CELL USING H 3 0 WA_FINAL1-first_name.
    PERFORM FILL_CELL USING H 4 0 WA_FINAL1-last_name.
    PERFORM FILL_CELL USING H 5 0 WA_FINAL1-gender.
    PERFORM FILL_CELL USING H 6 0 WA_FINAL1-work_address.
    PERFORM FILL_CELL USING H 7 0 WA_FINAL1-department.
    PERFORM FILL_CELL USING H 8 0 WA_FINAL1-location.
    PERFORM FILL_CELL USING H 9 0 WA_FINAL1-designation.
    PERFORM FILL_CELL USING H 10 0 WA_FINAL1-employee_level.
    PERFORM FILL_CELL USING H 11 0 WA_FINAL1-supervisor.
    PERFORM FILL_CELL USING H 12 0 WA_FINAL1-mobile.
    PERFORM FILL_CELL USING H 13 0 WA_FINAL1-work_phone.
    PERFORM FILL_CELL USING H 14 0 WA_FINAL1-email.
    ENDLOOP.
    CALL METHOD OF H_MAPL 'SaveAs' EXPORTING #1 = w_filename1
    #2 = 6.
    ."'c:\hr1_data.xls'.
    *CALL METHOD OF H_MAPL 'CLOSE'.
    *CALL METHOD OF H_EXCEL 'QUIT'.
    FREE OBJECT H_EXCEL.
    FREE OBJECT H_MAPL.
    disconnect from Excel
    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.
    SET PROPERTY OF H_ZL 'Value' = VAL .
    GET PROPERTY OF H_ZL 'Font' = H_F.
    SET PROPERTY OF H_F 'Bold' = BOLD .
    ENDFORM.
    code}
    Edited by: Neliea on Nov 2, 2009 5:34 AM

    FORM download_excel.
      CREATE OBJECT w_excel 'EXCEL.APPLICATION'. "Create object for Excel
      SET PROPERTY OF w_excel  'VISIBLE' = 0. "In background Mode
      CALL METHOD OF w_excel 'WORKBOOKS' = w_workbook.
      CALL METHOD OF w_workbook 'ADD'. "Create a new Workbook
      SET PROPERTY OF w_excel 'SheetsInNewWorkbook' = 3. "No of sheets
    PERFORM fill_data. " Fill the internal tables with the req. data
      OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc = 0.
        DO.
          CLEAR: wa_string, wa_final.
          READ DATASET ld_file INTO wa_string.
          IF sy-subrc NE 0.
            EXIT.
          ELSE.
            SPLIT wa_string AT con_tab INTO  wa_final-employee_sno
                                             wa_final-employee_code
                                             wa_final-first_name
                                             wa_final-last_name
                                             wa_final-gender
                                             wa_final-work_address
                                             wa_final-department
                                             wa_final-location
                                             wa_final-designation
                                             wa_final-employee_level
                                             wa_final-supervisor
                                             wa_final-mobile
                                             wa_final-work_phone
                                             wa_final-email
                                             wa_final-ice_contact
                                             wa_final-bloodgroup
                                             wa_final-dob
                                             wa_final-doj
                                             wa_final-dom
                                             wa_final-status.
            MOVE-CORRESPONDING wa_final TO wa_final1.
            APPEND wa_final1 TO int_temp.
          ENDIF.
        ENDDO.
        CLOSE DATASET ld_file.
    ENDIF.
      GET PROPERTY OF w_excel 'ActiveSheet' = w_worksheet.
      PERFORM download_sheet TABLES int_temp USING 2 'Book1'.
      GET PROPERTY OF w_excel 'ActiveSheet' = w_worksheet.
      GET PROPERTY OF w_excel 'ActiveWorkbook' = w_workbook.
      CALL METHOD OF w_workbook 'SAVEAS'
        EXPORTING #1 = p_file.
      FREE OBJECT: w_worksheet, w_excel.
    ENDFORM.                    "download_excel
    Edited by: Neliea on Nov 2, 2009 1:41 PM

  • How to export the data to Multiple sheet in Excel

    Hi,
    How can I export the data to multiple sheets in excel using Crystal Report XI.
    Thanks,
    Baski.
    Edited by: J_Baskaar on Mar 31, 2010 8:14 AM

    One of the 3rd-party Crystal report schedulers listed at http://www.kenhamady.com/bookmarks.html allows you to burst a report so that each group at level 1 becomes a separate worksheet inside a single workbook.

  • Query - How to output data to multiple Excel tabs?

    Hello,
    I have a quick question. Is it possible to build an ABAP query to send output data to multiple tabs in an Excel spreadsheet? I know this can be done at a single (first) tab level, but I am not sure if outputting data to multiple tabs is possible.
    For example, the address data for the different European countries should be directed to different tabs such as U.K., France, Germany, etc based on the country of residence.
    I appreciate your help with this.
    Thanks!

    Hi
    I think it is possible
    You define a common internal table with the address fields  and  based on the Language condition this table will be populated
    call the fun module to donwload to excel in a PERFORM using this Internal table and Language as paramter
    so that based on the language selection/condition the internal table will be filled from the data and that data will be passed to the fun module and downloaded to the file name given .
    pass the different file names to the fun module along with the PERFORM statement, so that different files will be created based on language
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Splitting comma seperated column data into multiple rows

    Hi Gurus,
    Please help me for solving below scenario. I have multiple value in single column with comma seperated values and my requirement is load that data into multiple rows.
    Below is the example:
    Source Data:
    Product         Size                                 Stock
    ABC              X,XL,XXL,M,L,S                 1,2,3,4,5,6
    Target Data:
    Product         Size                                 Stock
    ABC              X                                     1
    ABC              XL                                   2
    ABC              XXL                                 3
    ABC              M                                    4
    ABC              L                                      5
    ABC             S                                        6
    Which transformation we need to use for getting this output?
    Thanks in advance !

    Hello,
    Do you need to do this tranformation through OWB mapping only? And can you please tell what type of source you are using? Is it a flat file or a table?
    Thanks

  • Can we merge data from multiple sources in Hyperion Interactive Reporting ?

    Hi Experts,
    Can we merge data from multiple sources in Hyperion Interactive Reporting ?Example can we have a report based on DB2
    Oracle,
    Informix and Multidiemnsional Databases like DB2,MSOLAP,ESSBASE?
    Thanks,
    V

    Yes, Each have their own Query and have some common dimension for the Results Sections to be joined together in a final query.
    look in help for Creating Local Joins

Maybe you are looking for