Skip to Content
0
Former Member
Apr 15, 2010 at 08:43 AM

Display MS word file in Office control

64 Views

Hi all,

I am using the Office control UI element to display a MS word file in WD application. I have created a Mime object for the word file and get this file data into a Xstring attribute, and bind this attribute with the datasource property of the Office control.

But at the runtime I am not able to display the Word file, it displays only a White colour container with text SAP IOS. Can anyone suggest me how I can get the word file in WD component using office control.

I have also checked SOIS pakage, but didn't get any solution from the example given in this package.

For your reference I am using the below code to get the mime object in Xstring attribute.

DATA:

mime_repository TYPE REF TO if_mr_api,

content TYPE xstring,

url TYPE string VALUE '/SAP/BC/WEBDYNPRO/SAP/ZTEST_SAN5/TEST.docx'.

mime_repository = cl_mime_repository_api=>get_api( ).

CALL METHOD mime_repository->get

EXPORTING

i_url = url

IMPORTING

e_content = content.

DATA lo_nd_office TYPE REF TO if_wd_context_node.

DATA lo_el_office TYPE REF TO if_wd_context_element.

DATA ls_office TYPE wd_this->element_office.

DATA lv_test TYPE wd_this->element_office-test.

  • navigate from <CONTEXT> to <OFFICE> via lead selection

lo_nd_office = wd_context->get_child_node( name = wd_this->wdctx_office ).

  • get element via lead selection

lo_el_office = lo_nd_office->get_element( ).

lv_test = content.

  • Set single attribute

lo_el_office->set_attribute(

EXPORTING

name = `TEST`

value = lv_test ).

This lv_test having the Xstring data after execution but didn't set this data as word file at runtime.

Please suggest if anyone have any idea on this.

Thanks

Sanket