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

ABAP/Excel: Method Save_as

Dear all,

Does anyone have experience with the method Save_as of the document proxy.

Although I supply a filename as parameter the document name in Excel (in this case) is always the Document title under which the Document has been created initially.

Does anyone have a solution?

Kind regards,


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jun 28, 2004 at 06:23 PM

    I have used it without the problem you mention. The following is the sample code from 46C:

    ****Save the document

    call method document->save_as


    file_name = item_url.

    call method c_oi_errors=>show_message exporting type = 'E'.

    I have also done it from OLE. If you have problems you might try that:

    • handles for OLE objects

    data: h_excel type ole2_object, " Excel object

    ole_books type ole2_object,

    ole_databook type ole2_object.

    • start Excel

    data: file_type type i.

    file_type = '-4143'.

    create object h_excel 'EXCEL.APPLICATION'.

    set property of h_excel 'Visible' = 0.

    call method of h_excel 'Workbooks' = ole_books.

    call method of ole_books 'Open' = ole_databook

    exporting #1 = i_source_file.

    call method of ole_databook 'SaveAs'

    exporting #1 = i_destination_file

    #2 = file_type.

    call method of h_excel 'Quit'.

    free object ole_databook.

    free object ole_books.

    free object h_excel.

    The SaveAS with OLE lets you choose a filetype. -4143 is native Excel. 44 is HTML and 46 is XML.

    Add a comment
    10|10000 characters needed characters exceeded

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.