Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to suppress pop-up print window for smartforms

Hi,

When executing a smartform's function module to get the OTFDATA only, is there any way that we can suppress the pop-up print window (this window prompts the user for the print device and has the buttons, "Print Preview" and "Print" -- shown below)?

My codes are written as below, but the pop-up print window still keeps on appearing - I need this to be suppressed.

Appreciate any help here. Thanks.

* Determine GV_FM_NAME by first executing the FM, SSF_FUNCTION_MODULE_NAME.

CLEAR gwa_bil_invoice.

CALL FUNCTION 'LB_BIL_INV_OUTP_READ_PRTDATA'

  EXPORTING

    if_bil_number         = gwa_nast-objky

    if_parvw              = gwa_nast-parvw

    if_parnr              = gwa_nast-parnr

    if_language           = gwa_nast-spras

    is_print_data_to_read = gwa_print_data_to_read

  IMPORTING

    es_bil_invoice        = gwa_bil_invoice

  EXCEPTIONS

    records_not_found     = 1

    records_not_requested = 2

    OTHERS                = 3.

IF sy-subrc = 0.

  CLEAR gwa_job_info.

  gwa_control-no_dialog = 'X'.

  gwa_control-preview   = 'X'.

  gwa_control-getotf    = 'X'.

  CALL FUNCTION gv_fm_name

    EXPORTING

      control_parameters = gwa_control

      user_settings      = c_true

      is_bil_invoice     = gwa_bil_invoice

      is_nast            = gwa_nast

      is_repeat          = space

      copy_count         = '1'

    IMPORTING

      job_output_info    = gwa_job_info

    EXCEPTIONS

      formatting_error   = 1

      internal_error     = 2

      send_error         = 3

      user_canceled      = 4

      OTHERS             = 5.

  IF sy-subrc = 0.

  ENDIF.

ENDIF.


Former Member replied

Did you check this?

"Are you passing anything on OUTPUT_OPTION-TDDEST? If not try passing "LOCL"/"LP01" or "PDF" . It should have been automatically populated from user master"


Also do not forget to send CONTROL_PARAMETERS-GETOTF = 'X'.


I can see this is working in my system.


R

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question