Show TOC

Background documentationOfficeControl Locate this document in the navigation structure

 

With the OfficeControl UI element, you can insert an Office document into a view. This enables you to display the following Office documents in a Web Dynpro application:

  • Microsoft Word documents in Microsoft binary format with the extension doc.

    If you have Microsoft Office 2007 installed, XML-based file name extensions docx and docm are supported.

  • Microsoft Excel documents in Microsoft binary format with the extension xls.

    If you have Microsoft Office 2007 installed, XML-based file name extensions xlsx and xlsm are supported.

  • Microsoft Project documents with the extension mpp.

    When importing or exporting MS Project documents (IF_IOS_PROJECT~EXPORT_XML and IF_IOS_PROJECT~IMPORT_XML), for security reasons a whitelist is evaluated. To do this, in interface IF_IOS_PROJECT~SET_WHITELIST the names on the whitelist are referenced. The same whitelist is used as for AcfUpDownload. Note that for reasons of security, abbreviations such as $HOME are notsupported in Microsoft Project integration.

OfficeControl is provided as an Active UI Element (ActiveX control element), which means that the UI element can be displayed by browsers that support ActiveX controls.

When using Microsoft Office and browsers that do not support ActiveX controls, the user receives the runtime exception Office Integration through Applet is not supported.

Caution Caution

The integration of active controls like OfficeControl in Web Dynpro ABAP popups is not supported.

End of the caution.

More information: Office Integration

Implementation Details

The implementation of the OfficeControl UI element supports the following functions for the Office documents mentioned above:

  • Open

  • Close

  • Save

  • Create new documents

Note Note

A document can be opened and closed only by setting the OfficeControl.visible property to visible or none and OfficeControl.expertMode=false. It is a pure display scenario (OfficeControl.expertMode=false), which is especially suitable for prototyping. Keep in mind that this type of scenario can cause performance bottlenecks.

Documents can be edited only if OfficeControl.expertMode=true.

Note that OfficeControl is only active if the visible property is set to visible. Processing is done in the background with visible, and width, height = 0.

End of the note.

In expertMode additional method calls are provided for complex operations.

   

Example of the Visualization

IOS_TEST_EXCEL (IOS_TEST_EXCEL)

Runtime Class

CL_WD_OFFICE_CONTROL

Properties in View Designer

Name

Type

Initial Value

Bindable

ID

STRING

(automatic)

No

activateInPlace

WDY_BOOLEAN

true

Yes

additionalArchives

STRING

No

archive

STRING

No

classId

STRING

No

codeBase

STRING

No

contextMenuBehaviour

WDUI_CONTEXT_MENU_BEHAVIOUR

inherit

No

contextMenuId

WDY_MD_UI_ELEMENT_REFERENCE

No

controlId

STRING

No

dataSource

XSTRING

Yes

documentName

STRING

Yes

documentType

WDUI_OFFICE_DOC_TYPE

ms_word

Yes

enabled

WDY_BOOLEAN

true

Yes

enableReadWrite

WDY_BOOLEAN

true

Yes

expertMode

WDY_BOOLEAN

false

Yes

height

STRING

300px

Yes

lifeTime

WDUI_LIFE_TIME

whenVisible

Yes

showDecoration

WDY_BOOLEAN

true

Yes

tooltip

Translatable text

Yes

type

STRING

No

visible

WDUI_VISIBILITY

visible

Yes

width

STRING

300px

Yes

Events in View Designer

Name

onClose

onError

onSave

Other properties that can be inherited are defined in the related higher-level classes. The related UI elements are:

Dynamic Programming

For dynamic programming, the same properties, events and aggregations are available as in the View Designer. Note the different spellings.

Dynamic Programming of Properties

View Designer Name

Runtime Name

Type

activateInPlace

ACTIVATE_IN_PLACE

WDY_BOOLEAN

additionalArchives

ADDITIONAL_ARCHIVES

STRING

archive

ARCHIVE

STRING

classId

CLASS_ID

STRING

codeBase

CODE_BASE

STRING

contextMenuBehaviour

CONTEXT_MENU_BEHAVIOUR

WDUI_CONTEXT_MENU_BEHAVIOUR

 contextMenuBehaviour: inherit

CL_WD_OFFICE_CONTROL=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT

 contextMenuBehaviour: provide

CL_WD_OFFICE_CONTROL=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE

 contextMenuBehaviour: suppress

CL_WD_OFFICE_CONTROL=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS

contextMenuId

CONTEXT_MENU_ID

WDY_MD_UI_ELEMENT_REFERENCE

controlId

CONTROL_ID

STRING

dataSource

DATA_SOURCE

XSTRING

documentName

DOCUMENT_NAME

STRING

documentType

DOCUMENT_TYPE

WDUI_OFFICE_DOC_TYPE

 documentType: ms_excel

CL_WD_OFFICE_CONTROL=>E_DOCUMENT_TYPE-MS_EXCEL

 documentType: ms_word

CL_WD_OFFICE_CONTROL=>E_DOCUMENT_TYPE-MS_WORD

 documentType: ms_project

CL_WD_OFFICE_CONTROL=>E_DOCUMENT_TYPE-MS_PROJECT

enabled

ENABLED

WDY_BOOLEAN

enableReadWrite

ENABLE_READ_WRITE

WDY_BOOLEAN

expertMode

EXPERT_MODE

WDY_BOOLEAN

height

HEIGHT

STRING

lifeTime

LIFE_TIME

WDUI_LIFE_TIME

 lifeTime: whenAlive

CL_WD_OFFICE_CONTROL=>E_LIFE_TIME-WHEN_ALIVE

 lifeTime: whenVisible

CL_WD_OFFICE_CONTROL=>E_LIFE_TIME-WHEN_VISIBLE

showDecoration

SHOW_DECORATION

WDY_BOOLEAN

tooltip

TOOLTIP

WDY_MD_TRANSLATABLE_TEXT

type

TYPE

STRING

visible

VISIBLE

WDUI_VISIBILITY

 visible: none

CL_WD_OFFICE_CONTROL=>E_VISIBLE-NONE

 visible: visible

CL_WD_OFFICE_CONTROL=>E_VISIBLE-VISIBLE

width

WIDTH

STRING

Dynamic Programming of Events

View Designer Name

Runtime Name

onClose

ON_CLOSE

onError

ON_ERROR

onSave

ON_SAVE

Example

You can find examples of this UI element in the system in package SIOS: