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

Get default printer in ABAP program ....

Hi gurus, pls help me ...

I had a program to print voucher. It show document list, and user can choose some document to print (smartform). Now, if I choose 5 document, I have to choose printer 5 times. Who can tell me the way to get default printer of the desktop which user's using to assign OUTPUT_OPTIONS or something like that!? Thanks for all.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Jan 16, 2008 at 11:11 AM

    hi,

    Please refer the code elow..u should be able to crack this roblem..

    data: l_usr01 like usr01.

    CALL FUNCTION 'GET_PRINT_PARAM'

    EXPORTING

    I_BNAME = sy-uname

    IMPORTING

    E_USR01 = l_usr01.

    output_options-TDARMOD = '1'.

    output_options-TDDEST = l_usr01-spld.

    output_options-TDRECEIVER = sy-uname.

    output_options-TDCOPIES = '1'.

    output_options-TDIMMED ='X'.

    output_options-TDDELETE = 'X'.

    output_options-TDLIFETIME = 0.

    output_options-tdnoprev = 'X'.

    output_options-tdnoprint = space.

    output_options-tddelete = 'X'.

    Please, assign points, if u have found it useful..

    Thanks,

    Nivin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2008 at 10:22 AM

    Hi,

    Use this query and you will the default output device for the particular user.

    SELECT SINGLE spld FROM USR01

    into w_spld

    where bname = sy-uname.

    *Reward points if helpful

    Regards,

    KK

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2008 at 11:12 AM

    Hi,

    U can set the default printer from SU01 -> defaults tab

    u can select the printer and save the user.

    If you want to handle it through program,

    U have to define a structure of type SSFCOMPOP and send the parameter TDDEST as your output type lets say LP01

    and then pass this structure to OUTPUT_OPTIONS of the smartform.U can pass other options like number of copies and print immidiately etc. and through CONTROL_OPTIONS

    you can supress the dialog by setting NO_DIALOG = 'X'

    and passing the structure SSFCTRLOP to CONTROL_OPTIONS.

    Reward Points if useful.

    Cheers,

    Deepthee Kasal

    Cheers,

    Deepthee Kasal

    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.