cancel
Showing results for 
Search instead for 
Did you mean: 

howto display pdf in webdynpro application?

richard_pietsch
Active Contributor
0 Kudos

Hi experts,

I need help finishing my webdynpro application.

The requirement is to display pdf files from content repository in webdynpro. The pdf files are uploaded through another application.

I managed to get the URL of the selected pdf file via CL_SA_DOC_FACTORY->GET_READ_URL.

The output is a URL like http://xxxxxxxxxx/sap/bc/contentserver/666?get&pVersion=0046&contRep=SOLARCONTENTDB&docId=E4A66B510A...

If I enter this in the browser, the file can be opend.

Now, in the webdynpro component I added a interactive form UI element and created a context attribut of type xstring which I bound to the pdfsource attribute. My problem now is to get the document data into the xstring to display it.. I searched the forum for this, but the result did not give me the hint I am looking for..

Regards, Richard

Accepted Solutions (1)

Accepted Solutions (1)

richard_pietsch
Active Contributor
0 Kudos

Just to give you feedback.. I chose another way to display the pdf documents.

First, I use SKWF_PHIO_LOAD_CONTENT to load the content as binary data, then via SCMS_BINARY_TO_XSTRING the content is converted to xstring which can be bound to the interactive form UI element..

Regards

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Richard,

1. Use the FM HTTP_GET or class CL_HTTP_CLIENT to get the data from URL to a local variable.

2. Convert the received data in table format to Xstring format.

3. Bind the xstring to pdfsource.

-Manish

richard_pietsch
Active Contributor
0 Kudos

Hi Manish,

HTTP_GET with the URL gives me a 401 Unauthorized error although I can open it e.g. via browser when I enter username and password.

I am quite new to ABAP/Webdynpro.. and to be honest CL_HTTP_CLIENT I do not understand

Regards, Richard

Former Member
0 Kudos

Hi Richard,

If its giving unauthorized that means at-least the connection is taking place.

Refer to this link:

http://scn.sap.com/message/6371984#6371984

-Manish

Former Member
0 Kudos

Instead of looking for XSTRING from the url

1.  U can raise an external popup using

     IF_WD_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW with the available URL.

2. U can put an IFRAME UI Element in the view and give the URL as source so that the PDF will be     

   displayed in the IFRAME area.

Thanks,

Mahendra K.

richard_pietsch
Active Contributor
0 Kudos

Hi Mahendra,

yeah, I tried this before but here the problem is that the browser prompts a save/open/close dialog and does not display the file within the window.

Regards, Richard