Skip to Content
0
Former Member
Jun 01, 2006 at 10:27 PM

avoid print dialog in smartforms

24 Views

Folks,

I am trying to avoid print dialog which comes up in smartforms. But my code is not working. Please help.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname                 = gv_form
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
 IMPORTING
   fm_name                  = fm_name
 EXCEPTIONS
   no_form                  = 1
   no_function_module       = 2
   OTHERS                   = 3
          .
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

gv_control-no_dialog = 'X'.
gv_control-preview   = 'X'.
gv_control-no_open   = 'X'.
gv_control-no_close  = 'X'.
*gv_control-device    = 'LOCL'.

gv_output-tddest = 'LOCL'.

CALL FUNCTION 'SSF_OPEN'
  EXPORTING
*     ARCHIVE_PARAMETERS       =
*     USER_SETTINGS            = 'X'
*     MAIL_SENDER              =
*     MAIL_RECIPIENT           =
*     MAIL_APPL_OBJ            =
    output_options           = gv_output
    control_parameters       = gv_control
*   IMPORTING
*     JOB_OUTPUT_OPTIONS       =
  EXCEPTIONS
    formatting_error         = 1
    internal_error           = 2
    send_error               = 3
    user_canceled            = 4
    OTHERS                   = 5.

IF sy-subrc <> 0.
*   error handling
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

LOOP AT gt_distributors INTO gs_distributors.

  CALL FUNCTION fm_name
    EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
   control_parameters         = gv_control
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
   output_options             = gv_output
   user_settings              = space
   gv_agmt                    = p_agr
   gv_dist                    = gs_distributors-kunnr
* 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.

ENDLOOP.

CALL FUNCTION 'SSF_CLOSE'
*   IMPORTING
*     JOB_OUTPUT_INFO        =
  EXCEPTIONS
    formatting_error       = 1
    internal_error         = 2
    send_error             = 3
    OTHERS                 = 4.

IF sy-subrc <> 0.
*   error handling
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

* analyse internal error table of Smart Forms
CALL FUNCTION 'SSF_READ_ERRORS'
  IMPORTING
    errortab = gv_errtab.
IF NOT gv_errtab IS INITIAL.
*   add your handling
ENDIF.

A message is coming at the bottom saying...please main output device in the user master data. How do I maintain?

Message was edited by: Naren Somen