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

Change Output Device Settings @ Runtime?

This will sound silly, but there is a good reason for it :). Also, I am not much of an ABAPer.

We have a requirement to change output device settings on the fly in a program. For instance, in case A, we would like to use the output device as it was originally configured in SPAD. However, in case B, we would like to override the output device's access method and host dynamically in code.

Is there any function module or technique that can change these output device properties via code at runtime (printtime)?

Thanks,

Kris

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 Jun 17, 2008 at 11:46 AM

    Hi,

    Try out this.. The bold one is the output device name..

    p_output_options-TDCOPIES = 3. "number of copies.

    p_output_options-tddest = 'LP01'. "def

    p_output_options-TDIMMED = 'X'.

    p_output_options-tddelete = 'X'.

    p_output_options-TDIMMED = ' '.

    p_output_options-tddest = 'LP01'.

    p_output_options-TDNEWID = 'X'.

    wa_ctrl-no_dialog = 'X'.

    deactivate the popup window

    p_control_parameters-no_dialog = 'X'. "no dilog box

    p_control_parameters-preview = 'X'. "no preview

    wa_output_options-tdimmed = 'X'.

    wa_output_options-tddelete = 'X'.

    wa_output_options-tdimmed = ' '.

    wa_output_options-tddest = 'LOCL'.

    wa_ctrl-no_dialog = 'X'.

    CALL FUNCTION '/1BCDWB/SF00000154'

    EXPORTING

    • ARCHIVE_INDEX =

    • ARCHIVE_INDEX_TAB =

    • ARCHIVE_PARAMETERS =

    CONTROL_PARAMETERS = p_control_parameters

    • MAIL_APPL_OBJ =

    • MAIL_RECIPIENT =

    • MAIL_SENDER =

    OUTPUT_OPTIONS = p_output_options

    USER_SETTINGS = 'X'

    • IMPORTING

    • DOCUMENT_OUTPUT_INFO =

    • JOB_OUTPUT_INFO =

    • JOB_OUTPUT_OPTIONS = wa_job

    TABLES

    wt_header = wi_itab1

    wt_personal = wi_itab2

    wt_payroll = wi_itab3

    wt_absence = wi_itab4

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

    Arunsri

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 10:48 AM

    Hi,

    By default you will get the output device which you have configured in SPAD.

    If you want different output device then you need to write write ABAP code and Pass the required output device during runtime. while calling the function module that is generated after creating the smatform you need to pass the Output device name to the control parameters and output parameters.

    I hope this helps you.

    Reward points if it is usefull.

    Regards

    Madhu G S

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 03:49 AM

    Hi Kris,

    I really dnt c that happenning mate...In case you find the solution to it, do inform the forum abt it.

    Thanks

    Nayan

    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.