Skip to Content
avatar image
Former Member

Send form to printer selected from selection screen

Hi,

I need to send the Form generated directly to printer selected on the selection screen. I dont want to enter the printer details in the printer pop up. I am using Smartforms.

How do I do that?

Thanks,

Abhishek

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Aug 25, 2008 at 07:15 PM

    Pass the entered printer to the CONTROL_PARAMETERS Form interface.

    Like:

    CONTROL_PARAMETERS-DEVICE  = P_PRINTER.
    

    To avoid the popup set the NO_DIALOG field in the CONTROL_PARAMETERS.

    Like:

    CONTROL_PARAMETERS-NO_DIALOG = 'X'.
    

    Regards,

    Naimesh Patel

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 26, 2008 at 02:32 AM

    You can over come this in two ways, either pass DEVICE to your smartform through control_parameters or maintain in your user profile under spool control, output device.

    Rgds,

    SaiRam

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 26, 2008 at 12:16 PM

    You want to enter the printer name in the selection-screen itself

    then you want to get the printout directly at the printer you given in the selection screen of your driver program if it is the case. then please do the changes in your driver program.

    DATA: x_control_parameters TYPE ssfctrlop,

    x_output_options TYPE ssfcompop.

    CONSTANTS:

    c_x TYPE char1 VALUE 'X'.

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    PARAMETERS: p_prin LIKE usr01-spld.

    SELECTION-SCREEN BEGIN OF LINE.

    INITIALIZATION.

    SELECT spld

    FROM usr01

    INTO p_prin UP TO 1 ROWS

    WHERE bname = sy-uname.

    ENDSELECT.

    START-OF-SELECTION.

    x_output_options-tdimmed = c_x.

    x_output_options-tddest = p_prin.

    x_output_options-tdnewid = c_x.

    x_output_options-tdreceiver = sy-uname.

    x_output_options-tdcopies = '001'.

    x_control_parameters-device = 'PRINTER'.

    x_control_parameters-no_dialog = c_x.

    x_control_parameters-langu = sy-langu.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

    formname = 'Z_SMARTFORMS1'

    • VARIANT = ' '

    • DIRECT_CALL = ' '

    IMPORTING

    fm_name = f_name1

    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 F_NAME1

    EXPORTING

    • ARCHIVE_INDEX =

    • ARCHIVE_INDEX_TAB =

    • ARCHIVE_PARAMETERS =

    CONTROL_PARAMETERS = X_CONTROL_PARAMETERS

    • MAIL_APPL_OBJ =

    • MAIL_RECIPIENT =

    • MAIL_SENDER =

    OUTPUT_OPTIONS = X_OUTPUT_OPTIONS

    • USER_SETTINGS = 'X'

    wa_header = wa_zmexh51

    • IMPORTING

    • DOCUMENT_OUTPUT_INFO =

    • JOB_OUTPUT_INFO =

    • JOB_OUTPUT_OPTIONS =

    TABLES

    tab_item = TAB_ZMEXD51

    tab_item1 = TAB_ZMEXS51

    • 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.

    Thanks,

    Phani.

    Edited by: phani kumar on Aug 26, 2008 2:17 PM

    Add comment
    10|10000 characters needed characters exceeded