cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid a print dialog window

former_member217677
Participant
0 Kudos

Hello,

I need to print production papers using adobe forms.

Unfortunatelly after saving a production order i get the print dialog window.

Is it possible to print immidiatly to the standard windows printer withtout to select it amnually?

Which setting are possible in "fill_outputparams" for SFPOUTPUTPARAMS?

Thanks in advance,

Evgenij

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member217677
Participant
0 Kudos

Hello,

first of all thanks for your quick answers.
I was trying to explain my problem again, cause it was still not working, but suddenly found the settings which I need in SPAD

No its work perfectly.

Evgenij



former_member217677
Participant
0 Kudos

just to make clear:

with option nodialog = 'X', I can switch off SAP print window

but after I get the second window for printer selection, which must be switched off, but I dont know how and where to do it.

Hope you can help me

Evgenij

SandySingh
Active Contributor
0 Kudos

Hello


You will have to read the current Print parameters using FM CALL FUNCTION 'GET_PRINT_PARAMETERS' and pass it to structure sfpoutputparams

Try to set the printer to LOCL .

gs_fpoutparams-dest       = 'LOCL'.


DATA: ls_options TYPE itcpo.

     DATA: lv_dialog TYPE c.

     DATA: ls_pri_params TYPE pri_params.

*        gs_fpoutparams TYPE sfpoutputparams.

     lv_dialog = 'X'.

    CALL FUNCTION 'GET_PRINT_PARAMETERS'

       EXPORTING

         no_dialog      = 'X'

         mode           = 'CURRENT'

       IMPORTING

         out_parameters = ls_pri_params.

     ls_options-tdcopies   = ls_pri_params-prcop.

     ls_options-tddest     = ls_pri_params-pdest.

     ls_options-tdnewid    = ls_pri_params-prnew.

     ls_options-tdimmed    = ls_pri_params-primm.

     ls_options-tddelete   = ls_pri_params-prrel.

     ls_options-tdlifetime = ls_pri_params-pexpi.

     ls_options-tdtitle    = ls_pri_params-prtxt.

     ls_options-tdcover    = ls_pri_params-prsap.

     ls_options-tdcovtitle = ls_pri_params-prtxt.

     ls_options-tdreceiver = ls_pri_params-prrec.

     ls_options-tddivision = ls_pri_params-prabt.

     ls_options-tdautority = ls_pri_params-prber.

     gs_fpoutparams-device     = ls_options-tdprinter.

     gs_fpoutparams-preview    = ls_options-tdpreview.

     gs_fpoutparams-dest       = ls_options-tddest.

     gs_fpoutparams-reqnew     = ls_options-tdnewid.

     gs_fpoutparams-reqimm     = ls_options-tdimmed.

     gs_fpoutparams-reqdel     = ls_options-tddelete.

     gs_fpoutparams-reqfinal   = ls_options-tdfinal.

     gs_fpoutparams-senddate   = ls_options-tdsenddate.

     gs_fpoutparams-sendtime   = ls_options-tdsendtime.

     gs_fpoutparams-schedule   = ls_options-tdschedule.

     gs_fpoutparams-copies     = ls_options-tdcopies.

     gs_fpoutparams-dataset    = ls_options-tddataset.

     gs_fpoutparams-suffix1    = ls_options-tdsuffix1.

     gs_fpoutparams-suffix2    = ls_options-tdsuffix2.

     gs_fpoutparams-covtitle   = ls_options-tdcovtitle.

     gs_fpoutparams-cover      = ls_options-tdcover.

     gs_fpoutparams-receiver   = ls_options-tdreceiver.

     gs_fpoutparams-division   = ls_options-tddivision.

     gs_fpoutparams-lifetime   = ls_options-tdlifetime.

     gs_fpoutparams-authority  = ls_options-tdautority.

     gs_fpoutparams-rqposname  = ls_options-rqposname.

     gs_fpoutparams-arcmode    = ls_options-tdarmod.

     gs_fpoutparams-noarmch    = ls_options-tdnoarmch.

     gs_fpoutparams-title      = ls_options-tdtitle.

     gs_fpoutparams-nopreview  = ls_options-tdnoprev.

*    gs_fpoutparams-noprint    = ls_options-tdnoprint.

     gs_fpoutparams-nodialog = 'X'.

     gs_fpoutparams-noprint = ' '.

     CALL FUNCTION 'FP_JOB_OPEN'

       CHANGING

         ie_outputparams = gs_fpoutparams

       EXCEPTIONS

         cancel          = 1

         usage_error     = 2

         system_error    = 3

         internal_error  = 4

         OTHERS          = 5.

     IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

     ENDIF.

Regards

Sandy

Former Member
0 Kudos

Hi

Set the parameters

fp_outputparams--device    = 'PRINTER'.
  fp_outputparams
-connection = 'ADS'.
  fp_outputparams
-nodialog  = abap_false.
  fp_outputparams
-nopreview = abap_true.
  fp_outputparams
-reqnew    = abap_true.        "New spool request
  fp_outputparams
-reqimm    = abap_true.        "Print immediately
  fp_outputparams
-dest      = 'LOCL'.

Also try to use FM   CALL FUNCTION 'FTR_CORR_CHECK_DEFAULT_PRINTER'   to get the default Printer for the SY-UNAME..

Check with the BASIS team if they can change any of the SPAD settings for the printer .

Surya