Skip to Content
author's profile photo Former Member
Former Member

How to default a Printer while printing the smartforms?

Hi guys

i am trying to pass a printer name entered by the user on the selection screen to the smartform for printing. However it does not print on the printer name specified instead it goes to the LOCL printer always.

I looked on to this link [How can I make the Smartforms to display a print preview by default without displaying the popup for print parameters?|http://www.saptechies.com/smartforms-frequently-asked-questions/]

and done the same in my program however still the same issue. Smartforms always uses the LOCL printer instead of the one enetered by the user on the selection screen.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 11, 2008 at 09:13 AM

    Hi,

    Use this..

    DATA: control TYPE ssfctrlop,
          output_options TYPE ssfcompop.
    
      control-preview = 'X'.       "Preview the output of Smartform                "<--------
      control-no_dialog = 'X'.       "Don't show Dialog                        "<--------
      output_options-tddest = <printer>.      "Spool: Output device              "<--------
      output_options-tdnoprint = ' '.       "No printing from print preview        
    
    
      CALL FUNCTION fm_name
        EXPORTING
    *     ARCHIVE_INDEX              =
    *     ARCHIVE_INDEX_TAB          =
    *     ARCHIVE_PARAMETERS         =
         control_parameters         = control              "<--------
    *     MAIL_APPL_OBJ              =
    *     MAIL_RECIPIENT             =
    *     MAIL_SENDER                =
         output_options             = output_options       "<--------
         user_settings              = 'X'               "<--------
    *   IMPORTING
    *     DOCUMENT_OUTPUT_INFO       =
    *     JOB_OUTPUT_INFO            =
    *     JOB_OUTPUT_OPTIONS         =
    *    TABLES
       EXCEPTIONS
         formatting_error           = 1
         internal_error             = 2
         send_error                 = 3
         user_canceled              = 4
         OTHERS                     = 5
    
    

    Edited by: Sukriti Saha on Nov 11, 2008 2:44 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 11, 2008 at 09:17 AM

    The smartforms takes an input parameter of the type ssfcompop.

    Assign the printer as follows

    data: output_options type ssfcompop.

    output_options-tddest = p_print. " selection screen printer name

    call function '/1BCDWB/SF00000056'

    exporting

    output_options = output_options

    tables

    itab = it_tab

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 11, 2008 at 09:24 AM

    DATA: wg_cparam TYPE ssfctrlop,

    wg_outoptions TYPE ssfcompop.

    wg_cparam-preview = ' '.

    wg_cparam-no_dialog = 'X'.

    wg_cparam-getotf = 'X'.

    wg_outoptions-tddest = 'LOCL'.

    wg_outoptions-tdnoprint = 'X'.

    CALL FUNCTION fm_name

    EXPORTING

    control_parameters = wg_cparam

    output_options = wg_outoptions

    user_settings = ' '

    IMPORTING

    job_output_info = ig_otf_from_fm

    TABLES

    ..........................

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.