cancel
Showing results for 
Search instead for 
Did you mean: 

How to print without the showing the dialog window

former_member254358
Participant
0 Kudos

Hi,

I'd like to print directly to whatever printer installed in my computer (for example to pdfcreator).

These are the settings I'm using:

      output_options-tdsenddate = '00000000'.

      output_options-tdsendtime = '000000'.

      output_options-tdarmod = '1'.

      output_options-tddataset = 'SMART'.

      output_options-tdsuffix1 = ''.

      output_options-tdsuffix2 = sy-uname.

      output_options-tdcovtitle = ''.

      output_options-tddest = 'LOCAL'.

      output_options-tdnoprint = 'X'.

      output_options-tdprinter = 'SWINCF'.

      output_options-rqposname  = 'PDFCreator'.

control_parameters-no_dialog = 'X'.

      output_options-tdnewid = 'X'.

      output_options-tdimmed  = 'X'.

      output_options-tddelete = 'X'.

      output_options-tdgroup  = 'X'.

      output_options-tdlifetime = 20.

      output_options-tdfinal = 'X'.

     CALL FUNCTION fm_name

      EXPORTING

       control_parameters         = control_parameters

       output_options             = output_options

...........


however the dialog window is showed


Can anybody help me?


Thanks in advance.

Regards.

Accepted Solutions (0)

Answers (3)

Answers (3)

Jelena
Active Contributor
0 Kudos

Use LOCL instead of LOCAL.

Florian
Active Contributor
0 Kudos

Hi David,

Tddest is wrong.

Have a look at transaction SPAD and see what the 4character name of your printer LOCAL is, pass it to the parameter and everything should be fine.

Krishna already bolded the no_dialog variable is also important, but the fallback does show the dialog if something other (most of the times the destination) does not exist or in other words something is wrong.

~Florian

Former Member
0 Kudos

Hi David,

Everything looks good ....

Just for an example, I am pasting Piece of code, please go through it and check highlighted parameters..

Kindly let me know if you still see any issues.

DATA: print_parameter_set LIKE pri_params,

valid, list_text LIKE print_parameter_set-prtxt.

*

START-OF-SELECTION.

*

*CALL FUNCTION 'GET_PRINT_PARAMETERS'

*EXPORTING

*destination = '2571'

*immediately = 'X'

*release = ''

*receiver = sy-uname

*list_text = list_text

*IMPORTING

*out_parameters = print_parameter_set

*valid = valid.

*IF valid = 'X'.

*NEW-PAGE PRINT ON PARAMETERS print_parameter_set NO DIALOG.

DATA print type SSFCOMPOP.

data control_parameters TYPE SSFCTRLOP.

control_parameters-device = 'PRINTER'.

control_parameters-no_dialog = 'X'.

control_parameters-preview = ' '.

*control_parameters-no_open = 'X'.

*control_parameters-no_close = 'X'.

print-tddest = 'LP01'.>>>>>>>>give ur printer name here...

print-TDIMMED = 'X'.

print-tdnoprev = ' '.

*CALL FUNCTION 'SSF_OPEN'

*EXPORTING

*output_options = print

*control_parameters = control_parameters

*user_settings = ' '

*EXCEPTIONS

*formatting_error = 1

*internal_error = 2

*send_error = 3

*user_canceled = 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.

CALL FUNCTION '/1BCDWB/SF00000053'

EXPORTING

  •   ARCHIVE_INDEX              =
  •   ARCHIVE_INDEX_TAB          =
  •   ARCHIVE_PARAMETERS         =

   CONTROL_PARAMETERS         = control_parameters

  •   MAIL_APPL_OBJ              =
  •   MAIL_RECIPIENT             =
  •   MAIL_SENDER                =

OUTPUT_OPTIONS             =   print    USER_SETTINGS              = ' '

  • IMPORTING
  •   DOCUMENT_OUTPUT_INFO       =
  •   JOB_OUTPUT_INFO            =
  •   JOB_OUTPUT_OPTIONS         =
  • EXCEPTIONS
  •   FORMATTING_ERROR           = 1
  •   INTERNAL_ERROR             = 2
  •   SEND_ERROR                 = 3
  •   USER_CANCELED              = 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.

Best Regards,

KC