cancel
Showing results for 
Search instead for 
Did you mean: 

Open PDF Document in WebDynpro

Former Member
0 Kudos

Hi experts,

it is possible to open a PDF-File in a WebDynpro application or from a WebDynpro application in a new window? How can I do this and what are the prerequisites?

Thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello!

Yes it is possible. You can use FileDownload UI Element for the same. This opens documents in a new window. You can refer to application WDR_TEST_UI_ELEMENTS. You can find the UI Element in view FileDownload in the component WDR_TEST_EVENTS.

Hope this helps.

Regards,

Neha

Former Member
0 Kudos

Ok, and is this also possible if the document is only exist in an bytestream?

The user should not have the possibility to browse for the file the user should press a button and after that the pdf document should be open.

Can you give me more detail information?

Former Member
0 Kudos

Use the FileDownload UI element as pointed out above ....

You need to store the File in the MIME Reporsitory and use ABAP Function modules for Mime Repository to get the File, in XSTRING formet.

Try SAP_OI_LOAD_MIME_DATA. Then U can use the FM ECATT_CONV_STRING_TO_XSTRING to convert from string to XSTRING.

Create an Attribute in context of type XSTRING and bind it to the 'data' property of FileDownload. Fill this attribute with the output of ECATT_CONV_STRING_TO_XSTRING (in XSTRING format).

Set the MimeType property to 'application/pdf'. Check out the other prperties of FileDownload. Its fairly simple.

Another way is to set the reponse explicitly to PDF...without using FileDownload

CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE

(

FILENAME = whatever

I_CONTENT = this is the data u get from the above module in XSTRING format

I_MIME_TYPE = 'application/pdf'

I_IN_NEW_WINDOW = abap_true

).

Thanks

Anand