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

Regarding callfunction for output device without a prompt for printer name.

Hi,

Is there any call function, for accessing output device, without a prompt for printer name? Can we directly execute the smart form without print popup?

Can anyone suggest me in this regard.

Thanks in advance,

Shwetha Korlepara.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Jan 11, 2007 at 11:38 AM

    Hi,

    There should be many post regarding this same question. Any way this is how you can do it. Remeber to have a default printer set for the user.

    ls_control_param-no_dialog = 'X'.

    ls__composer_param-tddelete = 'X'. "Delete spool request after print

    ls__composer_param-tdimmed = 'X'. "Print Imediatly

    CALL FUNCTION lf_fm_name

    EXPORTING

    archive_index = toa_dara

    archive_parameters = arc_params

    control_parameters = ls_control_param

    output_options = ls_composer_param

    user_settings = space

    EXCEPTIONS

    formatting_error = 1

    internal_error = 2

    send_error = 3

    user_canceled = 4

    OTHERS = 5.

    Regards,

    MG

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 11, 2007 at 11:41 AM

    Hi,

    Check my code and reward points by clicking the star on the left of reply,if it helps.

    &----


    *& Report ZZZ_JAYTEST1 *

    &----


    REPORT zzz_jaytest1 NO STANDARD PAGE HEADING MESSAGE-ID zhrt.

    • Variable Declaration

    DATA : v_form_name TYPE rs38l_fnam,

    itab TYPE STANDARD TABLE OF pa0001,

    w_ctrlop TYPE ssfctrlop,

    w_compop TYPE ssfcompop,

    w_return TYPE ssfcrescl.

    SELECT * FROM pa0001 INTO TABLE itab UP TO 5 ROWS.

    SORT itab BY pernr.

    DELETE ADJACENT DUPLICATES FROM itab COMPARING pernr.

    DATA: control TYPE ssfctrlop,

    control_parameters TYPE ssfctrlop,

    output_options type SSFCOMPOP.

    control-preview = 'X'.

    control-no_open = 'X'.

    control-no_close = 'X'.

    control-no_dialog = 'X'.

    control-device = 'PRINTER'.

    output_options-tddest = 'LOCL'.

    OUTPUT_OPTIONS-TDNOPRINT = 'X'.

    OUTPUT_OPTIONS-BCS_LANGU = SY-LANGU.

    CALL FUNCTION 'SSF_OPEN'

    EXPORTING

    USER_SETTINGS = ' '

    OUTPUT_OPTIONS = output_options

    CONTROL_PARAMETERS = 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.

    output_options-tddest = 'LOCL'.

    OUTPUT_OPTIONS-TDNOPRINT = 'X'.

    OUTPUT_OPTIONS-BCS_LANGU = SY-LANGU.

    CALL FUNCTION '/1BCDWB/SF00000066'

    EXPORTING

    • ARCHIVE_INDEX =

    • ARCHIVE_INDEX_TAB =

    • ARCHIVE_PARAMETERS =

    CONTROL_PARAMETERS = control

    • MAIL_APPL_OBJ =

    • MAIL_RECIPIENT =

    • MAIL_SENDER =

    OUTPUT_OPTIONS = output_options

    USER_SETTINGS = ' '

    • IMPORTING

    • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO = w_return

    • JOB_OUTPUT_OPTIONS =

    TABLES

    itab = itab

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

Add a comment
10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 11:46 AM

    Hi,

    In the CALL FUNCTION of the Smartform Function Module, set the output options parameter to set the printer name.

    The output options is of the type SSFCOMPOP which contains the field TDDEST. Set the TDDEST field to your default printer name.

    <b>If you want to avoid the popup</b>

    In the SSF_OPEN function module,

    Set the OUTPUT OPTIONS paramter TDDEST to your printer name.

    Set the CONTROL PARAMETERS and control parameters as shown below,

    control-preview = 'X'.
    control-no_open = 'X'.
    control-no_close = 'X'.
    control-no_dialog = 'X'.
    control-device = 'PRINTER'.
    control_parameters-no_dialog = 'X'.
    control_parameters-no_open = 'X'.
    control_parameters-no_close = 'X'.
    OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.
    OUTPUT_OPTIONS-TDNOPRINT = 'X'.
    
    CALL FUNCTION 'SSF_OPEN'
      EXPORTING
        output_options     = output_options
        control_parameters = control
        user_settings      = ' '
      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

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 02:10 PM

    when u r calling the Smart for chage these velues for output options

    ST_OUTPUT_OPTIONS-TDTITLE = text-011. "Free goods credit notes'

    ST_OUTPUT_OPTIONS-TDNEWID = C_X. "create new spool dataset

    • ST_OUTPUT_OPTIONS-TDCOPIES = C_N_1. "one copy Commented by SM0001

    ST_OUTPUT_OPTIONS-TDDEST = P_PRNTR. "name of printer

    <b> ST_OUTPUT_OPTIONS-TDNOPREV = SPACE. "no preview</b> ST_OUTPUT_OPTIONS-TDCOVER = SPACE. "no cover page

    ST_OUTPUT_OPTIONS-TDDATASET = P_PRNTR. "dataset name

    ST_OUTPUT_OPTIONS-TDSUFFIX2 = SPACE. "name of report variant

    • ST_OUTPUT_OPTIONS-TDIMMED = C_Y. "print immediately? Commented by SM0001

    ST_OUTPUT_OPTIONS-TDDELETE = SPACE. "do not delete after print

    Please Close this thread.. when u r problem ise solved

    Reward if Helpful

    Regards

    Naresh Reddy K

    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.