Skip to Content
author's profile photo Former Member
Former Member

downloading data to excell file

hi !

I wanted to ask, if i can and how to write data from abap

program to file in excel format ( not to txt format file).

please send me a code.

thanks

moshe

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 02:06 PM

    hi,

    try this

    data : begin of itab occurs 0,

    x2(100) type c,

    end of itab.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = 'c:\test1.xls'

    FILETYPE = 'ASC'

    HAS_FIELD_SEPARATOR = '#'

    TABLES

    DATA_TAB = itab.

    cheers,

    sasi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 02:25 PM

    Hi,

    Try OLE Automation...

    Check this link,

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/technologies/an easy reference for ole automation.article

    http://www.sapdevelopment.co.uk/ms/mshome.htm>

    Hope it helps u.

    Thanks&Regards,

    Ruthra.R

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      Select the file into which you want to download.

      CALL METHOD cl_gui_frontend_services=>file_open_dialog

      EXPORTING

      window_title = 'Select Download File'

      default_extension = 'xls'

      CHANGING

      filename = lv_filename

      path = lv_path

      fullpath = lv_fullpath

      user_action = lv_rc

      EXCEPTIONS

      cntl_error = 1

      OTHERS = 2.

      Call this function to download

      CALL FUNCTION 'GUI_DOWNLOAD'

      EXPORTING

      filename = lv_filename

      filetype = 'ASC'

      TABLES

      data_tab = lt_csv

      EXCEPTIONS

      file_write_error = 1

      gui_refuse_filetransfer = 3

      invalid_type = 4

      no_authority = 5

      disk_full = 17

      OTHERS = 22.

      Thanks,

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.