cancel
Showing results for 
Search instead for 
Did you mean: 

How to supress dialog box when calling smartforms and just create a spool..

aris_hidalgo
Contributor
0 Kudos

Hello Experts,

I want to supress the dialog box where you can print preview or print your smartforms. What

I want is to just create a spool file for this one. Think of it as smartforms running in background.

Thank you guys and take care!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Check this:

Data: wa_op type SSFCOMPOP.

wa_op-TDNOPREV = 'X'.

Call Function 1/sf000000000 "Smartform Generated FM.

OUTPUT_OPTIONS = wa_op.

Regards,

Vishwa.

aris_hidalgo
Contributor
0 Kudos

What I mean is to bypass entirely the dialog box and just generate a spool file wherein the print preview is there.

Former Member
0 Kudos

Use

data : gt_ssfctrl TYPE ssfctrlop,

gt_ssfcom TYPE ssfcompop.

gt_ssfctrl-no_dialog = 'X'

Forgot to mention -

gt_ssfcom-tdnewid = 'X'.

This will create New spool Id.

You may pass GT_SSFCOM to get all output parameters.

CALL FUNCTION 'SSF_SHOW_DIALOG'

EXPORTING

output_options = gt_ssfcom

IMPORTING

e_output_options = gt_ssfcom

e_control_parameters = gt_ssfctrl

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

pass gt_ssfcom and gt_ssfctrl retrieved from above FM to you FM of smartform

moreover do not forget to set USER_SETTINGS = ' ' while calling FM of smartform, otherwise user settings will override these values.

gt_ssfcom-tdnewid = 'X'

gt_ssfctrl-no_dialog = 'X'

call FM.....(smartform FM)....

Exporting

control_parameters = gt_ssfctrl

output_options = gt_ssfcom

user_settings = ' '

Edited by: Mohaiyuddin Soniwala on Nov 25, 2008 1:20 PM

Edited by: Mohaiyuddin Soniwala on Nov 25, 2008 1:22 PM

Former Member
0 Kudos

Hi

Apart from that,also pass these values:

TDNOPRINT as X.

TDDEST = Spool Output Device. "here give the output device.

Further Check the structure Output Options in The Form Interface of the smartform. This is where you can control the output. In Form interface, just double click on "SSFCOMPOP". It will take you to the structure.

Just pass these values to the FM generated in the Fm.

Regards,

Vishwa.

aris_hidalgo
Contributor
0 Kudos

Hi Guys,

Below is my modified code. But it still showing the print preview/dialog box upon calling of smartforms.


IF gt_regup[] IS NOT INITIAL.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = lcc_z2574ffi_ra_cimb
*       VARIANT                  = ' '
*       DIRECT_CALL              = ' '
     IMPORTING
       fm_name                  = ltyc_function
     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.

    MOVE 'X' TO ltyc_control-no_dialog.
    MOVE 'X' TO ltyc_options-tdnewid.
*    MOVE 'X' TO ltyc_options-tdnoprev.
    MOVE 'LOCL' TO ltyc_options-tddest.

    CALL FUNCTION ltyc_function
      EXPORTING
        control_parameters = ltyc_control
        output_options     = ltyc_options
        im_adrnr           = gtyc_adrnr
        im_name1           = gtyc_name1
        im_name2           = gtyc_name2
        im_str_suppl1      = gtyc_str_suppl1
        im_str_suppl2      = gtyc_str_suppl2
        im_str_suppl3      = gtyc_str_suppl3
        im_post_code1      = gtyc_post_code1
        im_city1           = gtyc_city1
      TABLES
        im_regup           = gt_regup
      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.

Former Member
0 Kudos

Hi

*    MOVE 'X' TO ltyc_options-tdnoprev.

Uncomment This and Check Once.

Vishwa.

Former Member
0 Kudos

Please refer to my comments above--

moreover do not forget to set USER_SETTINGS = ' ' while calling FM of smartform, otherwise user settings will override these values.

Also please refer to flow above, if you are just settings control values and output options value, it may not work..please call other FM as mentioned above to get other print parameters..

Regards,

Mohaiyuddin

Edited by: Mohaiyuddin Soniwala on Nov 25, 2008 2:23 PM

Answers (1)

Answers (1)

aris_hidalgo
Contributor
0 Kudos

Hi Guys,

It still shows the dialog box but now the print and print preview is disabled. What I want is to be able to bypass this dialog pop-up and just create a spool for my smartforms. Below is my updated code:


MOVE 'X' TO ltyc_control-no_dialog.
    MOVE 'X' TO ltyc_options-tdnewid.
    MOVE 'X' TO ltyc_options-tdnoprev.
    MOVE 'X' TO ltyc_options-tdnoprint.
    MOVE 'LOCL' TO ltyc_options-tddest.

    CALL FUNCTION 'SSF_SHOW_DIALOG'
      EXPORTING
*        ARCHIVE_PARAMETERS         =
        user_settings              = ''
        output_options             = ltyc_options
*        CONTROL_PARAMETERS         = ''
*        OK_BUTTON                  = ' '
      IMPORTING
*        E_ARCHIVE_PARAMETERS       =
        e_output_options           = ltyc_options
        e_control_parameters       = ltyc_control
      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 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = lcc_z2574ffi_ra_cimb
*        VARIANT                  = ' '
*        DIRECT_CALL              = ' '
      IMPORTING
        fm_name                  = ltyc_function
      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.

    CALL FUNCTION ltyc_function
      EXPORTING
        control_parameters = ltyc_control
        output_options     = ltyc_options
        user_settings      = ''
        im_adrnr           = gtyc_adrnr
        im_name1           = gtyc_name1
        im_name2           = gtyc_name2
        im_str_suppl1      = gtyc_str_suppl1
        im_str_suppl2      = gtyc_str_suppl2
        im_str_suppl3      = gtyc_str_suppl3
        im_post_code1      = gtyc_post_code1
        im_city1           = gtyc_city1
        im_vblnr           = gtyc_vblnr
        im_zaldt           = gtyc_zaldt
        im_swnes           = gtyc_swnes
      TABLES
        im_regup           = gt_regup
      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.

Former Member
0 Kudos

Hi

Also, pass:

ltyc_control-no_open = 'X'.

ltyc_control-no_close = 'X'.

And as you want to create a Spool Request Straight away, please fill in the following fields in the output options structure:

tddest  "here give the output device name,generally LOCL
TDPRINTER "spool device name
TDIMMED "keep this empty, this is for print immediately which you dont want.

Regards,

Vishwa.

aris_hidalgo
Contributor
0 Kudos

Hi again Vishwa,

I modified my code according to your last reply but it still wouldn't work. The dialog still pops up without the print and print preview buttons. Below is my code:


MOVE 'X'    TO ltyc_control-no_open.
    MOVE 'X'    TO ltyc_control-no_close.
    MOVE 'X'    TO ltyc_control-no_dialog.
    MOVE 'X'    TO ltyc_options-tdnewid.
    MOVE 'X'    TO ltyc_options-tdnoprev.
    MOVE 'X'    TO ltyc_options-tdnoprint.
    MOVE 'LOCL' TO ltyc_options-tddest.
    MOVE space  TO ltyc_options-tdimmed.

    CALL FUNCTION 'SSF_SHOW_DIALOG'
      EXPORTING
*        ARCHIVE_PARAMETERS         =
        user_settings              = ''
        output_options             = ltyc_options
        control_parameters         = ltyc_control
*        OK_BUTTON                  = ''
      IMPORTING
*        E_ARCHIVE_PARAMETERS       =
        e_output_options           = ltyc_options
        e_control_parameters       = ltyc_control
      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 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = lcc_z2574ffi_ra_cimb
*        VARIANT                  = ' '
*        DIRECT_CALL              = ' '
      IMPORTING
        fm_name                  = ltyc_function
      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.

    CALL FUNCTION ltyc_function
      EXPORTING
        control_parameters = ltyc_control
        output_options     = ltyc_options
        user_settings      = ''
        im_adrnr           = gtyc_adrnr
        im_name1           = gtyc_name1
        im_name2           = gtyc_name2
        im_str_suppl1      = gtyc_str_suppl1
        im_str_suppl2      = gtyc_str_suppl2
        im_str_suppl3      = gtyc_str_suppl3
        im_post_code1      = gtyc_post_code1
        im_city1           = gtyc_city1
        im_vblnr           = gtyc_vblnr
        im_zaldt           = gtyc_zaldt
        im_swnes           = gtyc_swnes
      TABLES
        im_regup           = gt_regup
      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.

Edited by: Viraylab on Nov 26, 2008 10:55 AM

Former Member
0 Kudos

Hi

Can you comment this FM and check?? ::

CALL FUNCTION 'SSF_SHOW_DIALOG'
      EXPORTING
*        ARCHIVE_PARAMETERS         =
        user_settings              = ''
        output_options             = ltyc_options
        control_parameters         = ltyc_control
*        OK_BUTTON                  = ''
      IMPORTING
*        E_ARCHIVE_PARAMETERS       =
        e_output_options           = ltyc_options
        e_control_parameters       = ltyc_control
      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.

Regards,

Vishwa

aris_hidalgo
Contributor
0 Kudos

Hi Vishwa,

It now works. Below is my modified code:


MOVE 'X' TO: ltyc_control-no_dialog,
                 ltyc_options-tdnewid,
                 ltyc_options-tdnoprev.
*                 ltyc_options-tdnoprint.
    MOVE 'LOCL' TO ltyc_options-tddest.
    MOVE space  TO ltyc_options-tdimmed.
    MOVE 'PRINTER' TO ltyc_control-device.

*    CALL FUNCTION 'SSF_SHOW_DIALOG'
*      EXPORTING
**        ARCHIVE_PARAMETERS         =
*        user_settings              = ''
*        output_options             = ltyc_options
*        control_parameters         = ltyc_control
**        OK_BUTTON                  = ''
*      IMPORTING
**        E_ARCHIVE_PARAMETERS       =
*        e_output_options           = ltyc_options
*        e_control_parameters       = ltyc_control
*      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 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = lcc_z2574ffi_ra_cimb
*        VARIANT                  = ' '
*        DIRECT_CALL              = ' '
      IMPORTING
        fm_name                  = ltyc_function
      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.

    CALL FUNCTION ltyc_function
      EXPORTING
        control_parameters = ltyc_control
        output_options     = ltyc_options
        user_settings      = ''
        im_adrnr           = gtyc_adrnr
        im_name1           = gtyc_name1
        im_name2           = gtyc_name2
        im_str_suppl1      = gtyc_str_suppl1
        im_str_suppl2      = gtyc_str_suppl2
        im_str_suppl3      = gtyc_str_suppl3
        im_post_code1      = gtyc_post_code1
        im_city1           = gtyc_city1
        im_vblnr           = gtyc_vblnr
        im_zaldt           = gtyc_zaldt
        im_swnes           = gtyc_swnes
      TABLES
        im_regup           = gt_regup
      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.
  ENDIF.

Thanks again!

Former Member
0 Kudos

Close the Post If issue is resolved.