Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

jogu_sagar
Explorer
0 Kudos

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


1 ACCEPTED SOLUTION

jogu_sagar
Explorer
0 Kudos

I got resolution

Thanks and regards,

Jogu yadav

2 REPLIES 2

jogu_sagar
Explorer
0 Kudos

I got resolution

Thanks and regards,

Jogu yadav

0 Kudos

hi Jogu,

how did you solved this problem, I faced the same problem.

Best Regards,