cancel
Showing results for 
Search instead for 
Did you mean: 

WD4A: Show Document from client PC

Former Member
0 Kudos

Hi all,

in my WD4A Application I show document structures from R/3-DMS in a Tree. By clicking a single element I have to show the assigned single document in it's original format (tif, html, txt, doc, ppt ...). Therefor I use RFC BAPI 'BAPI_DOCUMENT_CHECKOUTVIEW2' for checkout documents to a specific path on client PC e.g. 'c:\temp\picture.tif'. But how can I access this file to show it in Webdynpro Popup?

Thanks in advance for your help

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_szcs
Active Contributor
0 Kudos

Hi,

In case the document was also available on the server, you can use CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE to attach any number of files to a response to a client. The browser will then take care of displaying them.

In case you would like to display documents that already stored at a client PC, there is the possibility to use an iframe, but be warned: The browser applies certain restrictions due to ensuring security and does not allow you to use a path to a file at the user's PC. So using attach_file_to_response is highly advised.

You can find an example in test application WDR_TEST_EVENTS. There, navigate to the button example. In the lower area at the right side there are multiple buttons that demonstrate all the different flavors.

Best regards,

Thomas

Former Member
0 Kudos

Thank you for ayour answer. Have the files on server now. When I work with 'attach_file_to_response' I have to read the file into string area before. Is there another way to read file from server than OPEN + READ/GET DATASET?

thomas_szcs
Active Contributor
0 Kudos

I can only think of open dataset for reading actual files. Another option would be to store them inside of a database table (inside of a field of type xstring). While using attach_file_to_response you should rather work with xstring than string in order to avoid codepage issues.