cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger pdf generating when it's needed.

Former Member
0 Kudos

Hi all!

I have my WD4A application. It has some fields that user must fill. Then he push the button and printable pdf form must be generated. I created a context in WD and assigned it to pdf form's context. I can't figure out how I can start form processing from button event. I know that I can do it manually with ABAP using function modules, pass parameters to pdf forms, get binary presentation of the form, etc. But I want WD4A do it for me. The only question is how to trigger pdf generating (through InteractiveForm UI element) when I want.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank you for advice. I don't want the user to view this pdf file in browser. After clicking a button, suggestion to save the pdf file should appear. But when I made InteractiveForm UI element invisible, It doesn't generate pdf anymore. What should I do?

Edited by: Konstantin Milutin on Jul 14, 2010 2:55 PM

ChrisPaine
Active Contributor
0 Kudos

As Frank suggests, you'll need to use the generated FM of the form to build it. The Form UI element does this for you - but only if it's visible.

[from SAP HELP|http://help.sap.com/saphelp_nw70ehp2/Helpdata/EN/ed/29093b519e4f0db9be6063526537f5/frameset.htm]

>Note that complex UI elements can execute actions only if they are visible.

>In Web Dynpros, user entries or information can be transferred to an active component only using the context and action handler of a view. The corresponding UI element must be available in this view and the view must exist, that is, it must be visible in terms of the runtime. For example, the pixel size is already 1x1.

Alternatively you could set it to be 1 pixel by 1 pixel as per the suggestion in the help....

If you want to allow the user to decide where to save the file (not true background processing) then use the FileDownload UI element.

Answers (1)

Answers (1)

frank_stdle
Participant
0 Kudos

You must create a new view containing a Interactive form UI element, and then you must create a button that navigates to that view (through an outbound plug). You will find several turorials on how to create a view containing a form if you search a bit.

Here is a detailed description of the process:

http://help.sap.com/saphelp_tm60/helpdata/en/44/11780a48c9088be10000000a422035/frameset.htm

Edited by: Frank Stødle on Jul 13, 2010 9:24 AM

Former Member
0 Kudos

If I understand it right, pdf generation is processed each time the view, holding pdf element, is loaded. Am I right?

What if I want to just download pdf without viewing it? Should I make this element invisible? Will be processing done in this case?

frank_stdle
Participant
0 Kudos

Yes, correct, using the method I descriibed above, the PDF document will be displayed and the user can print the document or save it to disk.

Why would you want to "just download" a PDF file? Is it a requirement that this happens in the background?

"Just downloading" the PDF is not so easy because browser security will generally prevent any downloading of files to the client PC without user interaction. It is however possible to download the file in the background using the ACFUpDownload UI element. You would then need to generate the PDF document using the generated function module for your print form, and then download the PDF using ACFUpDownload.