Printing in Background.

Hello,
          I am trying to print a report in the background but i am getting a runtime error. The exception invalid_jobdata on job_submit FM is raised.
this is the code i have written.
DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
      L_RELEASE(1) TYPE c.
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
   COPIES                       = COUNT
   COVER_PAGE                   = 'X'
   DEPARTMENT                   = 'System'
   DESTINATION                  = 'LOCL'
   EXPIRATION                   = DAYS
  IMMEDIATELY                  = 'X'
   LAYOUT                       = 'X_PAPER'
   LINE_COUNT                   = 65
   LINE_SIZE                    = 70
   LIST_NAME                    = 'ZSALESREPORT'
   LIST_TEXT                    = 'SALES REPORT'
   NEW_LIST_ID                  = 'X'
   NO_DIALOG                    = ' '
   RECEIVER                     = sy-uname
   RELEASE                      = 'X'
  REPORT                       = C_CHAR_UNKNOWN
   SAP_COVER_PAGE               = ''
  HOST_COVER_PAGE              = C_CHAR_UNKNOWN
  PRIORITY                     = C_NUM1_UNKNOWN
  SAP_OBJECT                   = C_CHAR_UNKNOWN
  TYPE                         = C_CHAR_UNKNOWN
   USER                         = SY-UNAME
IMPORTING
   OUT_PARAMETERS               = PARAMS
   VALID                        = VALID
EXCEPTIONS
  ARCHIVE_INFO_NOT_FOUND       = 1
  INVALID_PRINT_PARAMS         = 2
  INVALID_ARCHIVE_PARAMS       = 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.
IF VALID <> SPACE.
   CALL FUNCTION 'JOB_OPEN'
     EXPORTING
       JOBNAME                = 'ZSALESREPORT1'
    IMPORTING
      JOBCOUNT               = P_JOBCNT
    EXCEPTIONS
      CANT_CREATE_JOB        = 1
      INVALID_JOB_DATA       = 2
      JOBNAME_MISSING        = 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 'JOB_SUBMIT'
  EXPORTING
  ARCPARAMS                         =
    AUTHCKNAM                         = SY-UNAME
  COMMANDNAME                       = ' '
  OPERATINGSYSTEM                   = ' '
  EXTPGM_NAME                       = ' '
  EXTPGM_PARAM                      = ' '
  EXTPGM_SET_TRACE_ON               = ' '
  EXTPGM_STDERR_IN_JOBLOG           = 'X'
  EXTPGM_STDOUT_IN_JOBLOG           = 'X'
  EXTPGM_SYSTEM                     = ' '
  EXTPGM_RFCDEST                    = ' '
  EXTPGM_WAIT_FOR_TERMINATION       = 'X'
    JOBCOUNT                          = P_JOBCNT
    JOBNAME                           = 'ZSALESREPORT1'
  LANGUAGE                          = SY-LANGU
   PRIPARAMS                         = PARAMS
   REPORT                            = 'ZSALESREPORT'
   VARIANT                           = 'TEST'
IMPORTING
  STEP_NUMBER                       =
EXCEPTIONS
  BAD_PRIPARAMS                     = 1
  BAD_XPGFLAGS                      = 2
  INVALID_JOBDATA                   = 3
  JOBNAME_MISSING                   = 4
  JOB_NOTEX                         = 5
  JOB_SUBMIT_FAILED                 = 6
  LOCK_FAILED                       = 7
  PROGRAM_MISSING                   = 8
  PROG_ABAP_AND_EXTPG_SET           = 9
  OTHERS                            = 10
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 'JOB_CLOSE'
     EXPORTING
       JOBCOUNT                          = P_JOBCNT
       JOBNAME                           = 'ZSALESREPORT1'
       STRTIMMED                         = 'X'
       PRDMINS                          = 15
    IMPORTING
      JOB_WAS_RELEASED                  = L_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
      INVALID_TARGET                    = 8
      OTHERS                            = 9.
   IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
   ENDIF.
ENDFORM.
THANKS IN ADVANCE,
KB

Hi Kumar
You can try this way:
1. In the second program, before the displaying the output use statement: NEW-PAGE PRINT ON. This will open a spool.
2. Once output is finished, close the spool by NEW-PAGE PRINT OFF.
3. Get the value of SYST-SPONO.
4. This will hold the spool number created.
5. Use FM: RSPO_OUTPUT_SPOOL_REQUEST to issue the print.
Sample:
          CALL FUNCTION 'RSPO_OUTPUT_SPOOL_REQUEST'
            EXPORTING
              device           = <printer>
              spool_request_id = <request>.
Hope this helps.
Kind Regards
Eswar

Similar Messages

  • TO not printing in background processing of process message

    Dear Experts,
    We are using PI sheets and process messages to do GR (WM) and then put away to a destination storage bin. TO is getting printed in the default user profile printer when user is manually sending  process message in CO54. But not getting printed when processed by a background job(RCOCB004). We tried even after maintaining the printer in background user but of no use. It only generates the spool and no direct print happening. Kindly let me know if this is the std SAP behavior and any way to control this.
    Thanks
    Rijil

    hi, thanks you reply.
    default delete job is ok.
    but
    default archive job does not work.
    the followding error occured in log.
    Executing ArchiveJob (arvhive job) failed. Reason: java.lang.NullPointerException
    and i have configed something according to:
    [http://help.sap.com/saphelp_nwpi71/helpdata/en/2f/88084136b5f423e10000000a155106/frameset.htm]

  • Printer setting to print in background ?

    Hello,
    Im using F110 to print cheque and advice . I have set in a way to print the advice on the default PC printer (LOCL) and the cheque on a dotmatrix printer that i have created on SPAD. When i test this advice and cheque using TEST TRANSACTION , i could print both advice and cheque at the same time on different printer at the same time. But F110 creates a background job and the jobs triggers the print.
    The setting on SPAD for my printers,
    1) DOTMATRIX(Cheque)
    device attribute -> devicetype = TWSPWIN ,
    Device class = Standard printer
    Access method -> Hot spool access method = F F:Printing on front end printer , HOST PRINTER = <My network printer name(dotmatrix)> , I have also CHECKED (X) "NO DEVICE SELECTION AT FRONTEND"
    2) 1) LOCL
    device attribute -> devicetype = TWSPWIN ,
    Device class = Standard printer
    LOCATION = <Location of the printer >.
    Access method -> Hot spool access method = F F:Printing on front end printer , HOST PRINTER = __DEFAULT.
    Im sure that 'F F:Printing on front end printer' will print when i execute in foreground . But F110 executes the print in background, hence the spool created results in error "frountend unavailable" .
    How can i handle this issue . Should i configure the printer to which i need to send advice in SAP instead of using LOCAL . If i configure what are the parameters i need to maintain w.r.t background execution as im now using 'F F:Printing on front end printer ' on access method.
    Please advice .
    Thanks,
    Jeeva.

    Hi Jeeva,
    I cannot give you the details for the printer configuration but I am sure that you can not print using printer LOCL in background. In background this will always error out as is your case at the moment. You need to define the printer in SPAD.
    You can try the access method as L. We have a printer with similar config used for background printing.
    Regards,
    Anurag

  • Firefox always prints webpage background color

    I have used two different computers and two different printers with same results. Printing works fine when printed from Internet Explore. Older versions of Firefox workfine. An example page is my home page http://www.dixonvision.com

    I have been printing from three different computers. All three with new installs of the latest versions of Firefox. Two of the three are new laptops running Windows 7, the third ia an old Windows XP desktop. All three have access to three network printers.
    I spent many hours last night working on this issue and I think I found the issue but I know of no way to fix it.
    I have low vision and so when using computers I set them into the High Contrast Mode. It is when the computers are in High Contrast Mode that Firefox prints the background of websites.
    This was never an issue in Firefox before version 4. Maybe a fix for this will be in the next build.

  • The option to print in background - I don't understand.

    The option to print in background - I don't understand.

    Hello Comixfreak,
    Welcome to the HP Support Forums!
    I'd like to offer answer your inquiry, but I must admit I am not sure what you are asking. Would it be possible for you to provide a little bit more information as to what you would like have answered?
    I am looking forward to hearing back from you.
    Cheers,
    JERENDS
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • When I print an email with Windows Mail, it prints the background color. How can I change that?

    When I receive an email that has a background color, which I want to print, the background color also prints. I do not the background color to print. How do I stop this?

    See this bug report:
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=683139 bug 683139] - Using the 'High Contrast Black' 'Accessibility Option' in Win XP results in the screen colours being printed.
    <i>(please do not comment in bug reports)</i>

  • Display form & simultaneously PRINT in background

    We have a custom application, where a program is used to generate an adobe print form designed for some legal purposes. When we execute the program, the form gets displayed, after which the user prints it. Can this print function be made automatic without any user intervention? That is, when the program is executed, the legal form is displayed on screen, and also the form gets printed in background?
    We have done quite a few reports, spool_2_pdf and then e-mailing the PDF. But I believe the requirement above is different.
    I have searched and read the different posts, and did not find anything to my requirement described above, so please excuse me and help me out if I have missed reading something.
    Thank you,

    Hello
    Frontend printing from a batch process cannot work, as there is no GUI connection.  
    Kindly refer to SAP note -
    519059 - FAQ: Background processing system
    Regards.

  • Spool  List not printing in Background

    Hi,
       When i try to execute the report in background in development system i can able to see the spool list, whereas when i try to execute the same report in testimg server(may be with more data) i can not see the spool list but the job is in finish status.
    Please can i know the reason for the same.
    Thanks & Regards,
    Sudheer.

    Hi!
    This may be because you started the program with the option, not to create new spool request, or to delete the spool request immediately.
    When you run your program in background, check the printer options also.
    Regards
    Tamá

  • HP Color LaserJet CP1215 - Color printing - Page prints yellow background

    Good morning --- I don't believe I have posted to this forum before, so I hope someone can help me solve this issue. 
    My CP1215 color LaserJet -
    printing pref set to color-
    printing a document with colored icons, etc. or color photograph
    Results: the "background" or what should be the white area, is yellow - bright yellow.  
    If I switch printing pref to B/W, I get a black/white document or photo.  Of course, no color.
    I have replaced the yellow toner cartridge (HP product) TWICE, the second one just this morning.
    There are NO error messages.
    Tried running the cleaning tool; disconnect/reconnect, etc.  No luck.
    I gave up trying to solve this issue 2 years ago, and have kept the pref set to black/white with no tech issues.
    Now, however, I have the need to print in color, and I would really like to figure out how to correct this problem.
    This printer is a monster - ~30 lbs or more, and I would rather not have to haul it to a computer shop or ship it.
    If anyone out there has had this problem, please let me know how/if you were able to resolve it.  Many thanks.
    Susan - Threecats

    Hi Threecats
    I understand when you print in color you are getting a yellow background.
    I have included a document for troubleshooting the all yellow background printing.
    Print out a configuration page from Solution eight first. This document  will provide steps for cleaning and calibrating the printer. The Print quality troubleshooting page will identify the print cartridge that is causing the issue.
    Let me know the results when you compare it to the one in the document and if the background printed yellow again. Also the Print quality troubleshooting page results.
    What kind of paper are you using?
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Acrobat 7.0 prints halftone background in jpegs.

    When I print a Microsoft Publisher file to pdf in Acrobat 7.0 Professional there is a halftone background on 
    all jpegs.  This does not happen with another computer using the same version of acrobat and the same printer.

    I have tried but when I try to install the downloaded up
    date I get the error messaage "Missing source media. (Error 1612)" and do not know
    how to resolve that.

  • PDF printing out background placeholder text in fillable forms

    I'm trying to print out a PDF which has fillable form fields. The Date of Birth text field has a faint grey placeholder text dd/mm/yyyy. Everytime those fields are filled in, the dd/mm/yyyy will also print out in the background. Is this an option that can be turned off or is it something to do with how the form was made?

    Hi Daniel O'Toole,
    Please help with the below listed information for further assistance on this.
    1) Version of Acrobat/ Reader being used.
    2) Os being used
    3) Please attach a sample file to test.
    Thanks,
    Vikrantt Singh

  • PDF Print, white background?

    When I export my .indd doc to a PDF (Print) it looks great. But when I print it out, some text has a white background and my drop shadows turn white. This is resolved by exporting to PDF (Interactive) but I intend to print this doc and want it to be the highest quality!

    InDesignSecrets » Blog Archive » Eliminating the White Box Effect

  • Printing Dark Background Converted PPT

    Hello, I have got a Power Point presentation in PDF format send by my professor, i have to print it out but it has got dark bakground and will use a lot of ink so to resolve i search out the method to change background and reached to the option of Accecibility-custom color  it works but only for viewing but is there any method thats works for printing as it fails there... Thanking you in anticipatio

    Hi zee,
    You can try changing print quality(and reduce the default ppi) in printer properties, that way it would use less ink.
    Another alternative would be to edit the pdf in Acrobat and remove the background image container leaving just the text in front.
    Please let me know if it works or if you need any further assistance.
    Regards,
    Rahul

  • InDesign PDF transparent images not printing right background color.

    problem with exporting an InDesign Document to a PDF and printing. My transparent images are showing up with a darker background than what they are placed on. Know how to help?

    Thanks everyone!  That really helped.
    There were a few other things that I had to make sure of also.
    Solution:
    Images placed in InDesign that were made in Photoshop or another program should be in ckmy format.  The background needs to be in the same ckmy.   Transparency blend must be set at CKMY, then Transparency Flattener presents must be set at Rasters/Vectors: 0 Line art and text resolution: 600, Gradient and mesh resoltuion 300.  Exporting to PDF must be done under present PDF/X-4:2008 Compatibility: Acbrobat 7.

  • How not to print the background?

    How can I only print the content of a sprite (here a simple text) without the background color of the document?
    Thanks for your help.

    if you print a container you will get all the contents of that container..
    since it sounds like you are printing a particular container that holds all that you want.. if you dont wish to attempt capturing another container, you can remove the color form the background until the print event fires and then return it..  it should be quick enough that no one will see it.

  • Logo not print in Background Job

    HI,
    I am running my report in the background i found that logo is not printing.
    And the same report when i print in foreground then the logo is been
    printed so what are the changes tht i need to do to print the logo in background.
    Regards
    VEnk@

    Hi suhas,
    I have uploaded my logo in SMW0 in Binary format.
    And i am able to find the logo when i run the report(classical) in the Foreground
    and the same report when i am runnning in the background logo is missing.
    This is the code which i am using to display the logo.
    FORM show_pic.
       DATA: repid LIKE sy-repid.
             repid = sy-repid.
      CREATE OBJECT picture_control_1 EXPORTING parent = docking.
      CHECK sy-subrc = 0.
      CALL METHOD picture_control_1->set_3d_border
        EXPORTING
          border = 5.
      CALL METHOD picture_control_1->set_display_mode
        EXPORTING
          display_mode = cl_gui_picture=>display_mode_stretch.
      CALL METHOD picture_control_1->set_position
        EXPORTING
          height = 90
          left   = 40
          top    = 30
          width  = 190.
    CHANGE POSITION AND SIZE ABOVE****************
    IF url IS INITIAL.
    REFRESH query_table.
        query_table-name  = '_OBJECT_ID'.
    CHANGE IMAGE NAME BELOW UPLOADED IN SWO0*****************
        query_table-value = 'YREDDY'.
            APPEND query_table.
    query_table-value = 'YLOGO'.
            APPEND query_table.
    *FORMAT HOTSPOT ON.
        CALL FUNCTION 'WWW_GET_MIME_OBJECT'
          TABLES
            query_string        = query_table
            html                = html_table
            mime                = pic_data
          CHANGING
            return_code         = return_code
            content_type        = content_type
            content_length      = content_length
          EXCEPTIONS
            object_not_found    = 1
            parameter_not_found = 2
            OTHERS              = 3.
        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 'DP_CREATE_URL'
          EXPORTING
            type     = 'image'
            subtype  = cndp_sap_tab_unknown
            size     = pic_size
            lifetime = cndp_lifetime_transaction
          TABLES
            data     = pic_data
          CHANGING
            url      = url
          EXCEPTIONS
            OTHERS   = 1.
            ENDIF.
            CALL METHOD picture_control_1->load_picture_from_url
        EXPORTING
          url = url.
    Regards
    VEnk@

Maybe you are looking for