Function module to download to excel sheet

what is the function module to download the report into excel  sheet??..
Thanks
Sri

hi,
use the alv list or alv grid  for the report output  then that functionality will be provided by default....
In general Gui_download is used and the final internal table which is used for displaying the output of the report is passed to the FM.
Regards,
Rohan.

Similar Messages

  • Function module to download into excel sheet in crm

    Hi,
            Needed the Function module to download the data from internal table into the excel sheet in the CRM
    <b></b>

    use
    FM :- GUI_DOWNLOAD
    Example Code.
    lv_file_name = 'c:abcd.xls'
    *----Load Detail Report Data to Excel File
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                = lv_file_name
            filetype                = 'DAT'
            write_field_separator   = 'X'
            codepage                = '4103'
          TABLES
            data_tab                = lt_det_report
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            OTHERS                  = 22.
      ENDIF.
      IF sy-subrc <> 0.
    *   202 : Error Occurred while writing data to the file.
        MESSAGE e202(zusm_gen) .
        EXIT.
      ELSE.
        WRITE :/ text-042 , lv_file_name.
      ENDIF.
    :- lt_det_report---> is table for storing data .
                         it can be any type
    <b>Please Reward Points & Mark Helpful Answers</b>
    To mark Helpful Answers ;click radio Button next to the post.
    RadioButtons
    <b>o</b> Helpful Answer
    <b>o</b> Very helpful Answer
    <b>o</b> Problem Solved.
    Click any of the above button next to the post; as per the anwers
    <b>To close the thread; Click Probelm solved Radio Button next to the post , which u feel is best possible answers</b>

  • Function module to download to Excel worksheet.

    Hi All,
            Need a function module to download internal table data to exact worksheet number in the excel sheet, that too it sholud be appended from some row number.
    The regular function modules are helping just to create an excel sheet and fill data, But not to append to exact work sheet, like work sheet no.5 or 6 of excel on presentation.
    Thanks in Advance,
    Regards,
    Yogesh

    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

  • Wht are the function modules for download upload excel files in bdc.

    hi all,
    this question seems to be silly but i had open office excel files i am getting problems to upload or down loading.  can you tell which function modules can upload or down load open office excel files.
    another dought this is not need full but i need to get some of graphics which are in se78  .
    how can we dowload them from sap.
    thanq,
    rajesh.k

    Hi,
      use  :   CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       REPORT  YKC_XL_UPLOAD.
    TYPE-POOLS TRUXS.
    TABLES : ZMARA.
    * Selection screen
    PARAMETER P_FILE TYPE RLGRAP-FILENAME DEFAULT
    'C:\Kris\TEST_UPLOAD.xls'.
    TYPES:  BEGIN OF T_TAB,
            MATNR   LIKE ZMARA-MATNR,
            ERSDA  LIKE ZMARA-ERSDA,
            ERNAM  LIKE ZMARA-ERNAM,
            END OF T_TAB.
    DATA :  T_UPLOAD  TYPE STANDARD TABLE OF T_TAB WITH HEADER LINE ,
            WA_UPLOAD TYPE T_TAB,
            IT_RAW TYPE TRUXS_T_TEXT_DATA.  "work table internal table
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = 'P_FILE '
        IMPORTING
          FILE_NAME     = P_FILE.
    START-OF-SELECTION.
    * Uploading the data in the file into internal table
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
    *   I_FIELD_SEPERATOR =
    *   I_LINE_HEADER  = 'X'
        I_TAB_RAW_DATA = IT_RAW
        I_FILENAME     = P_FILE
      TABLES
        I_TAB_CONVERTED_DATA = T_UPLOAD[]
      EXCEPTIONS
        CONVERSION_FAILED = 1
        OTHERS            = 2.
      IF SY-SUBRC NE  0.
        MESSAGE ID SY-MSGID
                TYPE SY-MSGTY
                NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    END-OF-SELECTION.
    * Uploading the data into the database table
      LOOP AT T_UPLOAD INTO T_UPLOAD.
        ZMARA-MATNR = T_UPLOAD-MATNR.
        ZMARA-ERSDA = T_UPLOAD-ERSDA.
        ZMARA-ERNAM = T_UPLOAD-ERNAM.
        INSERT  ZMARA.
    Endloop.
    Tks,
    Krishna

  • Function module to download to Excel ?

    Anybody know the name of a FM to call excel and download a file from SAP ?

    check the below program....
    Try this....
    *& 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.

  • Error in XXL_FULL_API function module for download report to excel

    Hi all,
    I am using XXL_FULL_API function module for download report to excel, In this FM we have to fill a table called sema        = t_gxxlt_s. in this table we have a fields called
    i_sema-col_no  = 19.
      i_sema-col_src = 19.
      i_sema-col_typ = 'STR'.
      i_sema-col_ops = 'DFT'
    here in 'col_typ' if we put STR in excel it will come as a text but i wnat the time field what i have to pass ?
    and for filed 'col_ops' also ??
    Thaks,
    Sridhar

    Hi sridhar joshi,
    Please check this program
    REPORT Excel.
    TABLES:
      sflight.
    * header data................................
    DATA :
      header1 LIKE gxxlt_p-text VALUE 'Suresh',
      header2 LIKE gxxlt_p-text VALUE 'Excel sheet'.
    * Internal table for holding the SFLIGHT data
    DATA BEGIN OF t_sflight OCCURS 0.
            INCLUDE STRUCTURE sflight.
    DATA END   OF t_sflight.
    * Internal table for holding the horizontal key.
    DATA BEGIN OF  t_hkey OCCURS 0.
            INCLUDE STRUCTURE gxxlt_h.
    DATA END   OF t_hkey .
    * Internal table for holding the vertical key.
    DATA BEGIN OF t_vkey OCCURS 0.
            INCLUDE STRUCTURE gxxlt_v.
    DATA END   OF t_vkey .
    * Internal table for holding the online text....
    DATA BEGIN OF t_online OCCURS 0.
            INCLUDE STRUCTURE gxxlt_o.
    DATA END   OF t_online.
    * Internal table to hold print text.............
    DATA BEGIN OF t_print OCCURS 0.
            INCLUDE STRUCTURE gxxlt_p.
    DATA END   OF t_print.
    * Internal table to hold SEMA data..............
    DATA BEGIN OF t_sema OCCURS 0.
            INCLUDE STRUCTURE gxxlt_s.
    DATA END   OF t_sema.
    * Retreiving data from sflight.
    SELECT * FROM sflight
             INTO TABLE t_sflight.
    * Text which will be displayed online is declared here....
    t_online-line_no    = '1'.
    t_online-info_name  = 'Created by'.
    t_online-info_value = 'KODANDARAMI REDDY'.
    APPEND t_online.
    * Text which will be printed out..........................
    t_print-hf     = 'H'.
    t_print-lcr    = 'L'.
    t_print-line_no = '1'.
    t_print-text   = 'This is the header'.
    APPEND t_print.
    t_print-hf     = 'F'.
    t_print-lcr    = 'C'.
    t_print-line_no = '1'.
    t_print-text   = 'This is the footer'.
    APPEND t_print.
    * Defining the vertical key columns.......
    t_vkey-col_no   = '1'.
    t_vkey-col_name = 'MANDT'.
    APPEND t_vkey.
    t_vkey-col_no   = '2'.
    t_vkey-col_name = 'CARRID'.
    APPEND t_vkey.
    t_vkey-col_no   = '3'.
    t_vkey-col_name = 'CONNID'.
    APPEND t_vkey.
    t_vkey-col_no   = '4'.
    t_vkey-col_name = 'FLDATE'.
    APPEND t_vkey.
    * Header text for the data columns................
    t_hkey-row_no = '1'.
    t_hkey-col_no = 1.
    t_hkey-col_name = 'PRICE'.
    APPEND t_hkey.
    t_hkey-col_no = 2.
    t_hkey-col_name = 'CURRENCY'.
    APPEND t_hkey.
    t_hkey-col_no = 3.
    t_hkey-col_name = 'PLANETYPE'.
    APPEND t_hkey.
    t_hkey-col_no = 4.
    t_hkey-col_name = 'SEATSMAX'.
    APPEND t_hkey.
    t_hkey-col_no = 5.
    t_hkey-col_name = 'SEATSOCC'.
    APPEND t_hkey.
    t_hkey-col_no = 6.
    t_hkey-col_name = 'PAYMENTSUM'.
    APPEND t_hkey.
    * populating the SEMA data..........................
    t_sema-col_no  = 1.
    t_sema-col_typ = 'STR'.
    t_sema-col_ops = 'DFT'.
    APPEND t_sema.
    t_sema-col_no = 2.
    APPEND t_sema.
    t_sema-col_no = 3.
    APPEND t_sema.
    t_sema-col_no = 4.
    APPEND t_sema.
    t_sema-col_no = 5.
    APPEND t_sema.
    t_sema-col_no = 6.
    APPEND t_sema.
    t_sema-col_no = 7.
    APPEND t_sema.
    t_sema-col_no = 8.
    APPEND t_sema.
    t_sema-col_no = 9.
    APPEND t_sema.
    t_sema-col_no = 10.
    t_sema-col_typ = 'NUM'.
    t_sema-col_ops = 'ADD'.
    APPEND t_sema.
    CALL FUNCTION 'XXL_FULL_API'
      EXPORTING
    *   DATA_ENDING_AT          = 54
    *   DATA_STARTING_AT        = 5
       filename                = 'TESTFILE'
       header_1                = header1
       header_2                = header2
       no_dialog               = 'X'
       no_start                = ' '
        n_att_cols              = 6
        n_hrz_keys              = 1
        n_vrt_keys              = 4
       sema_type               = 'X'
    *   SO_TITLE                = ' '
      TABLES
        data                    = t_sflight
        hkey                    = t_hkey
        online_text             = t_online
        print_text              = t_print
        sema                    = t_sema
        vkey                    = t_vkey
    EXCEPTIONS
       cancelled_by_user       = 1
       data_too_big            = 2
       dim_mismatch_data       = 3
       dim_mismatch_sema       = 4
       dim_mismatch_vkey       = 5
       error_in_hkey           = 6
       error_in_sema           = 7
       file_open_error         = 8
       file_write_error        = 9
       inv_data_range          = 10
       inv_winsys              = 11
       inv_xxl                 = 12
       OTHERS                  = 13
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    please refer this link
    http://www.thespot4sap.com/Articles/Download_to_excel.asp
    Best regards,
    raam

  • Function module to download data into excel file

    Hi Friends,
    Please tell me the function module name which popsup a popup box to specify a filename and the location and when clicking on the OK button, the file should be downloaded to the specified location.
    I need it ASAP.
    Thanks,
    Jaffer Ali.S

    Hi Shamshudeen,
    You have to use two funtion modules to acheive this.
    1. To get the file path from user.
    2. To download the excel sheet in prescribed path.
    For 1 use following code
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath .
        CALL FUNCTION 'F4_FILENAME'
         EXPORTING
           program_name        = syst-cprog
           dynpro_number       = syst-dynnr
      FIELD_NAME          = ' '
         IMPORTING
           file_name           = p_fpath  .
    The file path will be stored in p_fpath.
    Now use GUI_DOWNLOAD function module and pass the file name p_fpath to it along with filetype as .xls
    Hope this helps you.
    Thanks,
    Arun

  • Function Module to Download Internal table in EXCEL

    Hi All,
    I need a Function Module to download the Internal table to Excel File.
    I Have used SAP_CONVERT_TO_XLS_FORMAT,
    but this function modules are using GUI_Download indirectly.
    I dont want to use GUI_DOWNLOAD as i am going to call this Function Module in Portal.
    So pls anybody has this type of function module.
    Thanks & Regards,
    Dhruv Shah

    Hello Dhruv.
    In Agreement with Deniz.
    It is required to Export the query as an excel file.
    [SAP HELP Library - Standard Reference - Exporting as a CSV File / MS Excel 2000 File|http://help.sap.com/saphelp_nw04/helpdata/en/d2/11a28fc26d4042a6d230a9783152f2/content.htm]
    [SDN - Reference - Error in "Export to Microsoft Excel" from Portal|Error in "Export to Microsoft Excel" from Portal;
    Hope this works out well.
    Good Luck & Regards.
    Harsh Dave

  • Problem in downloading to excel sheet

    hi,
    i have a file in the application server which needs to be downloaded into excel sheet and send it via attachment to outlook id's..
    file is getting downloaded into excel sheet ( Via custom function module) and the attachment is being sent to the mail box, but the problem is everything appears in the first column..how to set the delimiters in excel sheet, i mean each field should appear in a separate coloumn...
    format of the file in the application server
    data: begin of dt_string occurs 0,
          data(150) type c,
          end of dt_string.
    ex: dt_string+0(4) = 'name'.
        dt_string+4(5) =  'place'. .....
        append dt_string
         clear dt_string. 
    same way, each record is inserted into the dt_string and the table was transferred to the app server.
    thanks

    Hi Mahesh,
    Assuming that you are using 'GUI_DOWNLOAD'.
    Add the thing in bold <b>WRITE_FIELD_SEPARATOR</b>.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                    =
        filename                        =
    *   FILETYPE                        = 'ASC'
    *   APPEND                          = ' '
    <b>   WRITE_FIELD_SEPARATOR           = '#'    "Tab Delimiter between fields</b>
    Regards,
    AS

  • How to extract the data from module pool program to Excel Sheet?

    Hi Guys
            I am having a requirement to transfer the data from Module pool screen to excel sheet directly.
            This is an urgent requirement.
            So plz reply me with some coding examples.
            I will give points for that.

    This report extract excel file. From that concept you can easily extract data from module pool program also by coding in PAI of the screen.
    REPORT ztest1 .
    * 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
          h_c type ole2_object.            " color
    DATA: FILENAME LIKE RLGRAP-FILENAME.
    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.
    * 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 200 'Carrier id'(001).
      perform fill_cell using 1 2 1 200 'Connection id'(002).
      perform fill_cell using 1 3 1 200 'City from'(003).
      perform fill_cell using 1 4 1 200 'City to'(004).
      perform fill_cell using 1 5 1 200 'Dep. Time'(005).
      loop at it_spfli.
    * copy flights to active EXCEL sheet
        h = sy-tabix + 1.
        if it_spfli-carrid cs 'AA'.
          perform fill_cell using h 1 0 000255000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'AZ'.
          perform fill_cell using h 1 0 168000000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'JL'.
          perform fill_cell using h 1 0 168168000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'LH'.
          perform fill_cell using h 1 0 111111111 it_spfli-carrid.
        elseif it_spfli-carrid cs 'SQ'.
          perform fill_cell using h 1 0 100100100 it_spfli-carrid.
        else.
          perform fill_cell using h 1 0 000145000 it_spfli-carrid.
        endif.
        if it_spfli-connid lt 400.
          perform fill_cell using h 2 0 255000255 it_spfli-connid.
        elseif it_spfli-connid lt 800.
          perform fill_cell using h 2 0 077099088 it_spfli-connid.
        else.
          perform fill_cell using h 2 0 246156138 it_spfli-connid.
        endif.
        if it_spfli-cityfrom cp 'S*'.
          perform fill_cell using h 3 0 155155155 it_spfli-cityfrom.
        elseif it_spfli-cityfrom cp 'N*'.
          perform fill_cell using h 3 0 189111222 it_spfli-cityfrom.
        else.
          perform fill_cell using h 3 0 111230222 it_spfli-cityfrom.
        endif.
        if it_spfli-cityto cp 'S*'.
          perform fill_cell using h 4 0 200200200 it_spfli-cityto.
        elseif it_spfli-cityto cp 'N*'.
          perform fill_cell using h 4 0 000111222 it_spfli-cityto.
        else.
          perform fill_cell using h 4 0 130230230 it_spfli-cityto.
        endif.
        if it_spfli-deptime lt '020000'.
          perform fill_cell using h 5 0 145145145 it_spfli-deptime.
        elseif it_spfli-deptime lt '120000' .
          perform fill_cell using h 5 0 015215205 it_spfli-deptime.
        elseif it_spfli-deptime lt '180000' .
          perform fill_cell using h 5 0 000215205 it_spfli-deptime.
        else.
          perform fill_cell using h 5 0 115115105 it_spfli-deptime.
        endif.
      endloop.
    * EXCEL FILENAME
      CONCATENATE SY-REPID '_' SY-DATUM+6(2) '_' SY-DATUM+4(2) '_'
                  SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
      CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
      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 col 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.
      set property of h_f 'Color' = col.
      perform err_hdl.
    endform.                    "FILL_CELL
    *&      Form  ERR_HDL
    *       outputs OLE error if any                                       *
    *  -->  p1        text
    *  <--  p2        text
    form err_hdl.
      if sy-subrc <> 0.
        write: / 'OLE-Automation Error:'(010), sy-subrc.
        stop.
      endif.
    endform.                    " ERR_HDL

  • Is there any  function module to download pdf file

    is there any  function module to download pdf file
    WITH OUT GUI_DOWNLOAD FUNCTION MODULE.
    THANKS IN ADVANCED.

    Dear Laxman,
    Tryout the following Function Modules:
    (1)  CONVERT_ABAPSPOOLJOB_2_PDF --> convert abap spool output to PDF
    (2)  CONVERT_OTF --> Convert SAP documents (SAPScript) to other types.
    Example:
    CALL FUNCTION "CONVERT_OTF"
           EXPORTING    FORMAT                = "PDF"
           IMPORTING    BIN_FILESIZE          = FILE_LEN
           TABLES       OTF                   = OTFDATA
                        LINES                 = PDFDATA
           EXCEPTIONS   ERR_MAX_LINEWIDTH     = 1                  
                        ERR_FORMAT            = 2
                        ERR_CONV_NOT_POSSIBLE = 3
                        OTHERS                = 4.
    Regards,
    Abir
    Don't forget to award Points *

  • Function module to download pictures

    Is there any function module to download picture in local system. I want something like gui_download but which should download pictures.

    hi..
    this link might help u.
    Download logo from R/3
    Re: Download
    regards,
    padma

  • Function module to download using file browser

    FUNCTION MODULE TO download the data to a file by choosing the path using file browser.

    In your selection screen use this below logic. Then on the screen a pop up file browser wud appear where you can select the path to download the file.
    PS: If this solves your problem please reward points and mark this question answered.
    Regards.
    SELECT-OPTIONS AND PARAMETERS                                        *
    Local File path
    SELECTION-SCREEN BEGIN OF BLOCK file_info  WITH FRAME TITLE text-001.
    PARAMETER : p_file TYPE ibipparms-path .
    SELECTION-SCREEN END OF BLOCK file_info.
    AT SELECTION-SCREEN EVENTS    - validate user input                  *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    *Pop up screen to select the local file from PC
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p_file.

  • Function Module to DownLoad data in excel.

    Hi All,
    Is there a FM to download data in excel sheet.
    Regards,
    Vidya.

    Hi use this works.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    Uploading data from Local system to SAP.
    PARAMETERS: p_file TYPE  rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    START-OF-SELECTION.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
        I_FIELD_SEPERATOR        =
          i_line_header            =  'X'
          i_tab_raw_data           =  it_raw            " WORK TABLE
          i_filename               =  p_file
        TABLES
          i_tab_converted_data     = i_spread[]         "ACTUAL DATA
       EXCEPTIONS
          conversion_failed        = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

  • Download to Excel sheet

    Hi Experts,
                    I am downloading internal table data to excel sheet using
    FM 'SAP_CONVERT_TO_XLS_FORMAT', i want also the column headings to be printed in excel sheet. I am able to get data into excel sheet but not the headers. can any one help me out regarding this.
    Thanks in Advance.
    Regards,
    Krishna

    hi,
    even using GUI_DOWNLOAD ,u can include fieldnames in ur exel sheet
    The following are the long text for the parameter FIELDNAMES of GUI_DOWNLOAD.
    FU GUI_DOWNLOAD                   FIELDNAMES
    Short Text
    Field Names for the 'DBF' File Type
    Description
    Optional table with column names for the individual columns.
    'DBF': The column names are entered into the structure definition of the DBF file.
    'DAT':  An additional row with the column names is inserted at the beginning of the table.
    Function Module
    GUI_DOWNLOAD
    chk this program
    data : Begin of t_header occurs 0,
           name(30) type c,
           end of t_header.
    data : Begin of itab occurs 0,
           fld1 type char10,
           fld2 type char10,
           fld3 type char10,
           end   of itab.
    DATA: v_pass_path TYPE string.
    append itab.
    itab-fld1 = 'Hi'.
    itab-fld2 = 'hello'.
    itab-fld3 = 'welcome'.
    append itab.
    append itab.
    append itab.
    append itab.
    append itab.
    t_header-name = 'Field1'.
    append t_header.
    t_header-name = 'Field2'.
    append t_header.
    t_header-name = 'Field3'.
    append t_header.
      CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
        EXPORTING
          default_extension     = 'XLS'
        IMPORTING
          fullpath              = v_pass_path.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                        = v_pass_path
          filetype                        = 'DBF'
        TABLES
          data_tab                        = itab
          FIELDNAMES                      = t_header
    Edited by: SivaKumar on Jul 5, 2008 10:07 AM

Maybe you are looking for