Skip to Content
0
May 09, 2014 at 01:38 PM

how to open word document form html container url iam getting internal_error while opening file

218 Views

Hi all,

By using below code i am able to download word document file from html container. But before downloading i need edit these document to add Macro.

I am unable to open word document.

CREATE OBJECT G_HTML_CONTAINER
EXPORTING
CONTAINER_NAME = 'PDF'.

CREATE OBJECT G_HTML_CONTROL
EXPORTING
PARENT = G_HTML_CONTAINER.

* Convert xstring to binary table to pass to the LOAD_DATA method
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = LV_CONTENT
TABLES
BINARY_TAB = LT_DATA.

data_tab = LT_DATA ).
* Load the HTML
CALL METHOD G_HTML_CONTROL->LOAD_DATA(
EXPORTING
TYPE = 'application'
SUBTYPE = 'DOC'
IMPORTING
ASSIGNED_URL = LV_URL
CHANGING
DATA_TABLE = LT_DATA
EXCEPTIONS
DP_INVALID_PARAMETER = 1
DP_ERROR_GENERAL = 2
CNTL_ERROR = 3
OTHERS = 4 ).

* Show it
CALL METHOD G_HTML_CONTROL->SHOW_URL( URL = LV_URL
IN_PLACE = 'X' ).


Before file download i want edit the file for that i am using below class.


PROXY TYPE REF TO I_OI_DOCUMENT_PROXY.



by using (get_document_proxy) method getting proxy .






call method control->get_document_proxy

exporting

document_format = 'x'

document_type = 'Word.Document'

register_container = 'x'

importing

document_proxy = proxy





after these.


call method proxy->open_document

exporting

document_url = lv_url

open_inplace = 'x'


hear i m getting retcode as INTERNAL ERROR


can any one suggest me how to open document from html container.



Thanks and reagards

jogu yadav