How to download BDC transaction data to excel sheet directly.

Please don't have your subject in all CAPITALS.  Now edited
Hello Experts,
                      i have been working on a BDC Tool,so the main job of this tool is
  Generate BDCDATA from  Excel Tool and pass as an input to a program to perform BDC (Session/Call Transaction).
so i want to the download data from BDC recording directly to excel sheet but i am unable to download it.
hope u all are clear with my question
with thanx and regards
harish
Edited by: Matt on Apr 24, 2009 10:44 AM

Hiii,
Plz refer the below code.
    CALL TRANSACTION 'MEK1' USING it_bdcdata OPTIONS FROM x_ctuprms
                             MESSAGES INTO it_bdcmsg.
***collect the messages.
  LOOP AT it_bdcmsg INTO wa_bdcmsg.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        id        = wa_bdcmsg-msgid
        lang      = sy-langu
        no        = wa_bdcmsg-msgnr
        v1        = wa_bdcmsg-msgv1
        v2        = wa_bdcmsg-msgv2
        v3        = wa_bdcmsg-msgv3
        v4        = wa_bdcmsg-msgv4
      IMPORTING
        msg       = message
      EXCEPTIONS
        not_found = 1
        OTHERS    = 2.
**collect the messages into an internal table.
endloop.
then use "gui_download" to download data.
Regards,
Anil N.

Similar Messages

  • How to populate the Quering data into Excel sheet in Oracle

    Dear Guys,
    How to populate the Quering data into Excel sheet in oracle.
    Please provide a solution.
    Thanks & Regards,
    Senthil K Kumar

    Hi
    To make Excel sheets from sqlplus, you can use the markup html tag in sqlplus.
    Here's an example.
    Example
    <code>
    SET LINESIZE 4000
    SET VERIFY OFF
    SET FEEDBACK OFF
    SET PAGESIZE 999
    SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
    SPOOL c:\test_xls.xls
    SELECT object_type
    , SUBSTR( object_name, 1, 30 ) object
    , created
    , last_ddl_time
    , status
    FROM user_objects
    ORDER BY 1, 2
    SPOOL OFF
    SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON
    SET LINESIZE 2000 VERIFY ON FEEDBACK ON
    </code>

  • How to  send ALV output data into Excel sheet format via Mail to the user?

    Hi friends,
    I have a doubt ie,
    How to  send ALV output data into Excel sheet format via Mail to the user?
    regards
    Moosa

    Hi,
    Provide the output internal table to the objbin in the below FM
    Send Message
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                document_data              = i_docdata
                put_in_outbox              = c_x
           TABLES
                packing_list               = i_objpack
                object_header              = i_objhead
                contents_bin               = i_objbin
                contents_txt               = i_objtxt
                receivers                  = i_reclist
    and specify the document type
      i_objpack-doc_type   = 'XLS'.
    and try.
    Regards,
    Nandha

  • Download Sales Contract data into Excel sheet

    Hi,
    I need to download the Sales Contract Data into excel sheet is there a Function module that i can use?? Else how do i go about it. Kindly help.
    Thanks,
    Riya.

    use the function module FUNCTION 'GUI_DOWNLOAD'
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    filename = 'C:\REPORT.XLS'
    FILETYPE = 'ASC'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = 'X'
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
    tables
    data_tab = IT_PR
    FIELDNAMES =
    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
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.

  • How to download logo and heading in excel sheet.

    Hi ,
    can any one tell me how i will download the logo in the excel sheet by using program.
    Regards,
    Priti shrivastava

    Hope you are comfortable with inserting header in to excel sheet.
    Regarding Logo see the below code snippet:-
    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 = 'SURESH KUMAR PARVATHANENI'.
    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.

  • How to downlaod vednor master data into excel sheet in SAP Application serv

    Hi friends
    I want to download SAP vendor master data into excel sheet and the file should be stored in SAP Application server Location with padding zeros.
    Please help me.
    Thanks

    Hi Ramesh,
    It is not possible to download data in Excel file on application server. You can better download the same in tab separated text file and then convert that text file to XLS.
    Please do not open multiple threads for same problem.
    Regards,
    Atish

  • How to downlaod vednor master data into excel sheet in SAP Application ser

    Hi friends
    I want to download SAP vendor master data into excel sheet and the file should be stored in SAP Application server Location with padding zeros.
    Please help me.
    Thanks

    Hi Ramesh,
    You can download the data into application server using the following code. You will have the vendor details in the internal table. Then you will open a file and transfer the data as follows.
    *   Download internal table to Application server file(Unix)
    DATA: e_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.     
      open dataset e_file for output in text mode.
      lOOP AT it_datatab......
        transfer it_datatab to e_file.
      ENDLOOP.
      close dataset e_file.
    In application server you will have only files and not excel sheets.
    Reward points if useful,
    Aleem.

  • How to download the PO data to excel file

    Hi..
    How to download the SAP purchase order details on EXCEL file.
    Thank and Regards
    Baskaran.P

    Use tables EKKO and EKPO for header and item detail information
    Use the below reports
    Source - SAP Standard Reports - ERP Operations - SCN Wiki
    No
    Broad level Report
    Options available for report execution
    Tcode in SAP
    Remarks
    Used by
    Report area
    1
    Purhase order analysis
    By delivey schedule
    By purchase order details
    By purchase order hostory
    ME80FN
    This report can be used for displaying the information of purchase orders created and the transactions that has taken place.
    Purchase
    Purchase
    2
    Purchase order display
    By supplier
    By material
    By buyer
    By plant
    ME2L
    ME2M
    Facility available to restrict the viewing based on the status of PO viz. Partly received,
    Closed, No GR made
    Bill passing not done , etc.
    Purchase
    Purchase
    3
    Anlysis of order values
    By Material
    By buyer
    By supplier
    ME81N
    Totals analysis
    ABC analysis
    Analysis using comparison period
    Frequency analysis
    Purchase & Finance
    Purchase
    4
    Goods receipt forecast
    By purchase order
    By vendorwise
    By material wise
    ME2V
    Number of anticipated deliveries
    Pruchase & Stores
    Purchase
    5
    Stock lying with subcontractors
    By Supplier
    By material
    ME2O
    Can be useful in deciding which component is to be given to supplier if the procurement is on subcontracting basis. It also helps in giving the visibility of stocks lying at subcontractor.
    Pruchase & Stores
    Purchase
    6
    Monitor supplier confirmation
    By Supplier
    By buyer
    ME2A
    This program is useful especially for imported purchase orders or such cases where the lead time of procurement is very high.
    Purchase & planning
    Purchas

  • Downloading table control data in excel sheet

    Hi experts,
    I have written a module pool pgm which fetches the data from a table and filled in a table control. Now my requirement is to download this (table control data) in an excel sheet like we download the ALV report data in an excel sheet.
    Can the same downloading option be provided in module pool pgm also?
    Pls tell me how it is possible to download the table control data in an excel sheet in module pool?
    Regards,
    Shanthi

    Hi Shanthi,
    As you can display data in Table Control means data is available in Internal Table
    Give Download Button
    case ok_code.
    when 'DOWN'.
          CALL FUNCTION 'F4_FILENAME'
            IMPORTING
              file_name = path1.
          CALL FUNCTION 'GUI_DOWNLOAD' " Go through FM Documentatin for more Info
            EXPORTING
              filename              = path1
              filetype              = 'ASC'
              write_field_separator = 'X'
            TABLES
              data_tab              = ist_final
              fieldnames            = ist_fc_download " You can provide the Column Heading
            EXCEPTIONS
              OTHERS                = 22.
    endcase.
    Cheerz
    Ram
    Edited by: Rob Burbank on Mar 20, 2010 5:04 PM

  • Download internal table data into excel sheet with column heading and data

    Hi,
      I am having one internal table with column headings and other table with data.
    i want to download the data with these tables into an excel sheet.
    It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
    Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
    what we have to do for storing the file name in runtime.
    Can anyone help me on this.
    Thanks,
    Rose.

    Hi Camila,
        Try this
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = PATH2
       FILETYPE                        = 'XLS'
      TABLES
        DATA_TAB                        = IT_DATA
       FIELDNAMES                      = IT_HEADINGS
    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

  • How to delete the Junk Data From Excel Sheet

    Dear ABAPers,
                I am uploading the Excel sheet from the Desktop to the SAP System. In the Internal table i am getting Unwanted Junk data's for Example '##########'.I am not getting this Junk data for all the times. i am getting it for Some times.How to ignore these junk data.
    Thanks & Regards,
    Ashok.

    Dear Friends,
                I communicated wrongly.I am very sorry for that.The Problem is I am getting All the Data into the internal table in addition to that lines i am getting the Junk data in the internal table at the end of the internal table.
    Excel Sheet
    L-1     21.10.2008     1110     888555444676001
    L-1     21.10.2008     1110     888555444676002
    L-1     21.10.2008     1110     888555444676003
    L-1     21.10.2008     1110     888555444676004
    Internal table
    L-1     21.10.2008     1110     888555444676001
    L-1     21.10.2008     1110     888555444676002
    L-1     21.10.2008     1110     888555444676003
    L-1     21.10.2008     1110     888555444676004
    Thanks & Regards,
    Ashok.

  • How to identify if the data is excel sheet is not on fixed column in SSIS package

    Hi, I am using SSIS 2008 R2 in which my excel file is the source for data. I am using the "Excel Source" transformation. For the normal data feed and all it is working fine.
    There is a requirement the data in the excel sheets are not static. For example think like, data may start from A1 Cell next it may be B1 or B2 and next time E1 or F2 like that. How to identify in which Cell the data is there to load to DB?
    Kindly tell me whatever the possibilites are there ....
    Sridhar

    Hi ,
      The mapping of SSIS packages cannot be modified at run time based on the input. Instead , you may consider to bring all the columns from excel into a staging table and figure out from where the data starts. Then load the destination table. If not
    you need to think of creating the ssis package itself dynamically using .Net code based on the excel metadata.
    Best Regards Sorna

  • HOw to convert Oracle Table data to Excel Sheet

    I need to convert Some of fields from my table to Excell sheet. I dont want to use 3rd party tools. Is there any querry to generate Excell sheet????

    There is no direct path to make Excel file from query, instead you may generate a CSV file (comma-separated-values) or TAB separated values file.
    On SQL*Plus
    SQL> set heading off
    SQL> set newpage none
    SQL> set linesize 255 --could be more
    SQL> spool /path/filename.txt
    SQL> select column1||chr(<ascii for Tab>)||column2||...||columnK
    from table
    SQL> spool off
    Hope it helps

  • How to download internal table data to excel in WebUI

    Hi everyone,
    I am trying to download the contents of an internal table to excel in CRM Web UI.
    One way, would be to create a table view and use the export to excel button.
    However, wish to avoid this and directly download using code.
    Also tried converting to xstring and setting data in the response object. However, this works only when I execute the component directly from BSP_WD_CMPWB. In the UI framework however, when I click on custom button(for download), it navigates to a screen where the contents of string are shown directly on browser.
    Is there any other way of doing this?
    Thanks in advance.
    Regards,
    Deepak

    Hi,
    there are two ways to download excel from the webclient using table views. The first is a XML stream that is send to Excel directly. Only works for Excel 2003 and later. The second is the fall back to a .csv.
    I do not know if for the second option a direct connection is established as mentioned in the last post or there is actually a file stream send to the client.
    Anyway the SAP provides the excel download through a seperate webservice. Have a look at CL_CHTMLB_CONFIG_TAB_EXCEL_EXP->IF_HTTP_EXTENSION~HANDLE_REQUEST( ).
    I suppose going the same direction with your excel download will work. This service opens a new download stream with the excel content... Maybe it is even possible to copy it and adjust it to your needs...
    cheers Carsten

  • Download internal table data to Excel in background

    Hi all ,
      Can anyone tell that how i can download internal table data
    into Excel sheet  in Backgroud Mode .
    I used both fun mod  ws and gui download but these are not working in background mod .
    Please help  issue is urgent .
    Answer is rewarded  by point .
    With Regards ,
    Nilesh Jain

    hi,
    you have to use  function module 'SAP_CONVERT_TO_XLS_FORMAT'.
    DATA:
    ITAB1 TYPE TRUXS_T_TEXT_DATA.
    CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
    EXPORTING
      I_FIELD_SEPERATOR          = ';'
      I_LINE_HEADER              =
       i_filename                 = filename
      I_APPL_KEEP                = ' '
    tables
       i_tab_sap_data             = itab
    CHANGING
      I_TAB_CONVERTED_DATA       = itab1
    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.
    try this one.
    reward points if useful,
    thanks & regards,
    rajee.

Maybe you are looking for

  • Possible to do BDC in a Web service?

    Hi, I need to create a BDC program that can create a Batch Input session. I have a external program that will trigger this BDC program. I was thinking if it is possible to create a RFC that contain the BDC code and eventually created a Web service th

  • Conversion data type error at universe level

    Hi Friends, I am trying to convert a object datatype from number to char by using cast function in Universe Designer. I am getting bellow error. Help me on this. Thanks Riaz

  • Windows 2003 Powershell and SharePoint 2007

    I know its old versions of a lot of things, but I need to run a Powershell script on a SharePoint 2007 list. I wrote the script and it works perfectly well if I run it under the SharePoint System Admin account. But as we all know updating a list item

  • Will I lose data if I upgrade from Leopard to Snow Leopard?

    I have OS X version 10.5.8 (Leopard).  I bought Snow Leopard 10.6.3 to upgrade my OS but have not installed it yet. I plan to upgrade to the latest OS (Yosemite) for free after upgrading to Snow Leopard.  Will I lose data by doing this? 

  • Can limit loop on FIELD-SYMBOLS list ?

    i have loop ....   LOOP AT <GT_TABLE> ASSIGNING <DYN_TABLE1> . i want to do LOOP AT <GT_TABLE> ASSIGNING <DYN_TABLE1> where but i get message that the 'LOOP .. WHERE' Have to be statically define