Show TOC

Syntax documentationcreate_document Locate this document in the navigation structure

You use this method to open a new document in the office application.

Syntax Syntax

  1. CALL METHOD document->create_document
    EXPORTING open_inplace = open_inplace
    create_view_data = create_view_data
    onsave_macro = onsave_macro
    startup_macro = startup_macro
    document_title = document_title
    no_flush = no_flush
    IMPORTING error = error
    retcode = retcode.
End of the code.
Description of parameters

Parameter

Optional

Description

open_inplace

X

'X': Document is opened within the SAP GUI window (only if the parameter inplace = 'X' was set when you called the method get_document_proxy).

' ': Document is opened in a separate window.

create_view_data

X

Set this option if you want to save presentation data with the document. This is necessary if you want to use the view_document method.

onsave_macro

X

The name of a macro that is called if the document has been changed and one of the following conditions applies:

  • The user closes the application (if it is not running in-place)

  • You use one of the following methods:

    • save_document

    • reopen_document with do_save = 'X'

    • close_document with do_save = 'X'

      The Macro must be stored in the document.

      Note: What constitutes a change to the document differs from application to application:

  • MS Project and MS Excel almost always consider the document to have been changed, so the macro is called even if you have not made any physical changes

    In MS Word and MS Powerpoint, you must physically change the document in order for the macro to be called

startup_macro

X

Macro to be run when you open the document.

document_title

X

Title to be displayed in the title bar of the desktop application.

Caution Caution

You can only start one document in the SAP GUI window (in place).

End of the caution.

Note Note

If you open a document as a presentation, the application used to create it does not have to be installed on the presentation server. Due to the restrictions of OLE, only the first page of a document can be saved as a presentation.

End of the note.