cancel
Showing results for 
Search instead for 
Did you mean: 

Display PDF in Popup / How to do this?

Lukas_Weigelt
Active Contributor
0 Kudos

Hi folks,

I'm trying to establish a popup in one of my WD4As which I want to display a PDF which is stored on the application server. Here is what I do:

1. Collect Data from User Input / Runtime Output of WD4A

2. Send it to a XSLT Transformation and render it into an XML-String

3. XML String is converted into PDF via 3rd party program

4. PDF is stored on the appserver

I've already searched the forum about the possibility of displaying PDFs and always came across Adobe Interactive Forms / Adobe Document Services / UI-Element "Interactive Form". Now I thought I could just read the PDF from appserver into an Xstring and bind it to the Interactive Form UI-Element, but it always requests a "template source". I fail to understand why I have to do this and what I have to enter there.

Bottom line I want it to look like the Payslip application in ESS. Is my approach right? Has anyone ever come across this problem? PDF on appserv --> convert to xstring --> Display in WD4A.

If my Question is too basic because I lack knowledge of a certain point of intersection here, please point me to some tutorials or information material if possible.

regards, Lukas

P.S. We don't have Adobe Document Services

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lukas,

Please go through this...

also check this...

http://help.sap.com/saphelp_nw2004s/helpdata/en/44/15a40b56080d1be10000000a114a6b/frameset.htm

Cheers,

Kris.

Answers (2)

Answers (2)

Former Member
0 Kudos

Firstly, do not go for a pop up approach. Instead, use the UI element file download.

As you already have the PDF available, try converting it to xstring format, and i don't think you may require the Interactive Forms UI element. I've done this earlier where i've used the file download UI element which gave me an option to open/save the PDF. I haven't used the Interactive Form UI element but created PDF at run time on click of file download UI element.

Regards,

Santosh

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

first of all, thanks allfor the support

I've done it as Santosh suggested and look-and-feel-wise this is a good solution for us. The via 3rd party Program created PDF is Read in and bound to a context attribute in Xstring. Xstring is Bound to the Download-Element. When I klick on the Download-Element I get "Page cannot be displayed". I'm reading it in like this:

OPEN DATASET lv_helpstring1 FOR INPUT IN BINARY MODE.
    IF sy-subrc = 0.
      READ DATASET lv_helpstring1 INTO lv_pdf_xstring.
    ENDIF.
  CLOSE DATASET lv_helpstring1.

Is this wrong? If I download the PDF from AL11 manually and display it, it works, so I guess I'm somehow serializing it wrong. Any guesses?

EDIT: Also, how would I be able to debug what's happening once I klick on the Download-Link? I don't see any coding behind so I wouldn't know where to set a break-point.

best regards, Lukas

Edited by: Lukas Weigelt on May 9, 2011 12:46 PM

Lukas_Weigelt
Active Contributor
0 Kudos

Any ideas? Problem still not solved.

Former Member
0 Kudos

Hi,

Check Thamos answer in this link..

Please check this.. using file upload. hope it helps.

Cheers,

Kris.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

@kissnas, thank you for the links. I had already found them; unfortunately they do not help me. I do use the correct data type (xstring) and my pdf is not in KM environment but on ABAP AS.

Additionally, here is the URL

http://host.domain.ext:port/sap/bc/webdynpro/sap/nameofservice/~wd_key/?sap-contextid=SID%3aANON%3aHOSTNAME%3aUfxE6hNK0LaUM3LZdHpjWBOCwvBdjXoZYLhHCXZp-NEW&sap-wd-resource-id=WD0173&sap-wd-filedownload=X

I altered the following information for security reasons: host.domain.ext:port, nameofservice, HOSTNAME...

The only thing I did with the FIleDownload-UI element was bind the data property to my xstring context. Nothing else. Do I miss something in the UI-element?

Does the UI element need ADS to render the xstring back or something? Because as I indicated earlier, we do not have ADS.

the problem remains...

regards, Lukas

Lukas_Weigelt
Active Contributor
0 Kudos

resolved.... I had to type in 'PDF' in UI-Property MIME-Type...

I go smash my head against the UI-Documentation now. Thanks for all your patience....

regards, Lukas

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>I'm trying to establish a popup in one of my WD4As which I want to display a PDF

First there might be a problem with your design. InteractiveForm UI element is not a UI element which is supported running in a popup in Web Dynpro ABAP.

>but it always requests a "template source".

TemplateSource shouldn't be required if you fill the pdfSource with an XSTRING containing the contents of the PDF.