How to schedule a program in background after 5 or 10 sec

Hi All,
       Can anyone tell me how to schedule a program after 5 or 10 sec in background after the transaction is completed.
It is not a custom transaction. I want to execute a Z program in background  in a BADI
Regards
Yathish
Message was edited by:
        Yathish Gundlupet

Programattically?   You can add this code to the end of your transaction(if it is custom, of course).
report zrich_0004 .
data:   sdate type sy-datum,
        stime type sy-uzeit,
        l_valid,
        ls_params like pri_params,
        l_jobcount like tbtcjob-jobcount,
        l_jobname  like tbtcjob-jobname.
start-of-selection.
* Get Print Parameters
  call function 'GET_PRINT_PARAMETERS'
       exporting
            no_dialog      = 'X'
       importing
            valid          = l_valid
            out_parameters = ls_params.
* Open Job
  l_jobname = 'THIS_JOB'.
  call function 'JOB_OPEN'
       exporting
            jobname  = l_jobname
       importing
            jobcount = l_jobcount.
* Submit report to job
  submit <your_program_name
       via job     l_jobname
           number  l_jobcount
       to sap-spool without spool dynpro
           spool parameters ls_params
              and return.
* Kick job off 10 seconds from now.
  sdate = sy-datum.
  stime = sy-uzeit + 10.
* Schedule and close job.
  call function 'JOB_CLOSE'
       exporting
            jobcount  = l_jobcount
            jobname   = l_jobname
            sdlstrtdt = sdate
            sdlstrttm = stime
Regards,
RIch Heilman

Similar Messages

  • How to schedule BDC program in background when we use GUI_UPLOAD

    Hi,
    I need to run the BDC program in the back ground. But my flat file is in presentation server and i am using GUI_UPLOAD F.M to upload data into I.T. How to schedule BDC program in background.
    Will anybody help me in this regards.
    Thanks in advance,
    Mythily

    You will either have to put your data file on the application server or make the directory of the presentation server available as part of the file system so that the background job will have access to it via OPEN DATASET... TRANSFER... CLOSE DATASET.

  • How to schedule a report in background

    could anybody inform me
    how to schedule a report in background
    if possible plz send the entire step by step process
    thanx
    regards
    kals.

    HI,
    Use transaction SM36
    For step by step process refer this link...
    http://help.sap.com/saphelp_bw30b/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm
    Hope this helps!!
    Cheers
    Alfred

  • Write a program that would schedule another program in background multipul

    Hi All,
              I need to write a program that would schedule another program in background multipul times according to input we provided on different application servers.
    For ex:- In  table FKKVKP, i am having 2.1 millons contract accounts. I need to write a program(A) that should take 5000 contract accounts at a time as a input and schedule another program(B) in background with input of 5000 contract accounts. And program A ,again schedule program B on differrent application servers , till 2.1 millions contract accounts get used.
    Thanx in advance.
    Regards,
    Dilip Kushwah

    hi,
    1) Carry out the recording for the required transaction using SHDB.
    2) Use batch input method to create session this is done by three FMs
    bdc: open_group, bdc_insert, close_group.
    3) A session is created , which can be seen in transaction SM 35.
    4) Use the standard program RSBDCSUB to configure the session created in SM35.
    This way you can achieve your requirement.
    Check this links too for more information
    Batch input [http://help.sap.com/saphelp_nw04/helpdata/en/fa/097015543b11d1898e0000e8322d00/frameset.htm]
    [http://help.sap.com/saphelp_nw04/helpdata/en/4c/4c0e8a725311d396a80004ac96334b/frameset.htm]
    [http://help.sap.com/saphelp_nw04/helpdata/en/4c/4c0e8a725311d396a80004ac96334b/content.htm]
    Thanks
    Sharath

  • How to run a program in background and how to check the output

    I have to run my program as background job... it has a selection screen...... and i need to check the output after its complete.

    hi,
    u need to create one program for this.
    tables:btcevtjob.
    parameters:job(32).
    data:count like btcevtjob-jobcount.
    call the function modules JOB_OPEN,JOB_SUBMIT AND JOB_CLOSE
    and pass the parameters in those function modules.
    once u execute this program,
    go with sm37->provide jobname->select the option scheduled
    ->execute
    selct the entry->go with release option.
    under releasae select immediate option
    save
    select the job name again
    go with release
    status is in finished stage
    now go with spool option
    give spool no
    go for display
    o/p displayed.
    before this,go for se38->provide the name of program which u want to run in back ground->seelct variants->change->provide variant name->go for create->provide input value->go with attributes->provide description->save
    this variant name u have to give in the job_submit fm.
    or
    se38->program->execute->in back ground
    Reward points if useful,
    Thanks,
    Usha

  • How to run a program in background?

    Hi abapers,
    I want to run a program in background using sm36 and sm37.But i am not aware of input in that tansaction.So kindly tell me the steps ho run a program in background.
    Regards
    Ansuman

    Hi Ansuman Parhi,
    by useing T-codes
    First go to transaction SM36 to schedule the job.
    When you enter the "Start condition" for job, do as follow.
    Select processing by "Date/Time".
    Enter date as current date.
    Let us say you are scheduling this job today then give date 08/30/2007.
    Check "periodic job" checkbox.
    Hit "periodic value" button and select to run "Daily"
    Also have a look on below thread
    Re: How to run program in background?
    This is how to do it through code
    data: lv_job_name like tbtco-jobname,
    lv_job_nr like tbtco-jobcount,
    lv_job_released type c,
    lv_job_start_sofort type c,
    lv_print_parameters type pri_params.
    lv_job_name = 'Z_test'. " your background program name
    call function 'JOB_OPEN'
    exporting
    jobname = lv_job_name
    importing
    jobcount = lv_job_nr
    exceptions
    cant_create_job = 1
    invalid_job_data = 2
    jobname_missing = 3
    others = 4.
    if syst-subrc = 0.
    *submit job with all the selection screen params...
    submit (lv_job_name)
    with applfile = applfile
    with p_lines = p_lines
    with rfc_dest = rfcdest
    with p_selmtd = lv_selmtd
    with px_shsim = px_shsim
    with px_sherr = px_sherr
    user syst-uname
    via job lv_job_name number lv_job_nr and return.
    if sy-subrc = 0.
    call function 'JOB_CLOSE'
    exporting
    jobcount = lv_job_nr
    jobname = lv_job_name
    strtimmed = 'X'
    importing
    job_was_released = lv_job_released
    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 syst-subrc 0.
    message i162(00) with
    'An error occured while closing the background job.'.
    stop.
    endif.
    endif.
    endif.
    skip 1.
    write: / 'Background process', lv_job_name ,
    'called successfully' no-gap.
    write: / 'You can check the job in transaction SM37'.
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • Schedule Module program in Background with Dynamic Input values ?

    Hi,
    I am trying a schedule a Standard Transaction which has Month,year and other Check boxes (By default they are Empty) .I need to schedule it monthly and Input must change dynamically when I run in background each month..
    How do we do this?
    Regards
    Vara
    Message was edited by: Vara K

    You can not directly schedule a module pool program in background job.  These are usually reports.   What you can do is create a custom report program with your parameters on a selection screen.  In this program you can do a BDC over the standard transaction filling the parameters from the selection screen of the custom program.  This custom program can also have a selection screen variant which uses selection variables that will change dynamically.  Then you can schedule the custom report program via SM36.
    Regards,
    Rich HEilman

  • How to schedule another program by giving report name and variant name?

    I want to create a program for Scheduling another program using function 'FASU_V_CREATE_VARIANT_RFC'
    (FASU_V_CREATE_VARIANT_RFC : This function used for creating the variant ) by giving
    1) Report name
    2) varaint name
    Could anybody please help me.??

    Scheduling Background Jobs 
    Use
    You can define and schedule background jobs in two ways from the Job Overview:
    Directly from Transaction SM36. This is best for users already familiar with background job scheduling.
    The Job Scheduling Wizard. This is best for users unfamiliar with SAP background job scheduling. To use the Job Wizard, start from Transaction SM36, and either select Goto ® Wizard version or simply use the Job Wizard button.
    Procedure
    Call Transaction SM36 or choose CCMS ® Jobs ® Definition .
    Assign a job name. Decide on a name for the job you are defining and enter it in the Job Name field.
    Set the job’s priority, or "Job Class":
    High priority: Class A
    Medium priority: Class B
    Low priority: Class C
    In the Target server field, indicate whether to use system load balancing.
    For the system to use system load balancing to automatically select the most efficient application server to use at the moment, leave this field empty.
    To use a particular application server to run the job, enter a specific target server.
    If spool requests generated by this job are to be sent to someone as email, specify the email address. Choose the Spool list recipient button.
    Define when the job is to start by choosing Start Condition and completing the appropriate selections. If the job is to repeat, or be periodic, check the box at the bottom of this screen.
    Define the job’s steps by choosing Step, then specify the ABAP program, external command, or external program to be used for each step.
    Save the fully defined job to submit it to the background processing system.
    When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.
    Note: Release the job so that it can run. No job, even those scheduled for immediate processing, can run without first being released.
    For a simple job scheduling procedure, see the R/3 Getting Started Guide.

  • How to run the program in background job,program should run in 3 days.

    Dear Gurus,
    i have a program , that program should run approximately 3 days to get the result.
    i scheduled this program as a background job.
    how can i run sto5 t-code for this same program.
    i that case how we can trace the output.
    Experts please help me out.
    Thank u very much.
    Regards
    sudheer

    Hello Sudheer,
    The trace can be set on background jobs by using ST12 transaction. Please make sure that the trace is activated for only few minutes in production environment.
    Contact your basis team to activate trace on background job and the transaction used is ST12.
    Thanks

  • How to schedule a program for download a file to Presentation Server

    hi all,
    I need to schedule a program which will download a file to presentation server. How can i handle this or is there any other to download a file during scheduling?
    Points will be rewarded
    Thanks in advance

    Hi Jayasree,
    You can download your file to application server in background scheduling.
    In your program use OPEN DATASET command for achieving this.
    How ever, as far as i know, it is not possible to download the file to presentation server in background job.
    regards,
    G@urav.

  • How to validate a program in background

    hello folks,
    i need to validate my program, my program should run only in background
    in case if it runs in foreground it should give error message. how to validate my
    program.
    can any one just tell the procedure how to do it.
    any help will be greatly appreciated,
    thanks in advance.
    regards,
    cnu

    Hello CNU,
    following snippet should do.
    Regards
      Klaus
    if ( 'X' ne sy-Batch ).
      message e000 with 'Only in Batch'(BTC).
    endif.

  • HI HOW TO DEBUGGING A PROGRAM IN BACKGROUND

    HI
    HOW TO DEBUGG A PROGRAM IN BACK GROUND

    Go to SM37 and check the spool there. You can find your
    output there. If you want to debug the program then first put a
    break point in your program after finishing of the execution of
    the job, then select the job in SM37 and enter JDBG in
    command prompt and press enter. It will go to debug mode. It
    is equivivalent to /H which we will enter while debugging in
    foreground

  • How tu run the program in background

    Hi SapAll.
    actually iam new to ABAP ,i just want to know on how i can run the particular program  in background .
    can any one explain me in steps .
    i also want to know on how to delete the particular job which has been already created in sm36 .
    will be waiting for best response.
    regards.
    Varma

    Hi
    Find the below steps to be defined.
    1. Go to SM36 -
    > Give the Program Name
    2. If you have priority defined that to in Job class
    3. Click -
    > Start Condition
    4. Select Data/Time Tab
    5. Give the Date and Time for the job execution. (If you want to certain intervale provide it)

  • How to schedule JAVA program as scheduled Job on portal 7.0 server ?

    Hi,
    Can you let me know on how do we schedule JAVA program as a scheduled job to run daily on portal 7.0 server ?
    Thanks,
    Vinit Pugaliya

    Am not clear on that,
    check this
    https://ecohub.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/abb91c2a-0b01-0010-6ca6-9f0f62268454 [original link is broken]
    Am also new and now going through Job scheduler.
    Will let u know if i get to knwo any thing more abt same.
    Regards,
    Ravi

  • How to debug the program in background

    hi
    how to debug the program in background

    Hello everyone,
    I often debug my programs via the sm50 transaction and it works very well (especially when you put the dummy loop ^ - ^ ). However we are confronted to a major problem when more than one user tries to debug. We get a message saying that the maximum number of users in the debugging mode has been reached!! Thus we each have to wait for our turn to debug our program. It's a real pain.
    We've searched for a parameter to configure the number of users for the debugging mode but in vain
    Has anyone else had this kind of problem? If yes, what do I need to do to correct it?
    Any suggestion would be helpful as I am new to BW.
    Thank you beforehand.
    Regards,
    Dimple

Maybe you are looking for

  • Determination of Production Order Type when Planned Order is Converted

    Hi SAP Expert, Is there anyway to determine the Production Order type by Sales Order type when the planned order from APO is converted? Currently, all the planned orders converted from APO will be a Normal Production Order. The requirement as example

  • How to enable Logon Help link in Login Page?

    Hi, I need to implement the logon help like forgot password / password reset...in the portal login page the link is not showing...what to do to enable this Login Help Link in Portal login page? can you please guide me on this... Regards, Viswes

  • I want to relinquish the remaining balance in iTunes

    Hi I want to relinquish the remaining in my account so that I could change the expense of the British to the U.S.

  • To MBA 2013 i5 users: What is the battery life?

    Hey guys, there are some hot discussions over battery life in MBA 2013 with i7. I personally own one and I can say that 12 hours is nothing close to the truth. Battery life can reach that long when WiFi is turned off, but web browsing is the most bas

  • Inventories issues

    Hi All Guru's this issue regarding inventory..... t.code f.01  no: xxxxxxxx (raw material, finished goods, sami-finished goods is there) i need report like list of meterials , Qty, Value... we can see meterial and value using tcode fbl3n, but cleint