Print the order with Background Job

Hi Gurus,
I have to print the order on button click in a report.
i have done the coding and passing the parameters to a stahndard program on  submit.
but problem is that order is going to spool but not printing the order.
As batch job not supporting the LOCL,please suggect the alternative to achieve the print.
Br,
Surya

Hi Lokesh,
Thanks for your quick reply.
i am using the below code for printing the order with batch job on clicking the button in my report.
     DATA: NAME TYPE TBTCJOB-JOBNAME.
DATA: NUMBER  TYPE TBTCJOB-JOBCOUNT.
DATA: PRINT_PARAMETERS TYPE PRI_PARAMS.
NAME = 'ORDER_PRINTING'.
CLEAR: RANGE1.
*REFRESH: range.
RANGE1-SIGN = 'I'.
RANGE1-OPTION = 'EQ'.
RANGE1-LOW = 'BA00'.
RANGE1-HIGH = 'ZBA1'.
APPEND RANGE1 TO RANGE.             .
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = NAME
IMPORTING
JOBCOUNT         = NUMBER
EXCEPTIONS
CANT_CREATE_JOB  = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING  = 3
OTHERS = 4.
IF SY-SUBRC = 0.
SUBMIT SD70AV1A WITH  RG_KSCHL IN RANGE
  WITH  RG_VBELN IN ORDER_TAB
  TO SAP-SPOOL
  SPOOL PARAMETERS PRINT_PARAMETERS
  WITHOUT SPOOL DYNPRO
  VIA JOB NAME NUMBER NUMBER
  AND RETURN.
IF SY-SUBRC = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = NUMBER
JOBNAME = NAME
STRTIMMED = 'X'
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.
IF SY-SUBRC <> 0.
ENDIF.
ENDIF.
Please suggest where should i give the printer name.
fyi.. i am trying to pass the same LOCL name to the job with the FM- GET_PRINT_PARAMETERS with destinamtion 'LOCL'
Br,
Surya

Similar Messages

  • Printing the order in CRTD status

    Hi,
    Is it possible to print the order in CRTD status.
    System is not allowing by stating error as "statusCRTD is active".
    Regards
    KRISHNAN

    Hi,
    I'm using RBDAPP01 program to process the idoc of ORDERS whose status is 64. Some idoc's are successfully processed with status as 53 and some 51 but I'm also getting some idoc's with status 64.
    Could anybody can suggest how to trouble-shoot!!!
    Thanks
    Syed
    < MODERATOR: This is an old thread. Open a thread for your specific query. Message locked. >
    Edited by: Paul Meehan on Mar 22, 2010 10:20 AM

  • What is the difference between background job and foreground job

    Hi Experts,
    Could you pls tell me
    What is the difference between background job and foreground job
    and where exactly used background jobs...
    Thanks

    Hello,
    Background jobs - without user interaction, scheduled via SM37.
    Foreground jobs - with user interaction (transactions).
    For more information, please read these: [http://help.sap.com/saphelp_nw04/helpdata/en/e4/2adbda449911d1949c0000e8353423/frameset.htm], [http://help.sap.com/saphelp_nw04/helpdata/en/73/69ef5755bb11d189680000e829fbbd/frameset.htm] and [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/20cb0b44-8f0b-2a10-2381-ca8162bcb5b2].
    Regards,

  • How can I view all comments in a Pages doc and print the doc with comments?

    It seems that we can no longer view comments in the margin of a document.  It is also not possible to print the document with comments visible.  Anyone else having this problem?  Pages 09 Help does not even offer an up-to-date explanation.  "Show Comments" only shows color shading.  The option “Show Comments and Changes Pane" does not even exist.  How can I get the comments to print???

    You will have to wait for Apple to fix this deficiency in a forthcoming update to Pages v5. Or, you could use Pages ’09 v4.3, if originally installed before the v5 upgrade, and located in /Applications/iWork '09.
    Otherwise, use another solution (e.g. Office for Mac 2011, LibreOffice).

  • Update Credit managment dispay in some of the orders with same Payer

    Hi,
    I have some sales orders created with same PO, same sold to party and same payer. In one of the Sales Order
    credit control area and credit account is updated but the other order's did not update with this information.
    I can see the Credit account dispay in that Sales Order which got updated but the other orders are giving the message "Cannot display credit limit as no credit management account is available"
    Please let me know how to fix the other Sales orders Credit accounts, these all orders have same Payer and we have issue in the Consolidate billing of these orders and all these orders have subsequent documents like Delivery and Invoice.
    VBAK-KKBER and VBAK-KNKLI fields are blank in these Orders except the one which got updated.
    Thanks in advance.
    - Fract

    Hi Charles,
    The Order with values filled in VBAK-KKBER and VBAK-KNKLI is not a latest order, We have orders after and before this order also.
    I already executed F.28 but nothing got changed.
    Regards,
    Fract
    Edited by: fract_get on Nov 15, 2011 10:26 PM

  • Print Production Order with status CRTD

    Hi gurus,
    Our system is configured to print production order when the order is released, but when the order is in status CRTD,Created, (not Released) we try print the order an error message appears "Object ORD xxxxxx has system status CRTD (Created).  According to this status, transaction 'Print order (original)' is not allowed".
    Is it possible print orders before release action?
    Thank you, I have points for the best answers.

    Through transaction  BS22 you can configure the system to Print the Order even at CRTD status.

  • Error when printing work order with iw32

    Hello all,
    When i was printing work order using IW32, the order success to be saved but it can't be printed. And i get this error message :
    Express document "Update was terminated" received from author ...
    i check with T-Code SM13, and i found error on
    PM_ORDER_PRINT_CONTROL
    further, i go check to ABAP Short dump, and found the error analysis
    A RAISE statement in the program "SAPLSFES " raised the exception
    condition "CONTROL_FLUSH_ERROR".                                
    Since the exception was not intercepted by a superior program  
    in the hierarchy, processing was terminated.
    have anyone know the OSS or have some experience to solve this problem ? hope you can help me..
    thank you for your attention..
    Regards,
    Anggara Mahardika

    Hi
    Can u let  us know whether u are trying to Save the Print out on to ur Desktop ...  or using GUI_DOWNLOAD Fm in ur program ...
    surya

  • Problems with background job

    Hi,
    I have problems when creating a job that is supposed to be run once in background. I use the common steps as described below. My problem is that the report is executed twice.
    - First it is executed synchronously when the job is created
    - Then it is executed in the normal job step as I want it to do
    I don't want it to be executed the first time because it creates data!!!
    Code:
    CALL FUNCTION 'JOB_OPEN'
         EXPORTING
              jobname  = w_jobid
         IMPORTING
              jobcount = w_jobnr
              sdlstrtdt = sy-datum
              sdlstrttm = sy-uzeit.
    SUBMIT (p_prog)
    WITH p_idocnr = p_idocno
               USER            p_user
               VIA   JOB       w_jobid
                     NUMBER  w_jobnr
                     AND       RETURN.
    CALL FUNCTION 'JOB_CLOSE'
         EXPORTING
              jobcount         = w_jobnr
              jobname          = w_jobid
              strtimmed        = 'X'
         IMPORTING
              job_was_released = w_jobrel.
    Does anyone have a clue of what I should do to prevent this?
    //  Regards  Hans

    Hi again,
    1. U are right.
    2. It will happen if we use SUBMIT.
    3. As per the help documentation,
        it will run the program in separate session,
       ( as soon as submit statement comes)
    4. and run the INITIALIZATION event.
    The VIA JOB addition also loads the program accessed in a separate internal mode when the SUBMIT statement is executed and the system performs all the steps specified before START-OF-SELECTION. This means the events LOAD-OF-PROGRAM and INITIALIZATION are triggered and selection screen processing is performed. If the selection screen is not processed in the background when VIA SELECTION-SCREEN is specified, the user of the calling program can eidit it and schedule the program accessed in the background request using the function Place in Job. If the user cancels selection screen processing, the program is not scheduled in the background job. In both cases, execution of the program executed is completed after selection screen processing and the system returns to the calling program due to the AND RETURN statement.
    regards,
    amit m.

  • Problem with background job using SUBMIT under different user

    Hi All,
    I am submitting a background job under different user name. I am submitting this job by using JOB_OPEN , SUBMIT report and JOB_CLOSE. But submit statement is returning sy-subrc 8, becuase of this the job_close is failed. Can you please help me to solve this problem.
    Thanks in advance.
    Tjgupta

    Hi,
    The user is having all authorizations. is there any difference with user types?
    This user is having  user type " as communication data".
    Thanks,
    Tjgupta

  • How to submit the report in Background job.

    Hello Friends,
    In the selection screen I have 2 radio buttons one for background Process & other for foreground processing. if the user selects the background processing the program should execute in background and output need to be sent to SAP Inbox.
    Issues:
    1) If I am using the JOB_Submit FM or Report Submit the program is going to infinite loop and many continiously jobs are are being scheduled. How to avoid.
    2) Is there any best possible way to send the mail to SAP Inbox.
    Note: I am using OOALV in my program....
    Thanks,
    Ravi

    Hi,
    the first problem looks like you have an infinite recursion. You just need to avoid background scheduling again. There is a system field sy-batch. So if this field is equal to 'X' then you are already in background mode and you don't need to schedule your background job again. Another way is to split your program in two programs. The first will be responsible for scheduling or executing the second one.
    You can use FM SO_NEW_DOCUMENT_SEND_API1 to send message to workflow inbox. You need to user receiver type B. There are so many posts on this forum about sending emails from ABAP which may help you with implementing this requirement.
    Cheers

  • Scheduling of process chain with background job

    Hello All,
                  I have scheduled the process chains through background jobs. I have copied the meta chain and created seven background jobs that is from Monday till sunday. The problem is most frequently the job gets cancelled with the message
    Process CHAIN, variant PAA1_GS001 is not scheduled waiting for event RSPROCESS 44NRPDWZ7CQUJ92ATDTY6368H.
    This is the variant for the next process after the start process. I tried by giving merge active versions, but one day the background job runs fine , but the next day it gets cancelled.
    If anyone has faced this issue before kindly let me know.
    Regards,
    Karthik.

    Hi,
    It seems to be there may be in probelm in Varients, so create a separate Varient for each PC and then activate the PC and execute.
    Thanks
    Reddy

  • Print error scheduling a background job

    HI
    I am using
    Transaction F110 – Automatic Payment.
    When I am scheduling job for printing in background,I am getting error
    The error <Status Text in spool > states front end unavailable.
    Any inputs asap pls

    You are getting the error because, the printer selected to print the output trying to use front end default printer. You might have selected LOCL as the printer. Chage the printer.
    Regards
    Sridhar

  • Regarding the output of background job in spool

    Hi Friends:
         I have a report.When I run it in foreground, it displays an alv output.
    I want to see the output when I run it in background. When I select the job & press on spool, it shows a message that no list available. Please help with the settings to see the output in spool.
    Suitable points will be rewarded.
    Regards:
    Gaurav

    Hi,
    have a look at this thread:
    Re: OO ALV in background job
    Best regards.

  • Issue with background job--taking more time

    Hi,
    We have a custom program which runs as the background job. It runs every 2 hours.
    Itu2019s taking more time than expected on ECC6 SR2 & SR3 on Oracle 10.2.0.4. We found that it taking more time while executing native SQL on DBA_EXTENTS. When we tried to fetch less number of records from DBA_EXTENTS, it works fine.
    But we need the program to fetch all the records.
    But it works fine on ECC5 on 10.2.0.2 & 10.2.0.4.
    Here is the SQL statement:
    EXEC SQL PERFORMING SAP_GET_EXT_PERF.
      SELECT OWNER, SEGMENT_NAME, PARTITION_NAME,
             SEGMENT_TYPE, TABLESPACE_NAME,
             EXTENT_ID, FILE_ID, BLOCK_ID, BYTES
       FROM SYS.DBA_EXTENTS
       WHERE OWNER LIKE 'SAP%'
       INTO
       : EXTENTS_TBL-OWNER, :EXTENTS_TBL-SEGMENT_NAME,
       :EXTENTS_TBL-PARTITION_NAME,
       :EXTENTS_TBL-SEGMENT_TYPE , :EXTENTS_TBL-TABLESPACE_NAME,
       :EXTENTS_TBL-EXTENT_ID, :EXTENTS_TBL-FILE_ID,
       :EXTENTS_TBL-BLOCK_ID, :EXTENTS_TBL-BYTES
    ENDEXEC.
    Can somebody suggest what has to be done?
    Has something changed in SAP7 (wrt background job etc) or do we need to fine tune the SQL statement?
    Regards,
    Vivdha

    Hi,
    there was an issue with LMT's but that was fixed  in 10.2.0.4
    besides missing system statistics:
    But WHY do you collect every 2 hours this information? The dba_extents view is based on really heavy used system tables.
    Normally , you would start queries of this type against dba_extents ie. to identify corrupt blocks and such:
    SELECT  owner , segment_name , segment_type
            FROM  dba_extents
           WHERE  file_id = &AFN
             AND  &BLOCKNO BETWEEN block_id AND block_id + blocks -1
    Not sure what you want to achieve with it.
    There are monitoring tools (OEM ?) around that may cover your needs.
    Bye
    yk

  • QA Approval - importing queue with background jobs

    Hi all,
    I have activated the QA approval in my system and it all works fine.  I have scheduled a background job via STMS to import the whole test system buffer each day and this works fine too. Now I want to schedule a background job to import the production buffer automatically too. This would allow us to have all approved transports automatically imported once a day (as QA approval is activated only approved transports would be imported).
    Sounds simple, but with QA approval the production buffer displays approved and non-approved requests, so the background job fails as not all transports in the buffer are in the correct status.
    Any suggestions on how I can get around this problem? 
    Thanks
    Claire.

    Hello Claire,
    This issue has been described in SAP Note 313991. please check.
    Regards,
    Debasis

Maybe you are looking for

  • Itunes will not launch after fresh install and repeated re-installs

    I've been browsing around the forums here and the support system hoping for an answer to this question. On Monday my hard drive died and I had to buy a new one. I reinstalled windows and itunes among other things. I have a brand new Video Ipod as wel

  • Add a link to the navigation / menu bar

    I would like to add a home button infront of the My Workspace button in the navigation/menu bar at the top of my Vibe page. What jsp of file should I edit to achieve this?

  • Clearing Memory and using External HD as iTunes Location

    Hi all I am having a little trouble with clearing space on my MacBook Pro (4GB Memory running Mac OS X 10.7.5). It is running slowly and often comes up with a warning message saying there's insufficinet space on the start up disk and that there is li

  • Questions in Material Ledger Currency

    Hey Gurus, I am having some problems posting documents with MIGO because Iti gives me the error message C+052 (inconsistency in valuation of material). While accessing the tcode CKM9 I see that one of the currencies is inconsistent as you can see in

  • How to create select-options for 3 fields out of 5 by FREE_SELECTIONS_INIT

    Hi Experts, I am using the Function Modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG to create the select-options dynamically on the selection screen. My problem is that I am passing a field list of 10 fields in the FIELDS_TAB of the function.