Skip to Content
0
Mar 26, 2010 at 01:55 AM

Printing from webdynpro

533 Views

Hi All,

In my webdynpro I have 2 buttons PREVIEW and PRINT.

With PREVIEW button click Iu2019m able to open my custom built adobe form in a separate window. Working fine and no issues here.

With PRINT button click, I have to send the same form directly to the local printer. I have written the below code for button event.

DATA: fm_name TYPE funcname,

fp_outputparams TYPE sfpoutputparams,

fp_docparams TYPE sfpdocparams,

fp_formoutput TYPE fpformoutput.

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

EXPORTING

i_name = 'YICS_RECEIPT'

IMPORTING

e_funcname = fm_name.

fp_outputparams-device = 'PRINTER'.

fp_outputparams-nodialog u2013 abap_true.

fp_outputparams-preview = abap_false.

CALL FUNCTION 'FP_JOB_OPEN'

CHANGING

ie_outputparams = fp_outputparams.

CALL FUNCTION fm_name

EXPORTING

/1bcdwb/docparams = fp_docparams

i_header = ls_header

it_item = it_item

i_cmode = ls_cmode

it_acc = it_acc

IMPORTING

/1bcdwb/formoutput = fp_formoutput.

CALL FUNCTION 'FP_JOB_CLOSE'.

Once I click on the PRINT button, Iu2019m able to see an entry in spool list with status u2018COMPLu2019 in green color, but the output is not printed to the printer. When I double click on the status Im seeing the below spool information.

Description Value

Status: Compl.

Last event:

Message: Front end did not get print data after timeout

Date: 25.03.2010

Time: 18:10:48

Job status: Waiting for spool server

Error class: Problem

Some more information:

In SE38 I have created an executable program and executed the same above code, form has been printed to the printer. Same code is working fine through GUI, but not working with webdynpro button event.

With basis help I have configured new output device ZLP01 with below parameters.

Device Type: PDF1

Device Class: Space (Standard Printer)

Access Method: G (Front End Printing with Control Tech)

Host Printer: __default

Regards,

Vijay.