cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a seperate Word File through a button in WDA?

Former Member
0 Kudos

I try to embed a world fine inside my WDA-View, but some necessary functions are deactivated. (see [my question|; )

So now I try another way to open a separate Word File through a button. Do you know any suggestions?

Many thanks!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Refer this thread with similar req :

And this :

You can upload the file in Mime repository and download on the click of button. Refer thread 1st.

I hope it would help.

Former Member
0 Kudos

Thanks a lot for the quick replies!

Now I can open a Word file. But the content is not connected. Do you know what's the problem? The codes are as following:

*********************************************************************************

METHOD onactionopen_wordfile .

DATA : mime_repository TYPE REF TO if_mr_api,

content TYPE xstring,

url TYPE string VALUE 'D:\YWU\LernenMaterial\bingen\Web Dynpro\HelloWorld.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.

Former Member
0 Kudos

I guess that wont be possible.

code is absolutely fine.

Former Member
0 Kudos

hi,

You are directly picking the file from dekstop.

Try it importing into Mime .

1.uploade the word doc by importing a Mime into your Web

Dynpro component.

2.Right click your component->Create->Mime Object->Import.

3.Consider the name of your component 'ZWD_TEST' and the name of the word

doc 'template.doc'.

The URL of the doc would be:

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

Rest you have already done the coding.

Refer SAP Online help for Mime : http://help.sap.com/saphelp_erp2005/helpdata/en/46/bb182fab4811d4968100a0c94260a5/content.htm

Hope this helps.

Former Member
0 Kudos

Hi,

Please refer these links -

- You can use button instead of linktoaction.

Regards,

Lekha.