Logic to get  2 print copies separately

Hi All,
We have a req on check printing to add logic to take care of 2 print copies (check and office copy)separately and save them in a PDF file in a location thru pop-up.
Pls. provide your valuable pointer.
Thanks,
Deepti.

Hi,
Refer to the following code. it will be helpful for u.
REPORT  ZPRACSCRIPT.
TABLES: likp, lips,itcpo.
Data:  struct type itcpo,
      pdftab type standard TABLE OF tline,
      datab TYPE standard TABLE OF itcoo.
DATA: BINFILe type I,
      filename type string,
      filepath type string,
      fullpath type string.
struct-tddest = 'LP-01'.
struct-tdnoprev = 'X'.
itcpo-tdgetotf = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
   DEVICE                            = 'PRINTER'
   DIALOG                            = 'X'
   FORM                              = 'Z_PRAC'
   LANGUAGE                          = SY-LANGU
  OPTIONS                           = itcpo
EXCEPTIONS
   CANCELED                          = 1
   DEVICE                            = 2
   FORM                              = 3
   OPTIONS                           = 4
   UNCLOSED                          = 5
   MAIL_OPTIONS                      = 6
   ARCHIVE_ERROR                     = 7
   INVALID_FAX_NUMBER                = 8
   MORE_PARAMS_NEEDED_IN_BATCH       = 9
   SPOOL_ERROR                       = 10
   CODEPAGE                          = 11
   OTHERS                            = 12
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 'CLOSE_FORM'
TABLES
  OTFDATA                        = datab
EXCEPTIONS
   UNOPENED                       = 1
   BAD_PAGEFORMAT_FOR_PRINT       = 2
   SEND_ERROR                     = 3
   SPOOL_ERROR                    = 4
   CODEPAGE                       = 5
   OTHERS                         = 6
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 'CONVERT_OTF'
   EXPORTING
     FORMAT                      = 'PDF'
  IMPORTING
     BIN_FILESIZE                = BINFILE
    TABLES
      otf                         = datab
      lines                       = pdftab
   EXCEPTIONS
     ERR_MAX_LINEWIDTH           = 1
     ERR_FORMAT                  = 2
     ERR_CONV_NOT_POSSIBLE       = 3
     ERR_BAD_OTF                 = 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 METHOD cl_gui_frontend_services=>file_save_dialog
    CHANGING
      filename             = filename
      path                 = filepath
      fullpath             = fullpath
    EXCEPTIONS
      CNTL_ERROR           = 1
      ERROR_NO_GUI         = 2
      NOT_SUPPORTED_BY_GUI = 3
      others               = 4
  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 'GUI_DOWNLOAD'
    EXPORTING
     BIN_FILESIZE                    = binfile
      filename                        = 'D:\MYFILE.PDF'
     FILETYPE                        = 'BIN'
    tables
      data_tab                        = pdftab
   EXCEPTIONS
     FILE_WRITE_ERROR                = 1
     NO_BATCH                        = 2
     GUI_REFUSE_FILETRANSFER         = 3
     INVALID_TYPE                    = 4
     NO_AUTHORITY                    = 5
     UNKNOWN_ERROR                   = 6
     HEADER_NOT_ALLOWED              = 7
     SEPARATOR_NOT_ALLOWED           = 8
     FILESIZE_NOT_ALLOWED            = 9
     HEADER_TOO_LONG                 = 10
     DP_ERROR_CREATE                 = 11
     DP_ERROR_SEND                   = 12
     DP_ERROR_WRITE                  = 13
     UNKNOWN_DP_ERROR                = 14
     ACCESS_DENIED                   = 15
     DP_OUT_OF_MEMORY                = 16
     DISK_FULL                       = 17
     DP_TIMEOUT                      = 18
     FILE_NOT_FOUND                  = 19
     DATAPROVIDER_EXCEPTION          = 20
     CONTROL_FLUSH_ERROR             = 21
     OTHERS                          = 22
  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
Rajesh Kumar
Edited by: Rajesh Kumar on May 4, 2009 8:43 AM

Similar Messages

  • Same content gets printed in copies

    Hi ,
    I am trying to print one original and 2 copies for a PO form. There are few texts specific to the copies. I am using copies window to achieve this. All these are getting displayed correclty in the spool request. When I take the hardcopy/print the original PO is getting printed thrice.
    What could be the reason for this?

    Tanveer,
    Not sure what is happening here, but this shouldn't be correct. Maybe you have the same page portlet being shown within the three tabs. I don't see a big explanation for this to happen. I wonder if this is happening in all your site, ie, page groups and pages?
    Maybe drop and recreate the page?
    I hope it helps...
    Cheers,
    Pedro.

  • Same content gets printed while printing copies in SRM

    Hi ,
    I am trying to print one original and 2 copies for a PO form. There are few texts specific to the copies. I am using copies window to achieve this. All these are getting displayed correclty in the spool request. When I take the hardcopy/print the original PO is getting printed thrice.
    What could be the reason for this?

       Copies are not supported in adobe form. There are certain things which are different between the forms. SAP note 1009567 explains it clearly.  Alternative solution to get multiple copies has been explained in the thread  Multiple copies in Adobe form with different header text.
    So,i'm closing this thread.

  • Getting two copies of print when only asking for one.

    Hi, whenever I send a job to print, I always seem to get two copies even though I have only requested one. It is wasting both paper and ink. Any ideas how correct this problem?. Thanks.

    Hello David,
    You could try resetting the printing system. This will remove your current print queues so you will have to add the printer queues again - but you will not need to install the driver software again.
    To reset the printing system...
    1. Open System Preferences > Print & Fax
    2. Move your mouse over the Printers list
    3. Hold down the Control button and click the mouse (or right click if supported).
    4. Click "Reset printing system ..."
    5. Restart your Mac
    Pahu

  • Invoice is not getting printed for particular 3 customers

    Hi,
    When user is printing the Invoices, only for specific 3 customers it is it not getting printed automatically, but the output is shows success with green. When they re process it manually, it is printing successfully for the same printer.
    1. Printer setup is checked it is correct
    2. There are two outputs one is External send (E-mail) and one is Printout.
    3. The problem is with only the Printout, where as the external send (E-mail) is sent successfully.
    Help me out in this issue...
    Thanks
    BP

    Hi
    First of all Welcome to SCN Forum
    Please check wheather any subroutine has been assigned to the output type access sequence.If the problem is with printout only then check the Logical destination that has been maintained in VV32 for those 3 customers.In VV32 for those 3 customers check wheather Release Immediately has been checked or not. Before reprocessing it go to VF02 and check on determine analysis
    Regards
    Srinath

  • PO price not getting printed

    Hi ,
    When I create a PO without the Inv Receipt check box in the Item details (Invoice tab) the net price is taken as 0. And consequently I do not see the price appearing in the print preview of PO.
    My question is : I do not want to do a Invoice. But I need a price in the PO and it should get printed. Do i need to change the pricing condition for this? Or is there any config change that I can make so that the Inv receipt check box and net price are not affected at the same time.

    Hi
    In such cases of free goods where you need to print the material price, the material price needs to be picked up from the material master.
    In the Print program you need to do this modifictaion,
    If the PO line item if Flagged as free godds then you need to pick up the price form MBEW table.
    Please witre a note that this item is a free goods & carries no valution, price mentioned here is for valuation only.
    In case of Stock transfer between storag locations the same logic is used.
    If you donot complete the invoice , then the anmount will be pending in the GR/IR Clearing account, which is settled by an invoice
    Thanks & Regards
    Kishore

  • How to get multiple copies with different decription on header line

    I want to get multiple copies of print out automatically with different description on header line when i click on save or print button.

    is this smartforms....?
    if yes then this can be achieved using the copy windows concept of smartforms.....
    Regards,
    Lalit Mohan Gupta

  • Getting printer properties

    In my Java program I am able to get printer names by using the <code>PrintServiceLookup</code> class.
    What I am now looking for is a method to gather other information belonging to a specific printer, e.g. <code>Description</code>, <code>Location</code>, <code>Printer Driver</code>. These properties are visible in the Windows Registry, but does anyone know how I get the values in my program?
    Thanks in advance.

    Querying fall all valid attributes gives:
    class javax.print.attribute.standard.JobName
    class javax.print.attribute.standard.RequestingUserName
    class javax.print.attribute.standard.Copies
    class javax.print.attribute.standard.Destination
    class javax.print.attribute.standard.OrientationRequested
    class javax.print.attribute.standard.PageRanges
    class javax.print.attribute.standard.Media
    class javax.print.attribute.standard.MediaPrintableArea
    class javax.print.attribute.standard.Fidelity
    class javax.print.attribute.standard.SheetCollate
    class sun.print.SunAlternateMedia
    class javax.print.attribute.standard.Chromaticity
    class javax.print.attribute.standard.Sides
    class javax.print.attribute.standard.PrinterResolution
    so you're out of luck. Seems like what you're after is platform specific: I guess on other platforms 'Driver' might not be necessary - and certainly 'Port' doesn't make a lot of sense in the can of a LAN printer. I'd leave these details to the underlying OS.

  • Getting print error messages after 8.1.3 update

    Adobe Acrobat 8 - Since the 8.1.3 update a couple days ago, I am now getting print error messages in the Adobe PDF printer status box when I send any document to the Adobe PDF printer. The actual printing of the document in Adobe works correctly, but these error messages occur as well - even though the document printed just fine.
    I am running Windows Vista Ultimate and did not have the issue prior to the 8.1.3 update.

    I have removed PDFMaker from Office, to try to simplify the troubleshooting. All attempts to print end up the same, whether from PDFMaker (before I removed it from Office), from print to Adobe PDF from within an Office app, or using Create a PDF in AP 8.1.3 from an Office file ... the last hourglass comes up in "reading Adobe PDF" and stays up. I can see the "target file" created in WinExpl but greyed out, and the hourglass (busy) never goes away in AP 8.1.3.
    In contrast, if I want to create a pdf from a "save as" text file, AP 8.1.3 creates the pdf instantly. Create a pdf from scanner also works fine. This problem is definitely related to updates, since AP 8.1 worked perfectly the last time I used it from Office, which was perhaps 2 months ago.
    AP 8.1 suddenly stopped working this week with a "can't create PDF" error message, I updated AP all the way to 8.1.3, and have the problem described above. I don't get an error message now, the create PDF or print to PDF simply never completes.
    BTW, both my desktop and notebook run Vista Ultimate 64-bit, both have registered and activated copies of AP 8.1.3, and Office 2007, and both have the exact same problem.
    I uninstalled AP 8.1.3 on the desktop, installed the trial version of AP 9.0, and experienced the exact same problem as with AP 8.1.3, the create pdf never completes, but produces no error message.
    I print to XPS as a workaround since print to Adobe PDF never completes.

  • Boxes getting Printed for Language Printout

    Hi SDN,
    Im trying to print few details in the Korean Language from an SAP Script. I have made the changes to the existing script and the Print Preview comes perfectly fine.
    When I take the Print Out from the Spool Request, blank boxes get printed instead of Korean Language Text. Im using the Unicode Printer
    Can anyone help me out with this.
    Thanks and Regards,
    Manu Kapur

    Hi
    First of all Welcome to SCN Forum
    Please check wheather any subroutine has been assigned to the output type access sequence.If the problem is with printout only then check the Logical destination that has been maintained in VV32 for those 3 customers.In VV32 for those 3 customers check wheather Release Immediately has been checked or not. Before reprocessing it go to VF02 and check on determine analysis
    Regards
    Srinath

  • Text overflown is not getting printed in the next page in ADOBE

    Hi Experts,
    I have a text field, where the users can enter the comments. In this text field if the user enters more than a page, a scroll bar appears in the print preview where the users can view the complete text what they have entered, but while printing the text which exceeds more than a page is not getting printed in the next page.
    I have set the subform properties as "Flowed" and the check box "Allow Page Break within content" is also been enabled, but still the extra contents is not getting printed in the next page.
    Please help me regarding this.
    Thanks & Regards,
    Karthik MD

    Hi Lohitha,
    Even "Expand to fit" is been enabled.
    Thanks & Regards,
    Karthik MD

  • Text overflown in the first page is not getting printed in the next page

    Hi Experts,
    I have a text field, where the users can enter the comments. In this text field if the user enters more than a page, a scroll bar appears in the print preview where the users can view the complete text what they have entered, but while printing the text which exceeds more than a page is not getting printed in the next page.
    I have set the subform properties as "Flowed" and the check box "Allow Page Break within content" is also been enabled, but still the extra contents is not getting printed in the next page.
    Please help me regarding this.
    Thanks & Regards,
    Karthik MD

    Hi,
    This issue is in ADOBE, I think there is no concept of Window in ADOBE,
    The text box is placed inside a Subform.

  • Values not getting printed in the Output

    Hi all,
        Iam facing strange problem.
    In the debug mode iam seeing the values for all variables ( Variable windows) but after printing no value is getting printed. MAIN window is there but no element is being called from the MAIN window.
    Can anyone help me in this regard.
    Rehards,
    Indrajit

    hi Indrajit ,
    check that in print program you have created the element same as using in main program , also declare temporary variables inside loop at table so that **** sign doesnt gets printed ..
    Hope this will help you

  • Barcode is not getting printed in the SmartForm

    Hi All,
    I am trying to print BARCODE in a SMARTFORM but it is not getting printed.
    I have created a barcode ZTest_Barcode from the transaction SE73. Then I have created a Character Format C1 with this barcode ZTest_Barcode.
    In the SmartForm I have applied this character format like this <C1>&WA_VBAK-VBELN&</C1>.
    But in the preview of this SmartForm barcode is not getting printed while this field is printing like <C1>220<C1>.
    I have also tried with some SAP barcodes like BC_CD39, C128A_01, etc. But the result is same.
    Please help me to resolve this issue.
    Regards,
    Avaneet

    hi avaneet,
    check this site for barcode.
    http://help.sap.com/saphelp_nw04/helpdata/en/66/1b45c136639542a83663072a74a21c/content.htm
    it may help you.
    thanks
    Sachin

  • Background job- getting printed automatically

    In my BDC Program i have submitted  Session for Background Processing using
    Submit RSBDCSUB..........
    my code is also given below..The problem is after the user executes the program, background job is automatically going to his Local printer and getting printed. HOw to avoid this?
    CALL FUNCTION 'JOB_OPEN'
           EXPORTING
                jobname          = gf_jobname
           IMPORTING
                jobcount         = gf_jobcount
           EXCEPTIONS
                cant_create_job  = 1
                invalid_job_data = 2
                jobname_missing  = 3
                OTHERS           = 4.
    *-Submit the selected sales orders for changes.
      SUBMIT rsbdcsub AND RETURN
             WITH mappe = v_sess
             WITH von = sy-datum
             WITH bis = sy-datum
             WITH z_verarb = 'X'
             WITH fehler = space
             WITH batchsys = space
             WITH logall = space
             USER sy-uname VIA JOB gf_jobname NUMBER gf_jobcount.
      IF sy-subrc NE 0.
        MESSAGE i999 WITH text-013.
        EXIT.
      ENDIF.
    *-Close job and start immediately.
      CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                jobcount             = gf_jobcount
                jobname              = gf_jobname
                strtimmed            = 'X'
           IMPORTING
                job_was_released     = gf_release
           EXCEPTIONS
                cant_start_immediate = 1
                invalid_startdate    = 2
                jobname_missing      = 3
                job_close_failed     = 4
                job_nosteps          = 5
                job_notex            = 6
                lock_failed          = 7
                OTHERS               = 8.

    On SUBMIT use
    SUBMIT zxxxxxx TO SAP-SPOOL
                        WITHOUT SPOOL DYNPRO
                        IMMEDIATELY  ' '
                        KEEP IN SPOOL 'X'
                        DESTINATION printer
                         NUMBER  number
                        AND RETURN

Maybe you are looking for