cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BSP: Server Side Printing

Former Member
0 Likes
353

I hav gone thru the foll BLOG of Thomas Jung ..

/people/thomas.jung3/blog/2005/08/23/bsp-server-side-printing-for-tableviews

i hav created new BSP Extension 'zdialog' and new BSP Element 'printdialog' ,and 3 attributes arcMode,defaultParams,id as suggested in ur blog.

But here i was stucked up . Am not able to use the TYPE 'SFPOUTARC' and 'SFPPRIP' ...so i have used STRING type.

And i have created a BSP Page and ihav called that attributes from the foll code

<zdialog:printDialog id = "PrinterUI"

defaultParams = "//model/print_options"

arcMode = "//model/arc_options" />

</htmlb:form>

</htmlb:documentBody>

</htmlb:document>

</htmlb:content>

While running my Page ..it's Blank ....Nothing is displayed .What may be the prob ?

Rgds,

J

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Likes

Since the printer dialog was originally designed for Adobe Print Forms, I would image that those structures don't exist on releases older than 640. I did mention that in the weblog.

On older releases you want to use the corresponding structure for SmartForms or List Output. The structures are really the same, there are just different field names. Try PRI_PARAMS and ARC_PARAMS instead.

A string wouldn’t very well work since these are structures with many inner fields.

Your page is blank: What coding do you have in dialog element? In my example I used data binding to model class attributes. Do you have those same attributes? Are you using this tag within MVC?

You don’t really need the complete dialog just to do Server Side printing. Really the dialog was a nice to have. All you really need is a single input field for the Printer ID. You could map the other values from constant defaults.

Former Member
0 Likes

1. Where i hav to paste the class file given by u .

I hav pasted it in Local Classes Defn ...

While running...

I am getting the foll error message ..

-


CLASS ZCL_ES_BSP_ELMNT_PRINTER_DIAG ,class Include (Local Data Types,object.... )

Each Abap Pgm can contain only "REPORT" or PROGRAM or Function-pool statement

You may define classes ,interfaces or types in a CLASS-POOL.

-


2. In BSP EXTENSION ..ZDIALOG , I hav given CL_HTMLB_ELEMENT in its property --BSP ELEMENT BASIC CLASS.

In BSP ELEMENT ...printerdialog ,i hav given ZCL_ES_BSP_ELMNT_PRINTER_DIAG in its Element handler class .

3. Whther i hav to create any more Classes .'

4. I hav copied the foll code and created one BSP page ..

<%@page language="abap" %>

<%@extension name="ZDIALOG" prefix="zdialog" %>

<%@extension name="htmlb" prefix="htmlb" %>

<%@extension name="bsp" prefix="bsp" %>

<%@extension name="xhtmlb" prefix="xhtmlb" %>

<htmlb:content design="DESIGN2003" >

<htmlb:document>

<htmlb:documentHead>

<htmlb:headInclude/>

</htmlb:documentHead>

<htmlb:documentBody>

<htmlb:form>

<bsp:deltaHandlerBlock id="protectionR2" >

<xhtmlb:protectDoubleSubmit/>

</bsp:deltaHandlerBlock>

<zdialog:printDialog id = "PrinterUI"

defaultParams = "//model/print_options"

arcMode = "//model/arc_options" />

</htmlb:form>

</htmlb:documentBody>

</htmlb:document>

</htmlb:content>

==============

Am i right ? But am not able to view anything ..if i try to run the page from Browser.

thomas_jung
Developer Advocate
Developer Advocate
0 Likes

You can't cut and paste the entire coding in the linked class code into the class generated by SAP for the BSP Element. This is just the example code. You need to redefine your inherited methods and then you can cut and paste in selected code.

Have you ever created a BSP Extension Element before? It isn't necessarily a simple task. I have linked in many of the weblogs that provide the necessary background for this task.

The coding I provided for the Printer Dialog was really just to help speed up the process of the rendering and the layout. It wasn't intended to be a cut and paste solution.

I would suspect that the BSP Extension Element that you created isn't implemented correctly and that the application you are hosting it in isn't Model View Controller.

Do you really need the complete printer dialog? Like I suggested before, if you are just looking for server side printing, this can really be done just by placing a drop down list box on the screen for selecting the Output Device. The rest of the options are just nice to haves.

Former Member
0 Likes

Thnk u Jung for giving me the right direction.

I am newbie to BSP Ext.

Yes . I don't need the Complete print dialog ..evn that's not sugested by the customer .

My requirement is simple . If a user clicks a Print bt in BSP (evn the Output device shd not be selected by him,it can be done pgmatically ),it shd go to the R/3 printer spool.Wht function module i hav to trigger frm BSP ?

Am familiar with plain BSP coding ,

It would be really g8 , if it can be achieved that much simplicity.

Advance ThanksThanksThanks

J

thomas_jung
Developer Advocate
Developer Advocate
0 Likes

Then it sounds like you don't need the Dialog Element at all. You just want the Static Method from the class ZCL_ES_BSP_PRINT_TABLE.

Actually as I read your requirment I question what you are wanting to print. Is this currently data displayed on your BSP page (like in a tableView)? Or is this an existing Output Document (like a SapScript, SmartForm, or Adobe Form). If it is the later, you can already process those outputs from within BSP like any other ABAP program. You don't need any special processing.

Former Member
0 Likes

I have mentioned that i want to print Certification Letter .I hav designed that using simple HTML Tags and little bit of ABAP Logic .And it is displying in the browser as like the letter .

If i trigger a print ,will the same format goes to Spool ?

Thank you for Quick reply .

J

thomas_jung
Developer Advocate
Developer Advocate
0 Likes

The solution from the weblog in question really doesn't have anything to do with printing HTML from the server side. It just reproduces the data from a <htmlb:tableView> with its selected layout iterator as an ALV Grid.

You would probably want to redeisgn your Certification Letter in SmartForms (WebAS 620) or Adobe Forms (640 and higher). Both can be displayed as PDF online in the browser or printed from the server.