cancel
Showing results for 
Search instead for 
Did you mean: 

open word document in WD application

Former Member
0 Kudos

Hi,

I need to open a word doc. in my webdynpro application. I have found few blogs here referring to MIMEs object but i couldn't get the complete process that need to be follow. I have imported MIME object in MIME repository and stuck at this point. Can anybody please tell me whole process in brief that is require in this issue.

Rgds

Sudhanshu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

Refer this :

METHOD onactionopen_wordfile .
DATA : mime_repository TYPE REF TO if_mr_api,
content TYPE xstring,
url TYPE string VALUE 'SAP/BC/WebDynpro/SAP/ZTREE/s.doc', 
lv_fnam TYPE string..

mime_repository = cl_mime_repository_api=>get_api( ).

* get the content of the word file
CALL METHOD mime_repository->get
EXPORTING
i_url = url
i_check_authority = ' '
IMPORTING
e_content = content
EXCEPTIONS
parameter_missing = 1
error_occured = 2
not_found = 3
permission_failure = 4
OTHERS = 5.

cl_wd_runtime_services=>attach_file_to_response(
EXPORTING
i_filename = url
i_content = content
i_mime_type = 'APPLICATION/MSWORD').

ENDMETHOD.

In URL , type in the Path where docoument is stored in Mime .

Former Member
0 Kudos

Hello Sourav,

Thanks for quick reply. do i need to create button with action open_wordfile here?

Rgds

sudhanshu

Former Member
0 Kudos

hi,

If you want to open the file on the click of some button then create a button and action for the button.

Former Member
0 Kudos

Hello Sourav,

Couple of more Qus.

i) do i need to use OFFICE_CONTROL UI element in this.

ii) what is this ZTREE/S.DOC about?

Rgds

sudhanshu

Former Member
0 Kudos
what is this ZTREE/S.DOC about?

The URL of the doc would be:

http://your.server.com/sap/bc/webdynpro/sap/wdcompnent Name/template.doc

This is the place where Document gets stored if you import into Mime.

do i need to use OFFICE_CONTROL UI element in this.

For this you dont need any other UI.

Former Member
0 Kudos

OK...got it...Thanks again...can you please tell me what is the role of transaction SICF in this? Should i go for SICF for any kind of verification.

Rgds

Sudhanshu

Former Member
0 Kudos

ICF services must be activated.

There are some configuaration settings which you need to do to run wd abap application.

Refer this :

http://help.sap.com/saphelp_nw70/helpdata/en/43/e86de5008b4d9ae10000000a155369/content.htm

Former Member
0 Kudos

In some of the blog i have read about importing MIME object from SE80 (via path create->MIMI object->import)..what exactly we do in this step. i actually done this but not sure what i achieved in this step?

Rgds

Sudhanshu

Former Member
0 Kudos

The MIME Repository is used to store all MIME objects (style sheets, graphics, icons and so on) in the SAP System. MIMEs are created as objects in the SAP database.

Refer SAP Online help on Mime :

http://help.sap.com/saphelp_erp2005/helpdata/en/46/bb182fab4811d4968100a0c94260a5/content.htm

Former Member
0 Kudos

Hello Sourav,

I have done it sucessfully but got another issue with look and feel im getting in this component. I actually wanted to open that document(.doc or .xls) within component itself (i.e., within browser). For your reference please have a look at the standard component IOS_TEST_SPREADSHEET_MS. I guess this kind of output is possible by using office control element only.

pleae advise.

Rgds

sudhanshu

Former Member
0 Kudos

Yes , if you have to open the document within the same application then you have to go for Office Control UI element.