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.

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

Similar Messages

  • How to Get Default Printer from ITS

    Hi all,
    I want to get the default printer name when i run application thru ITS ..
    I have function module  RSPO_FRONTEND_PRINTERS_FOR_DEV   which shows the default printer available in the system but it is in SAPGUI and which dont work for ITS applications.
    Does any body knows the function which brings Default printer in ITS .  I appreciate your answers . I Appreciate your responses.
    Thanks
    Pradeep Reddy

    With PrintGetPrinters(), I can get all printer in the list. If it is a bug, where to get the patch for 11.5?
    My pb build is 11.5.1 4608.
    Also, another alternative solution to get default printer with pb 11.5.1?
    Another is: is Pb 11 and Pb 12 can be installed on windows XP side by side?

  • Update default profile from ABAP Program

    Hi All,
    I want to update/create a system parameter in default profile via ABAP Program.
    Eg. login/system_client = 000
    Anybody has any idea how to achieve this?
    Thanks and Regards, Pradeep

    Hi Pradeep,
                        Iam not sure it can be changed from ABAP prog., for me it's look difficult because this default profile is located at OS level not in the application level.
              For any basis guy this is matter of few min. to change/ add this parameter from RZ10. If you want to reinvent the wheel it's up to you.
    Regards,
    Hari.

  • Why do I keep getting default printer not supported?

    I have had my printer for aprox.three years without a problem, now I get default printer not supported and printer not activated error code 30

    Hi there,
    Could you provide the community with a little more information to help narrow troubleshooting? Things like your printer model and your operating system help out a lot.
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Default printer during printout program

    hi guys,
    how does system get the default printer for report printout if the su01 for default printer field is empty

    HI Balu,
    the program uses FM BP_JOBVARIANT_SCHEDULE to submit background job.
    For user A , it always set the default printer to LPO3 even SU01 sets to NWO5,
    while user B can get the correct printer NWO5 as per its SU01 setting.. how come both users can get different printer from the same program .
    Initially i thought it depends on SU01 , but even user A has changed its default printer to NWO5, still system will take LPO3.. plz advice

  • Unicode Printing in ABAP program

    Hi all,
    I have a problem in Unicode printing. When I write a report, I use Unicode font. Everything is Ok when I print preview this report. But when i send it to the printer, the unicode font doesn't present.
    Do you know how to solve this problem ?
    Thank you very much.
    Sylvecast.

    Hi Atish,
    Yes, of course. I can print any word document with unicode font. I don't know if there must have any settings in ABAP program ? But when i print preview it, evrey thing is OK.
    Kindly regards,
    Sylvecast.

  • Get default printer share name

    Can someone give a code snippet of how to get the default printer share name?
    I'm able to get the printer name with the following but can't get the share name.
        private void listClientPrinters(PrintService[] pServers) {
            for (int i = 0; i < pServers.length; i++) {
                javax.print.PrintService ps = pServers;
    write_message("Client Printer "+i+": "+ps.getName());
    }Thanks,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    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

  • Cannot get default printer to operate correctly

    No matter what I do, the default printer is not the one that comes up when I want to print from Pages - is there some switch or setting I need to click besides setting one printer as the default printer?

    John,
    It's a bug in Pages. It seems that if you make your first save with a different printer, you can never get it to go back to your default printer. You have no idea how disconcerting it is to issue the print command to my 400-page manuscript, and watch it start spewing it out on address labels.
    -Dennis

  • Newbie question: Send data to printer from ABAP program

    Hello, I am a newbie.
    I do not use  SAPScript nor SmartForms.
    But I need to send a printer command stream from my ABAP to printer.
    Is it possible?
    How can this be possible? Please give me some guideline.
    I will reward you points. Promise.
    Thanks

    hi,
    u can send ur program details to printer using submit to sap-spool statement.
    SUBMIT TO SAP-SPOOL
    Basic form
    SUBMIT rep ... TO SAP-SPOOL.
    Extras:
    1.... DESTINATION dest         ... COPIES cop
            ... LIST NAME name
            ... LIST DATASET dsn
            ... COVER TEXT text
            ... LIST AUTHORITY auth
            ... IMMEDIATELY flag
            ... KEEP IN SPOOL flag
            ... NEW LIST IDENTIFICATION flag
            ... DATASET EXPIRATION days
            ... LINE-COUNT lin
            ... LINE-SIZE  col
            ... LAYOUT layout
            ... SAP COVER PAGE mode
            ... COVER PAGE flag
            ... RECEIVER rec
            ... DEPARTMENT dep
            ... ARCHIVE MODE armode
            ... ARCHIVE PARAMETERS arparams
            ... WITHOUT SPOOL DYNPRO
    2. ... SPOOL PARAMETERS params
             ... ARCHIVE PARAMETERS arparams
             ... WITHOUT SPOOL DYNPRO
    3. ... Further parameters (for passing variants)
            are described in the documentation for SUBMIT
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Missing print parameters with SUBMIT.
    Effect
    Calls the report rep with list output to the SAP spool database.
    Additions
    ... DESTINATION dest(output device)
    ... COPIES cop(number of copies)
    ... LIST NAME name(name of list)
    ... LIST DATASET dsn(name of spool dataset)
    ... COVER TEXT text(title of spool request)
    ... LIST AUTHORITY auth(authorization for display)
    ... IMMEDIATELY flag(print immediately ?)
    ... KEEP IN SPOOL flag(keep list after print ?)
    ... NEW LIST IDENTIFICATION flag(new spool request ?)
    ... DATASET EXPIRATION days(number of days list
    retained)
    ... LINE-COUNT lin ( lin lines per page)
    ... LINE-SIZE  col(col columns per line)
    ... LAYOUT layout(print format)
    ... SAP COVER PAGE mode(SAP cover sheet ?)
    ... COVER PAGE flag(selection cover sheet ?)
    ... RECEIVER rec(SAP user name of
    recipient)
    ... DEPARTMENT dep(name of department)
    ... ARCHIVE MODE armode(archiving mode)
    ... ARCHIVE PARAMETERS arparams(structure with archiving
    parameters)
    ... WITHOUT SPOOL DYNPRO(skip print control screen)
    With the parameters IMMEDIATELY, KEEP IN SPOOL, NEW LIST IDENTIFICATION and COVER TEXT, flag must be a literal or character field with the length 1. If flag is blank, the parameter is switched off, but any other character switches the parameter on. You can also omit any of the sub-options of PRINT ON. mode with SAP COVER PAGE can accept the values ' ', 'X' and 'D'. These values have the following meaning:
    ' ' : Do not output cover sheet
    'X' : Output cover sheet
    'D' : Cover sheet output according to printer setting
    armode with ARCHIVE MODE can accept the values '1', '2' and '3'. These values have the following meaning:
    '1' : Print only
    '2' : Archive only
    '3' : Print and archive
    arparams with ARCHIVE PARAMETERS must have the same structure as ARC_PARAMS. This parameter should only be processed with the function module GET_PRINT_PARAMETERS.
    Effect
    Output is to the SAP spool database with the specified parameters. If you omit one of the parameters, the system uses a default value. Before output to the spool, you normally see a screen where you can enter and/or modify the spool parameters. However, you can suppress this screen with the following statement:
    ... TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    You could use this option if all the spool parameters have already been set!
    Note
    When specifying the LINE-SIZE, you should not give any value > 132 because most printers cannot print wider lists.
    Addition 2
    ... SPOOL PARAMETERS params(structure with print
    parameters)
    ... ARCHIVE PARAMETERS arparams(Structure with archive
    parameters)
    ... WITHOUT SPOOL DYNPRO(skip print parameters
    screen)
    Effect
    Output is to the SAP spool database with the specified parameters. The print parameters are passed by the field string params which must have the structure of PRI_PARAMS. The field string can be filled and modified with the function module GET_PRINT_PARAMETERS. The specification arparams with ARCHIVE PARAMETERS must have the structure of ARC_PARAMS. This parameter should only be processed with the function module GET_PRINT_PARAMETERS. Before output to the spool, you normally see a screen where you can enter and/or modify the spool parameters. However, you can suppress this screen with the following statement:
    ... WITHOUT SPOOL DYNPRO
    Example
    Without archiving
    DATA: PARAMS LIKE PRI_PARAMS,
          DAYS(1)  TYPE N VALUE 2,
          COUNT(3) TYPE N VALUE 1,
          VALID    TYPE C.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING DESTINATION           = 'LT50'
                COPIES                = COUNT
                LIST_NAME             = 'TEST'
                LIST_TEXT             = 'SUBMIT ... TO SAP-SPOOL'
                IMMEDIATELY           = 'X'
                RELEASE               = 'X'
                NEW_LIST_ID           = 'X'
                EXPIRATION            = DAYS
                LINE_SIZE             = 79
                LINE_COUNT            = 23
                LAYOUT                = 'X_PAPER'
                SAP_COVER_PAGE        = 'X'
                COVER_PAGE            = 'X'
                RECEIVER              = 'SAP*'
                DEPARTMENT            = 'System'
                NO_DIALOG             = ' '
      IMPORTING OUT_PARAMETERS        = PARAMS
                VALID                 = VALID.
    IF VALID <> SPACE.
      SUBMIT RSTEST00 TO SAP-SPOOL
        SPOOL PARAMETERS PARAMS
        WITHOUT SPOOL DYNPRO.
    ENDIF.
    Example
    With archiving
    DATA: PARAMS   LIKE PRI_PARAMS,
          ARPARAMS LIKE ARC_PARAMS,
          DAYS(1)  TYPE N VALUE 2,
          COUNT(3) TYPE N VALUE 1,
          VALID    TYPE C.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING DESTINATION            = 'LT50'
                COPIES                 = COUNT
                LIST_NAME              = 'TEST'
                LIST_TEXT              = 'SUBMIT ... TO SAP-SPOOL'
                IMMEDIATELY            = 'X'
                RELEASE                = 'X'
                NEW_LIST_ID            = 'X'
                EXPIRATION             = DAYS
                LINE_SIZE              = 79
                LINE_COUNT             = 23
                LAYOUT                 = 'X_PAPER'
                SAP_COVER_PAGE         = 'X'
                COVER_PAGE             = 'X'
                RECEIVER               = 'SAP*'
                DEPARTMENT             = 'System'
                SAP_OBJECT             = 'RS'
                AR_OBJECT              = 'TEST'
                ARCHIVE_ID             = 'XX'
                ARCHIVE_INFO           = 'III'
                ARCHIVE_TEXT           = 'Description'
                NO_DIALOG              = ' '
      IMPORTING OUT_PARAMETERS         = PARAMS
                OUT_ARCHIVE_PARAMETERS = ARPARAMS
                VALID                  = VALID.
    IF VALID <> SPACE.
      SUBMIT RSTEST00 TO SAP-SPOOL
        SPOOL PARAMETERS PARAMS
        ARCHIVE PARAMETERS ARPARAMS
        WITHOUT SPOOL DYNPRO.
    ENDIF.

  • How to get rid of '#' in ABAP program ?

    Hi, Gurus:
    Our ABAP report reads flat file, the file is created by a legacy system.
    Previously, it works fine.
    Recently, the each line of file ended with symbol '#'.
    We want to get rid of it, but not lucky:
    We have tried using replace it with '', and tried using SHIFT by one space, all does not work.
    Any one have good suggestion ?
    Thanks in advance.
    Liang

    Hi,
    Get the length of the record for each line & reduce the length by 1.
    loop at gt_tab into watab.
    delete trailing spaces of wa_tab-data.........
    lv_len = strlen(wa_tab-data),
    lv_len = lv_len - 1.
    lv_data = wa_tab-data+0(lv_len).  " lv_data will have the data without #
    endloop.
    Best regards,
    Prashant

  • How to get the layouts in ABAP program/Query

    Hi -
    I had created some layouts for a ABAP query and I can see them in the table LTDX as well.
    But I had deleted the layouts while changing the query settings.
    How can I get those layouts back in my query? Please suggest. Thanks.

    Hi,
    Did you check with the below function modules,
    ALV_LAYOUT_GET
    REUSE_ALV_VARIANT_F4
    Also try executing the report, RSVARDOC_610, which will enable the variants sometimes after some modifications.
    I am not sure, but may be you can have a look.....

  • How to get Access key for ABAP Program development in HANA Studio

    Hi,
    I have got instance for ABAP on HANA development system.
    But while creating new program it is asking me for Access key, since I do not have user id pwd for service market place I couldnt able to create the access key.
    Can any one suggest the way to create ACCESS KEY??
    Thanks,
    Ram

    Dear Ram,
    it seems that you need to follow the chapter 6.1 in the documentation...:
    Kind regards, Stephan

  • Getting delivered Quantity using ABAP Program

    Dear All,
    How can I get the delivered quantity against a sales order document (Orders in VA03).?
    Which tables are involved.? How can I  join the tables.?
    Regards,
    Aneel

    Aneel,
    You should take the sales order number and item number and find the corresponding lite item in the delivery. The field LFIMG in LIPS will tell you the quantity that is delivered.
    For sales order, you can use VBAK/VBAP
    For Delivery you can use LIKP/LIPS.
    Thanks,
    Vikram.M

  • Printing barcode from ABAP program

    Hi,
    Is it possible to print barcode (using zebra barcode printing) from ABAP program directly without using Smart Form, SAP Script or Adobe PDF Form.
    I have the barcode instructions, I just want to output it to the barcode printer directly.
    Sample instructions to be output to barcode printer:
    FT128,288XG005.GRF,1,1^FS
    FT96,128XG000.GRF,1,1^FS
    FT64,192XG001.GRF,1,1^FS
    FT0,288XG002.GRF,1,1^FS
    FT0,224XG003.GRF,1,1^FS
    FT128,256XG004.GRF,1,1^FS
    FO16,180GB496,0,5^FS
    FO52,37GB450,66,4^FS
    BY4,3,40FT86,320^BCN,,Y,N
    FD>;123456>67FS
    PQ1,0,1,YXZ
    XAID000.GRFFSXZ
    Thanks in advance.

    Hello,
    Yes we can do it..
    Go through this link you will some idea
    http://sapprograms.blogspot.com/2008/11/barcode-printing.html
    http://www.sap-img.com/abap/details-information-about-sap-barcodes.htm

  • Set Default Printer based on user setting using Powershell script

    Hi 
    I would like to create a script that runs on user log off and captures the default printer (set manually by the user) and then another script to reapply the settings (saved upon log off) when the user logs back in.
    This is because local printers are set as default printer (PDF Creator Programs) when we all use Network Printers so this means a user has to set default printer to the network printer all the time.
    I have found this script to start with:
    $Printer = Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select name | out-file C:\temp\Printer.txt
    But the out file looks like this:
    name
    \\PrinterserverName\Accounts01
    Which I dont see how it can be used on another script plus there are spaces after\Account01 
    Any Ideas please?
    M
    Maelito

    Hi Maelito,
    According to your description, you want to export the default printer name to text file, then read this printer name from text file and set the default printer via Powershell:
    #save printer name to text file
    Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select -ExpandProperty name | out-file C:\temp\Printer.txt
    # read printer name from text file and set default printer
    $name=get-content C:\temp\Printer.txt
    (Get-WmiObject -Class Win32_Printer -Filter "Name='$name'").SetDefaultPrinter()
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Maybe you are looking for

  • Getting error while opening Enterprise project type (EPT)

    Hello All, In Project Server 2013, I am getting error while opening any Enterprise project type (EPT) from EPT page or when I am trying ot create any new EPT. How can I troublshoot this, please help. Thanks in advance

  • Collapsible Panel not displaying correctly in IE

    I have a collapsible panel in a link list that functions properly in FF, Safari and Opera but completely falls apart in IE 6 and 7. Does anyone know what would cause this or how to fix it? I thought that swfobject might be interfering with spry in so

  • JAXB binding compiler error "Unique Particle Attribution"

    I'm trying to compile an xsd but get an error: parsing a schema... [ERROR] cos-nonambig: "":SomeData and WC[##any] (or elements from their substitution group) violate "Unique Particle Attribution". line 4 of TestCase.xsd Failed to parse a schema. I'v

  • 2 tomcat installation guides

    Hi, i've struggled a lot to get tomcat working as it should. Finally I came across a tutorial on the web for tomcat 6, that was of great help for me. http://www.coreservlets.com/Apache-Tomcat-Tutorial/ This tutorial contains a detailed description on

  • IChat AV multi video hosting probs

    Ive had trouble hosting a multi video conference on my computer. Ive got an airport network setup at my house with three computers. After having problems hosting a 3 way video chat, (normal 1 to 1 chat works perfectly). The computer was saying that '