Skip to Content
avatar image
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,

John.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • 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

    exporting

    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 comment
    10|10000 characters needed characters exceeded