How to delay background processing

Hi,
I am writing a submit statement in the Delivery Order exit USEREXIT_SAVE_DOCUMENT_PREPARE. It triggers on saving the Delivery.
The submit statement calls my Z Program in background (Im using Job Open and Job Close).
My requirement is that once the submit statement is executed, the cursor should come back to my driver program (User exit) and save the delivery document.
The background Z program should get triggered after say 5 minutes only on the condition that a delivery document exists for the particular delivery.
Could someone tell me how to write the SUBMIT statement to send my z program in background and ask it to start/release after a lag of 5 minutes.
Thanks & Regards,
Shobhit

Hi Shobhit,
  Try the below way. Pass what time you want to start the
  job(time & Date ) to job close.
IF V_DATE > SY-DATUM OR
     ( V_DATE = SY-DATUM AND V_TIME >= SY-UZEIT ).
    CALL FUNCTION 'JOB_CLOSE'
         EXPORTING
              JOBCOUNT             = V_JOBNUMBER
              JOBNAME              = V_JOBNAME
              SDLSTRTDT            = V_DATE
              SDLSTRTTM            = V_TIME
              TARGETSYSTEM         = SY-HOST
         IMPORTING
              JOB_WAS_RELEASED     = V_REL
         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.
Dynamically if you want to give option to user when to
schdule job use the below and pass the particular time and date.
CLEAR I_HELPVAL.
  REFRESH I_HELPVAL.
  I_HELPVAL-LENGTH = 8.
  I_HELPVAL-KEYWORD = 'DATE ( YYYYMMDD )'.
  I_HELPVAL-VALUE = SY-DATUM.
  APPEND I_HELPVAL.
  I_HELPVAL-LENGTH = 6.
  I_HELPVAL-KEYWORD = 'TIME ( HHMMSS )'.
  I_HELPVAL-VALUE = SY-UZEIT.
  APPEND I_HELPVAL.
  CALL FUNCTION 'HELP_GET_VALUES'
       EXPORTING
            POPUP_TITLE = 'Batch Job - Enter Date and Time'(023)
       IMPORTING
            RETURNCODE  = V_REL
       TABLES
            FIELDS      = I_HELPVAL
       EXCEPTIONS
            NO_ENTRIES  = 1
            OTHERS      = 2.
Hope this is useful.
Thanks&Regards,
Siri.

Similar Messages

  • How to run background process with web application

    Hi,
    I have a web application , a servlet. I would like to have a background process that collecting data for my servlet.
    How can I achieve this? can someone point me to a tutorial or example?
    Also, would it be possible to share an object between the background process and myservlet?
    Thanks,

    Thanks for the idea.
    I had the background process running. :)
    But I'm still do not understand this part to share an object such as Java Map (<id,myobject>), what do you mean by "task a property of my ServletContextListener" ?
    BalusC wrote:
    If you make the task a property of your ServletContextListener implementation and put the implementation in the application scope, then you can access it from any servlet.Do you mind explain to me a bit more I'm still fairly new with this or maybe if you know an example.
    Here's my code snippet so far. How can I share myList to MyServlet?
    public class MonitorTimer extends TimerTask
           private Map<String, Channel> myList;
         @Override
         public void run()
              System.out.println("Monitor Timer times up");
              //Clear the map before fill with the new data
              if(myList!= null)
                   myList.clear();
              loadConfig();
            private void getData()
               //fill myList with data
    public class MyContextListener implements ServletContextListener
         @Override
         public void contextDestroyed(ServletContextEvent arg0)
              // TODO Auto-generated method stub
         @Override
         public void contextInitialized(ServletContextEvent arg0)
              System.out.println("Context Initialized");
              Timer timer = new Timer();
              //Run MonitorTimer every 2 minutes
              timer.scheduleAtFixedRate(new MonitorTimer(), 10*1000,2*60*1000);
    public class MyServlet extends HttpServlet implements Servlet
         @Override
         public void destroy()
              // TODO Auto-generated method stub
              super.destroy();
         @Override
         protected void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException
    }Thank you so much for your help,
    Edited by: geek.shrek on Nov 4, 2009 1:50 PM

  • How to delay the process?

    Hi,
      I am doing file to idoc scenario. When bulk of files came XI is picking all the files at the same point of time and sending to SAP system.  In SAP system all IDOCs are not processing. So how to slow down the processing or how to make sequential processing.
    regards,
    Ansar.

    Hi,
    in this book you will find how to use EOIO (exactly once in order) for IDOCs
    and also how to do pseudo IDOC queues in XI
    <a href="/people/michal.krawczyk2/blog/2006/10/11/xi-new-book-mastering-idoc-business-scenarios-with-sap-xi"><b>Mastering IDoc Business Scenarios with SAP XI</b></a>
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Background processes in RAC

    Hi,
    I am new to RAC , so i want to know how all additional background processes in RAC works ?
    Enviornment : oracle 10g release 2 with RAC , OS : HP-ux 11i

    Hi,
    Read the following doc's:
    http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/toc.htm
    http://download.oracle.com/docs/cd/B19306_01/rac.102/b28759/toc.htm
    Regards

  • How to Create Excel File in Background processing with different colors

    HI All
    I am trying to create Excel file in background & send it to user through e-mail, this i could acheive using fucntion module SO_DOCUMENT_SEND_API1, but here my requirement is i want to put different colors to columns of excel & this should happen in Background processing,
    Initially i completed above requirement by using HTML type of document with attachment type 'ALI'  & formatted output using write statement & used colors, after that i took this o/p using save_list function module & then table compress...etc.
    but i don't know how to achieve same if we need o/p in excel as size of object of excel file is less than that of HTML
    I am thankfull to everybody who will help me.
    Regards
    Lokesh

    Lokesh,
    Iam also trying to populate my text file with colors as an attachment . If you know this please let me know.

  • Background Processing? how schedule job for "System Error" Message .

    Hello everyone,
    in sap help i have read.
    http://help.sap.com/saphelp_nw04/helpdata/en/5a/f72040599a8f5ce10000000a155106/frameset.htm
    PCK> Monitoring>Message Monitoring-->Background Processing
    you can schedule jobs for various background processing:
    ●     Archiving of messages processed successfully
    ●     Deletion of messages that are not to be archived
    ●     Restarting of messages with errors
    ●     Rescheduling of lost messages
    can anyone understand this docu?
    give me some introduction, how can i define and schedule these jobs ?
    thx in advance!!
    best regards
    Yaning

    Background Processing
    Prerequisites
    You have started the message monitor on the initial screen of the PCK and are in Background Processing.
    Features
    Archiving
    You require two archiving sessions to archive messages:
    ●     One session to write the messages to the archive
    ●     One session to delete the persisted messages that have been archived
    To do this, you schedule an archiving job, which implicitly schedules the sessions to write to the archive and delete the archived messages.
    You can define one or more rules for each archiving job; these rules contain conditions that a message must meet in order to be archived by the job. At least one of the defined rules must be met for archiving to take place.
    All information that is displayed for a message in message monitoring is archived, in addition to the audit log for each message.
    Deleting
    A standard delete job is created automatically. It runs once a day. You can schedule additional delete jobs; however, you cannot define rules for them.
    Restarting
    Instead of restarting messages with errors manually with message monitoring, you can schedule a job to automatically restart these messages. This is possible for all messages for which the number of defined restart attempts has been exceeded (messages with the system error status).
    You can define one or more rules for each job to restart messages; these rules contain conditions that a message must meet in order to be restarted by the job. At least one of the defined rules must be met for archiving to take place.
    Rescheduling
    A standard job to reschedule messages is created automatically. The job runs once a day and ensures that messages lost as a result of database failure, for example, are rescheduled. You can schedule additional rescheduling jobs; however, you cannot define rules for them.
    Thx Aamir.
    But I mean the messages with errors in Adapter Engine , not in Intergrations Engine.
    the situation is like Naveen Pandrangi's WebLog
    II. Errors in Adapter Engine [XI :  How to Re-Process failed XI Messages Automatically|XI :  How to Re-Process failed XI Messages Automatically]
    I
    Till now we have seen how to resubmit/restart message that failed in Integration Engine.  One a message makes it from Integration Engine to Adapter Engine, the message is flagged as checked in Integration Engine. The status of the message in Adapter engine does not effect the processed state in Integration Engine. Now if this message was asynchronous, XI will by default try to restart the message 3 times at intervals of 5 minutes before the status of the message is changed from Waiting to System Error .
    *how can i schedule a job to automatically restart these messages with errors?
    best regards
    Yaning
    Edited by: Yaning Liu on Aug 18, 2008 1:43 PM

  • How can I run a method as a background process?

    Hello,
    I am currently working on a report where depending on the number of items selected, the user may choose to process all the items right now or as a background process.
    How can I do that in ABAP?
    Thanks

    To run a job in the background it has to be scheduled as batch job. You would usually do that using transaction SM36. As I understand your problem you want to schedule such a job directly from your coding. You may want to have a look at function group BTCH. It overs quite a few FMs to programmatically add a batch job.
    regards
    Daniel

  • How to deploy an app with servlet and background processing

    i have a servlet with background processing. it has to run 24 hours a day.
    but i have problem with shutdown (after 1-2 hours without user action). [9iAS 9.0.3.0, windows 2000]
    i created for application seperate OC4J (in the EM) and i deployed it there. first time as war file, later as ear file (because there is possible to re-deploy only ear file).
    but it seems that the servlets are not designated to run as a uninterruptible task.
    the question is: how to deploy such (servlet + uninterruptible background processing) application in the 9iAS?
    a) everything in the OC4J (then how to disable shutdown?)
    b) servlet in the OC4J. where (and how) to install the rest of application?
    b1) servlet in the OC4J + rmi/soap/... + standalone server?
    what is the standard in the oracle world :) ?
    thanks

    Better to post your topic in the iPad in the Enterprise community.
    This is the, "Using Mac App Store" forum and for the most part for troubleshooting the App Store.

  • How to trap warning messages generated from the background processing?

    Hi all,
    Following is my requirement, i want to know whether it can be done and how?
    The credit management (CM) warning messages generated as a result of the CM background processes, where do the messages go? Can you trap them and include them in an interface control report?
    Thanks

    Hi
    If it's created a job for that process, you can try to read the log: here you should find all triggered messages, so the warning ones too.
    U can try to use fm like BP_JOBLOG_READ or BP_JOBLOG_SHOW in order to get the log.
    Max

  • How to run a background process in a J2EE App ?

    Hi guys,
    Here is the requirement which totally stumped me.
    " The web app should have a feature like a background process or something like cron jobs.. which keeps on running in the background and at a particular time each day calls a method". User intervention is not an option.
    Now had this been a stand alone app .. I could have done this using Threads.. but i cant possibly use threads in a J2EE app. Any pointers.. how I can go about realizing this
    Thanks for your replies.
    Cheers!

    You could take the approach that SoulTech mentioned and spawn a new thread from the Servlet's init method. To have the servlet invoke this method with no intervention, you would need to set the following parameter in your servlet definition in your web.xml:
    <servlet>
      <servlet-name>MyStartupServlet</servlet-name>
      <servlet-class>com.my.company.MyStartupServlet</servlet-class>
      *<load-on-startup>1</load-on-startup>*
    </servlet>When you deploy your application, the servlet will be loaded, and its init method will be called.
    If your application is running in a servlet container, I believe you are allowed (by the specification) to spawn your own threads, but you should do so carefully. Since you're writing a scheduler and not some kind of worker threads that are messing with your database, I think you should be okay. Still, just to keep it clean you should add any clean-up logic you may need to your servlet's destroy method. I know that in an EJB container, spawning your own threads can definitely be a problem and the container makes no guarantees that they will function correctly. The J2SE Timer class could be used if you're not using EJB, but the Timer class doesn't have support for J2EE - that's at least part of what led to the introduction of the timer beans in J2EE 1.4. If you're already using EJB, especially EJB 3.0, then the timer service provides a convenient built-in mechanism to do exactly what you want.
    There are always multiple ways to solve any problem...
    Edited by: proflux on May 15, 2008 1:04 PM

  • How can we use cl_gui_html_viewer      in a background process.

    Hello,
    Refering to this thread: Pie chart using Class cl_igs_chart ??
    How can we use cl_gui_html_viewer     in a background process.
    I want to execute a html code in bakground process in abap program.
    but using cl_gui_html_viewer   I have an error with CNTL_ERROR in the method CONSTRUCTOR;
    Thanks

    Marie,
    I don't know about HTML viewer specifically, but whenever a GUI object is needed to be used in background, there is a standard method to avoid CNTL_ERROR.
    When a program runs in background, there is no "screen" and hence no GUI, and hence a custom control can not be displayed. That is why the program generates an error.
    The trick is to avoid creating the custom control in background.
      if sy-batch = 'X'. "background mode
    *   We don't want to create the custom control
      else. "dialog mode
        create object l_container exporting ...
      endif.
    * We really don't need a container for using CL_GUI_ objects
    * Proceed with the normal coding
      create object l_html_viewer
      exporting
        parent = l_container

  • Delays in ECC async background processing

    Hi all,
    Has anyone dealt with delays in ECC async background processing?  On our development system the delays are running in the 3-20 second range.
    I  have a BLS transaction that
    1.  Creates a Time Ticket for operation confirmation
    2.  Does COWBPACK to create handling units for packing
    3.  Does COWBHUWE to do a goods receipt
    I had to put a retry loop in #2 to wait for the Time Ticket to update the yield on the operation
    I also had to put a retry loop in #3 to wait for an application lock to be released (by the time ticket create?)
    Then I had to put a check/retry loop at the end to wait for the delivered qty on the order header to get updated after the goods receipt.
    Is there a way to request synchronous transactions?
    Any insights as to why this is happening and/or a better way to handle the situation would be greatly appreciated.
    --Amy Smith
    --Haworth

    Hi Salvatore,
    A single custom Function Module...  So the delays would be inside the BAPI in the ECC.  This would certainly be more efficient.  I will kick this around with our ABAP consultant.
    Thanks,
    --Amy Smith
    -- Haworth
    Just FYI: After the BAPI_PRODORDCONF_CREATE_TT (create time ticket) we are running custom BDC function modules to do COWBPACK and COWBHUWE   Which are create handling units and goods receipt.  Here is what I believe is happening from the error messages I see.  Handling Units need to wait until the yield is updated.  Goods receipt needs the application lock on the production order.

  • How to make a j2me application as a  background process

    HI,
    In my project,I am connecting to the webserver(Google,Yahoo).
    I wrote one socket program for connecting to those server through 80 port.
    I am able to send the request from browser(desktop) and getting the response from the server and displaying it in the browser(desktop).
    Now i want to install this application in mobile.After installing the application in the mobile,i need to go back to the browser in the mobile.
    can anyone tell me how to do this?Is it like running a background process?
    I dont have any idea about background process in j2me?
    Thanks a lot

    Now i want to install this application in mobile.After installing the application in >the mobile,i need to go back to the browser in the mobile.
    can anyone tell me how to do this?Is it like running a background process?what does that mean ?

  • How do I run a background process which is under WLE control

    Hello folks:
    How can I run a background process that runs under WLE's control.
    What I am looking for is a way to have a process that runs in an
    infinite loop and polls the database to see if there is any background
    work that needs to be done. But I still want the process to be managed
    by WLE for fault tolerance.
    Thanks,
    Ram Ramesh
    [email protected]

    The easiest way to do this is to write a Tuxedo server (i.e., using only
    ATMI and no CORBA stuff) that does the following:
    1.) In tpsvrinit(), the last thing that it should do is a tpacall to the
    service contained in this server (and nowhere else) with the TPNOREPLY
    flag.
    2.) In the method that implements the service, do your database work, sleep
    for a little while, do another tpacall to itself with the TPNOREPLY flag,
    and return.
    Hope this helps,
    Robert
    Ram Ramesh wrote:
    Hello folks:
    How can I run a background process that runs under WLE's control.
    What I am looking for is a way to have a process that runs in an
    infinite loop and polls the database to see if there is any background
    work that needs to be done. But I still want the process to be managed
    by WLE for fault tolerance.
    Thanks,
    Ram Ramesh
    [email protected]

  • Background Processes cause delays

    Hi --
    First off, I want to state that I've spent hours looking over info about this topic in both the Adobe Forums and at the Creative Cow forums. So I finally think I have a handle on what's going on...but the situation still hasn't improved. I need some quick answers here or I'm going to toss my computer out the window.
    Here's the problem:
    Whenever I RAM preview, the AE info panel ALWAYS says "Background Process Status Loading Projects..." It does this no matter what. This can often take ten to fifteen seconds. It's a major time-killer. I have tried multiple configurations in the Memory & Multiprocessing prefs and I always get this problem. What gives?
    It should be noted that my project file is large (40MB). I still get this message in smaller project files, but it stays up for less time (often only a few seconds).
    How can I fix this?
    P.S. Another annoyance is that the project always saves whenever I RAM preview. Another time-killer.
    Thanks!
    Here's my Computer:
    Mac OS X 10.6.2
    2 x 2.66 GHz Quad-Core Intel Xeon
    16 GB 1066 MHz DDR3
    Here's my AE Memory & Multiprocessing prefs:

    This also drives me CRAZY!
    Especially with big 'projects'.
    It halts the system for about 30seconds (and I'm on a 12core with 48gb ram!)
    I really dont understand Adobe. You make great stuff but do you ever test it yourself?
    If you are a programma, and you encounter  this in a production, you will go mental.
    Same for the rendering in Multicore, and suddenly for no reason (or some plugin is singlecore only) the rendering drops to 1 core, the system because unusable. Everything stalls, the rendering takes ages! This happens on 4 macpro's with all latest SL and AE updates!
    Still the same old problems like CS4. Please make it better!

Maybe you are looking for

  • Report and data comming wrong after compress data with full optimization

    In SAP BPC 5.1 version to increase the sysetm performance we did full optimization with compress data. Theis process end with error, after login into system the report and values comming wrong, What is the wrong,how to rectify it Regards prakash J

  • ORA-06510 error in portal install

    The portal install fails at 50% and the following is from the portal install.log: ORA-06510: PL/SQL: unhandled user-defined exception Errors encountered in the Install process. Installation Aborted.

  • How to create a table of contents (TOC) linking to specific pages of different (multiple) PDFs

    Hi All, I would like to create clickable Table of Contents (TOC) that can lead to a sub clickable TOC that would lead to a specific page of different PDFs within a folder. Is that possible? Secondly, is is possible to create a search box that upon ty

  • Cursor behavior in CAD - UCCX

    UCCX version 9.0.2.11001-24 Agent Desktop 9.0.2.1063 We recently upgraded from version 5.0 to the new version.  Since then, agents have complained that when they receive a skill call, the CAD window takes control of the mouse from whatever they were

  • Support multiple languages in ESS-Portal (Webdynpro)

    Hi, We are customizing ESS and Portal using Webdynpro.  I have couple of questions here: A. ESS can support multiple languages but requires language configuration, where I need to do that? B.  We are implementing ERP04 ESS (Webdynpro services) there