cancel
Showing results for 
Search instead for 
Did you mean: 

Printing window contents in webdynpro ABAP

Former Member
0 Kudos

Dear fellow SDNers,

The first reply that may come to your mind for this post is that "This has been discussed numerous times in this forum".

But the fact is that I am not able to make out how it is possible to print the contents of a webdynpro window. I want a print-screen like functionality wherein i click a button on the view and the contents of the same view, along with the ui elements, values entered everything should open for print-preview in another window. The new window should basically have the same view displayed, with none of the user actions enabled. From there i need to actually print through another button if the user so desires.

Having done a search, I found that people have suggested ways to do it easily in webdynpro java. But i need to do it in webdynpro abap.

Also, some posts mention the use of interactive forms. But I could not make out how to pass the entire view displayed to a form at runtime. Do I need to create a form separately and display it using the interactive form ui element? What I could find out was that the values of the context node attributes can be passed on and mapped to an adobe form but that is not what i require. I need the entire view layout as it is displayed.

Please help me out on this. If this is the exact requirement that is discussed many times in the forum then I request you to please lead me to the right threads.

Regards,

Priyank

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

The interactive form can be a good option since the data is automatically populated in the PDF and the user can review it before printing it.

There is no need to create a new form from scratch using SFP. Webdynpro will generate a form for you with the help of context. The context data will be passed to the interactive form automatically.

1. At first you need to create a Interactive form UI element

2. Bind the context to the data source of the Interactive form UI element property

3. Maintain the form name in the context attribute and bind it to pdfsource

4. Enter the form name in template and double click it. Select the context as the interface. This will help you out in generating a form automatically.

Refer to this sap link for additional information

http://help.sap.com/saphelp_nw2004s/helpdata/en/f6/501b42b5815133e10000000a155106/frameset.htm

Regards,

Satheesh

Former Member
0 Kudos

>

> Hello,

>

> The interactive form can be a good option since the data is automatically populated in the PDF and the user can review it before printing it.

>

> There is no need to create a new form from scratch using SFP. Webdynpro will generate a form for you with the help of context. The context data will be passed to the interactive form automatically.

>

> 1. At first you need to create a Interactive form UI element

> 2. Bind the context to the data source of the Interactive form UI element property

> 3. Maintain the form name in the context attribute and bind it to pdfsource

> 4. Enter the form name in template and double click it. Select the context as the interface. This will help you out in generating a form automatically.

>

> Refer to this sap link for additional information

> http://help.sap.com/saphelp_nw2004s/helpdata/en/f6/501b42b5815133e10000000a155106/frameset.htm

>

> Regards,

> Satheesh

Hi,

i have tried this proceeding.

But i got an Error: "Could not start Layout Designer"

So there is a need of a local installation of the Forms Design Tool to use the InteractiveForm-UIElement.

Former Member
0 Kudos

Hi Satheesh,

Thanks for your response!!

But the question is, mapping the context data to the interactive form ui element is fine....but how will it ensure that i get the exact layout of the view on the pdf....i need all radio buttons, checkboxes, containers etc to be displayed as they are in the view, on the pdf as well....i believe mapping context will only fetch the data that is entered by the user....

any thoughts on this??

Former Member
0 Kudos

Hi,

The layout of the form should be designed in the layout designer of the form. You will have all the context fields of the view available here in the context of the form as well as the data view.

Drag and drop the fields from your data view into the form layout and design the layout accordingly. You can also use fields from the Library in the layout designer. Check the binding of these fields to make sure data will be populated. A little knowledge of designing PDF forms is required for this.

Please refer the SAP help for designing PDF based forms

http://help.sap.com/saphelp_nwmobile71/helpdata/en/cc/05c27f53ad430688f8a95f1c0c79db/frameset.htm

Regards,

Satheesh

Former Member
0 Kudos

Hi Satheesh,

Thanks once again!! But using this approach, I also have to worry about the dynamic display of UI elements in my view. Though I am not very conversant with PDF forms at this stage, from what i have seen so far, creating a form layout dynamically in accordance with the dynamic behaviour of the view may not be possible.

Assuming i display certain UI elements on the webdynpro view based on some conditions, or I dynamically add some elements at the runtime, I believe this approach will not take care of such scenarios.

Therefore, what is required is the actual "Print Screen" functionality. Any further thougts on this??

Former Member
0 Kudos

Hi,

If you know all the possible dynamic stuff that you are going to be displayed in WD view, you can add those fields in the interface and context of the PDF form manually and place them at appropriate places in the PDF layout of the form. You can mark these fields hidden.

The field values determining the display of the dynamic fields in the WD should also be passed to the PDF context. Based on field values which determine the display of the dynamic fields, you can add 'Form calc' script in order to display the dynamic stuff in your form.

Regards,

Satheesh.

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Why does not just using the browser print functionality not work for this requirement?

Former Member
0 Kudos

Hi Thomas,

thanks for your response!!

The requirement is such that the functionality is required at the click of a button on the view.

Also, when i tried the browser print preview functionality, i could not see the elements like radio buttons and checkboxes or the containers. I could only see the texts for these elements. Plus, it was all in white. In preview, the user would like to see the view as it is displayed in the browser normally.

I have seen some blogs and ways to do it in webdynpro java, so i wonder why shouldn't there be something in ABAP to do the same.

Any hints on this kind of requirement?

regards,

Priyank