Background Job call from a program

Hi all,
We have a program which runs for max of 5 minutes (say).
It is scheduled to run every minute in SM36 so that it keeps continuing to run.
But sometimes even when the previous job is running the one starts up, thereby creating inconsistent results.
So we need to call the job from the running program itself.
How should we go abt this ? Is there any other way available to solve this ?
Thanks in Advance,
Regards,
Vivek K

Hi,
Managing Jobs from the Job Overview
Use
The Job Overview, or Job Maintenance, screen is the single, central area for completing a wide range of tasks related to monitoring and managing jobs, including defining jobs; scheduling, rescheduling, and copying existing jobs; rescheduling and editing jobs and job steps; repeating a job; debugging an active job; reviewing information about a job; canceling a job's release status; canceling and deleting jobs; comparing the specifications of several jobs; checking the status of jobs; reviewing job logs; and releasing a job so it can run.
Procedures
Specifying Jobs
To display the Job Overview screen, choose CCMS ® Jobs ® Maintenance or call Transaction SM37. Before entering the Job Overview screen, the system first displays the Select Background Jobs screen, where you must select the criteria for the jobs you want to manage. These criteria include:
Job name (which can contain a wildcard (*) to select jobs with related names oru2014by using the wildcard aloneu2014any job). Required.
Name of the user who scheduled the job (the wildcard is allowed here as well). Required.
Job status
Planned or actual start time of the job.
Job start condition or event linked to the start condition
Job step
When and how often the job runs, or " periodicity"
You can also choose Extended Job Selection, where you can more precisely define the specific criteria that determine which jobs to select. If you have administrator Authorizations for Background Processing, you can display jobs in all clients. Without this authorization, only jobs in the client that you are logged on to will be displayed.
Once you have set the criteria for you job selection, choose Execute.
Managing and Monitoring Jobs
Once you have called the Job Overview screen (Transaction SM37 or CCMS ® Jobs ® Maintenance) and selected which jobs you want to manage as described above, you can choose from a wide range of management tasks.
To copy a single existing job, choose Job ® Copy.
To reschedule or edit job steps or attributes of a single job, choose Job ® Change. A job step is an independent unit of work within a background job. Each job step can execute an ABAP or external program. Other variants or authorizations may be used for each job step. The system allows you to display ABAP programs and variants. You can scan a program for syntax errors. You can also display the authorizations for an authorized user of an ABAP job step.
To repeat a single job, choose Job ® Repeat scheduling.
To debug an active job, choose Job ® Capture: active job. Only a single selection is allowed. If an active job seems to be running incorrectly (e.g., running for an excessively long time), you can interrupt and analyze it in debugging mode in a background process, and then either release it again or stop it altogether.
You will be able to capture a background job only if you are logged on to the SAP server on which the job is running. To find server information in the Job Overview, select and mark the job, then choose Job ® Job details.
To review information about a job, choose Job ® Job details. Details displayed can include:
current job status
periodicity, or the repetition interval
other jobs linked to the current job, either as previous or subsequent jobs
defined job steps
spool requests generated by the current job
To cancel a job's "Released" status, select the job or jobs from the Job Overview list and choose Job ® Release -> Scheduled.
To cancel a job from running but keep the job definition available, select the job or jobs from the Job Overview list and choose Job ® Cancel active job.
To delete a job entirely, select the job or jobs from the Job Overview list and choose Job ® Delete. Jobs with the status of Ready or Running cannot be deleted.
To compare the specifications of more than one job, select the jobs from the Job Overview list and choose Job ® Compare jobs.
To check the status of jobs, select the job or jobs from the Overview Job list and choose Job ® Check status. This allows you to either change the job status back to Planned or cancel the job altogether. This is especially useful when a job has malfunctioned.
To review job logs, select a job or jobs with the status Completed or Canceled from the Job Overview list and choose Goto ® Job log.
To release a job so it can run, select a job from the Job Overview list and choose Goto ® Release.
Regards,
Jagadish

Similar Messages

  • How to cancel the background job processing in ABAP programming?

    Hi,
    I have a requirement where i need to cancel the job depending on some constraint. My code is something like this:
    Select some data from the table.
    if sy-subrc = 0.
    Do nothing.
    Else
    Cancel the job
    call function 'BP_JOB_ABORT'
      exporting
       jobcount                         = number
        jobname                          = name
    EXCEPTIONS
       CHECKING_OF_JOB_HAS_FAILED       = 1
       JOB_ABORT_HAS_FAILED             = 2
       JOB_DOES_NOT_EXIST               = 3
       JOB_IS_NOT_ACTIVE                = 4
       NO_ABORT_PRIVILEGE_GIVEN         = 5
       OTHERS                           = 6
    The above code is cancelling the job but it is throwing an exception called CX_SY_DYN_CALL_PARAM_MISSING because i dint pass job count. How can we find the job count of next job that is going to run? Or How to handle the exception which it is throwing. Even if i try to handle that exception something like this:
    TRY
    call function 'BP_JOB_ABORT'
      exporting
       jobcount                         = number
        jobname                          = name
    EXCEPTIONS
       CHECKING_OF_JOB_HAS_FAILED       = 1
       JOB_ABORT_HAS_FAILED             = 2
       JOB_DOES_NOT_EXIST               = 3
       JOB_IS_NOT_ACTIVE                = 4
       NO_ABORT_PRIVILEGE_GIVEN         = 5
       OTHERS                           = 6
    RAISE EXCEPTION TYPE CX_SY_DYN_CALL_PARAM_MISSING.
    CATCH
    CX_SY_DYN_CALL_PARAM_MISSING.
    ENDTRY.
    It avoids the exception but it doesnt cancel the job.  I even tried with function modules like JOB_OPEN
    JOB_SUBMIT,BP_JOB_SELECT,BP_JOB_ABORT and tried to build some logic using status overview table (TBTCO) and TBTCP (Jobstep overview table).
    Can someone suggest me the right way to write this program ?
    Thanks in advance.
    Rashmi

    Hi,
    Problem is solved.
    Create an background job with 2 steps. The first step in the background job calls the program ZBACKJOB_STEP1.  In the variant we have a wrong material number
    If the material number is not found in Mara, the next step in the job should not get executed and the job should get cancelled..
    In the above posts i had asked how do I get the job count of the job that is currently triggering the program at the runtimeu2026..If u see the below code uu2019ll get to know.. We have to use the standard structure TBTCM which captures the properties/characteristics of the job.
    REPORT ZBACKJOB_STEP1.
    TABLES: MARA,TBTCM.
    PARAMETERS : MATNR TYPE MATNR.
    START-OF-SELECTION.
      SELECT SINGLE * FROM MARA WHERE MATNR = MATNR.
      IF SY-SUBRC IS INITIAL.
        WRITE / : 'This is the material selected on the selection-screen' , MARA-MATNR.
    ELSE.
            CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
          IMPORTING
            EVENTID                                    = TBTCM-EVENTID
            EVENTPARM                             = TBTCM-EVENTPARM
            EXTERNAL_PROGRAM_ACTIVE = TBTCM-XPGACTIVE
            JOBCOUNT                                = TBTCM-JOBCOUNT
            JOBNAME                                  = TBTCM-JOBNAME
            STEPCOUNT                              = TBTCM-STEPCOUNT
          EXCEPTIONS
            NO_RUNTIME_INFO                    = 1
            OTHERS                                     = 2.
        IF SY-SUBRC = 0.
          CALL FUNCTION 'BP_JOB_ABORT'
            EXPORTING
              JOBCOUNT                                     = TBTCM-JOBCOUNT
              JOBNAME                                       = TBTCM-JOBNAME
            EXCEPTIONS
              CHECKING_OF_JOB_HAS_FAILED  = 1
              JOB_ABORT_HAS_FAILED              = 2
              JOB_DOES_NOT_EXIST                   = 3
              JOB_IS_NOT_ACTIVE                      = 4
              NO_ABORT_PRIVILEGE_GIVEN       = 5
              OTHERS                                         = 6.
          IF SY-SUBRC <> 0.
          ENDIF.
        ENDIF.
      ENDIF.
    Regards,
    Rashmi

  • How to find Background job which is running program RSWUWFML2

    Hi Experts, i am trying to find which background job is running standard program 'RSWUWFML2', anyone can help on this?

    Go to SM37. Put * in the Job name and user name. The enter the program name in the last field.
    this should give you the job scheduled or running.

  • Submitting background jobs using an excecutable program

    Hi all
    Would anyone give an example program to submit jobs in background using job_open, job_submit, job_close F.M's,
    please dont give complex coded program,  easily understandable code with some useful comments will be apprecieated.
    Thanks

    Create a job using job_open
    Create your job with JOB_OPEN. The module returns a unique job
    number. Together with the jobname, this number identifies the
    job. Other parameters are available, but are not required.
    JOBNAME = 'Freely selectable name for the job(s) you create'.
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
    JOBNAME = JOBNAME
    IMPORTING
    JOBCOUNT = JOBNUMBER
    EXCEPTIONS
    CANT_CREATE_JOB = 01
    INVALID_JOB_DATA = 02
    JOBNAME_MISSING = 03
    OTHERS = 99.
    IF SY-SUBRC > 0.
    <Error processing>
    ENDIF.
    Adding job step
    Add a job step: ABAP program
    CALL FUNCTION 'JOB_SUBMIT'
    EXPORTING
    AUTHCKNAM = SY-UNAME " Runtime authorizations
    " user
    JOBCOUNT = JOBNUMBER " Value from JOB_OPEN
    JOBNAME = JOBNAME " Value from JOB_OPEN
    REPORT = 'REPORT' " Report to be run
    VARIANT = 'VARIANT' " Variant to use with
    " report
    PRIPARAMS = USER_PRINT_PARAMS " User printing options
    ARCPARAMS = USER_ARC_PARAMS " User archiving options
    " Both sets of options
    " come from
    " GET_PRINT_PARAMETERS
    EXCEPTIONS
    BAD_PRIPARAMS = 01
    INVALID_JOBDATA = 02
    JOBNAME_MISSING = 03
    JOB_NOTEX = 04
    JOB_SUBMIT_FAILED = 05
    LOCK_FAILED = 06
    PROGRAM_MISSING = 07
    PROG_ABAP_AND_EXTPG_SET = 08
    OTHERS = 99.
    IF SY-SUBRC > 0.
    <Error processing>
    ENDIF.
    **Closing job
    Submit job for processing: immediate start
    CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
    JOBCOUNT = JOBNUMBER " Job identification: number
    JOBNAME = JOBNAME " and name.
    STRTIMMED = 'X' " Schedules the job for
    " immediate start. The job
    " is started immediately
    " only if the user has the
    " RELE authorization to
    " release a job to run.
    IMPORTING
    JOB_WAS_RELEASED = JOB_RELEASED " If user has authorization
    " to release jobs to run, job
    " is automatically released
    " when it is scheduled. This
    " field is set to 'x' if the
    " job has been released.
    " Otherwise, the job is sche-
    " duled but must be released
    " by an administrator before
    " it can be started.
    EXCEPTIONS
    CANT_START_IMMEDIATE No longer used. Replaced by IMPORTING
    parameter JOB_WAS_RELEASED.
    INVALID_STARTDATE = 01
    JOBNAME_MISSING = 02
    JOB_CLOSE_FAILED = 03
    JOB_NOSTEPS = 04
    JOB_NOTEX = 05
    LOCK_FAILED = 06
    OTHERS = 99.
    IF SY-SUBRC > 0.
    <Error processing>
    ENDIF.
    *Please note it's not my original code..I have done what you could do!! Just visited help.sap.com and typed Background jobs and got sample codes..

  • Triggering background job event from Unix script

    Hi all,
      I am having one question regarding triggering of background job in SAP using Events from Unix script. Is this possible? If so, can anyboy provide some sample code related to Unix script and how do we communicate to SAP from Unix system. Actually, here the backend of R/3 system is MSSQL. I am having a program in R/3 system which is scheduled as a background job based upon event trigger. I want to trigger that even from the unix script.
      Appreciate for your help in advance.
    Thanks,
    Adithya K

    Hi,
    Check if this can help you
    http://help.sap.com/saphelp_sm32/helpdata/en/fa/096e6b543b11d1898e0000e8322d00/content.htm
    Regards,
    Atish

  • How to edit a program dynamically called from another program

    Hi all,
    Can anyone help me in coding for a program which call's another
    report dynamically from selection screen(for instance z_dynam_called)
    and retreive the whole content of the dynamically called program(z_dynam_called)
    into an internal table and replace the contents of the internal table  with some new code and put it back in z_dynam_called and save it.
    Thanks in advance.
    Needful will be rewarded with points

    Hi,
    Follow this:
    1) U can pass data from one program to another in a single login using SAP memory......
    2) u can create a DBtable update dat table using ur first pgm and fetch from second program.....
    3) U can pass the report output using EXPORT TO MEMORY addition and get it back using IMPORT FROM MEMORY..........
    Eg:
    Export the selected rows to the next program
    EXPORT final TO MEMORY ID 'ABC'.
    CALL TRANSACTION 'XXX'.
    XXX is the tcode for the other program where u want to import the values.
    In the second program
    INITIALIZATION.
    IMPORT the internal table from the first program
    IMPORT final FROM MEMORY ID 'ABC'.
    Thanks and Regards,
    Reward If Helpful

  • How to synchronise the job processing from the program.

    How to synbchronize the job processing when we are creating jobs from the program.
    Thanks,
    Ramana.

    hi,
    yes you can do this..
    try this
    create a two screen suppose 9000 and 9001..
    then right click on your program name...
    create a TCODE say TONE..
    in this give the screen number 9000..
    now again right click on the program name
    create a TCODE say Tsecond
    in this give the screen number 9001...
    hope this will help you..
    Regards
    Ritesh J

  • E-Mailing Background Job Log from SM36

    Friends,
    Is there a way that you can set up automatic emailing of the log from a periodic background job set in SM36? I want this log to be sent to few external E-mail IDs.
    Let me know.
    Thanks
    Jagadish

    Dear Jagadish,
    In my previous project we have achieved the same requirement,like sending the mail to particular User Id's
    for a background run job.
    Check with these steps,
    Go to T code S023 > create>enter some name and Title->Folder ->private or shared one>Save->
    back button->select name & change then recipient name mail address-->recipient type --->internet
    address and then save.
    In SM36 before scheduling the job click on spool list recipient and assign the one which you have
    created,then you schedule the job ,give some job name and then save.
    Before doing the above steps ask your BASIS consultant whether sending mails is active,the same can be
    checked in T code SCOT.
    Check and revert back whether you are successfful or not.
    Regards
    Mangalraj.S

  • How to access system calls from java program?

    i am having a doubt regarding accessing system calls from a Java program like accessing unix system calls from a c program.

    Runtime.getRuntime().exec("line command here");
    example:
    Runtime.getRuntime().exec("ls -la");

  • Find background job ID (BTCJOBCNT) within program at runtime.

    Hello,
    Can a program find out what background job ID is has been assigned? Keeping in mind that multiple jobs can be released and active at the same time.
    Thanks!
    Andre

    Thanks but that FM gives me all jobs that have that program. In my scenario, there could be multiple jobs running at the same time. I want/need to find the respective job ID for the program.
    Here is the big picture: This program needs to run in exclusivity. Job scheduling is automated and out my control. Because of execution delays, some job may start at the same time. In that case BP_FIND_JOBS_WITH_PROGRAM will tell me another job is active and I will stop the processing of the current job. However, this logic will apply for the second (and third) job and they will also be stopped. I'm hoping to get the Job Id so I can keep the earliest job (or other criteria) running.
    Thanks,
    Andre

  • Program rbdapp01 when called from a program is not working

    Hi Guys,
    I am calling the program rbdapp01 from a custom program to reprocess an inbound ASN with IDOC status of 64. The code is listed as below in the custom program.
    SUBMIT rbdapp01
    WITH docnum = i_report_tab-docnum
    WITH p_output = C_FALSE
    AND RETURN.
    After the execution of the custom program, the IIDOC is not processed and it remains in the status 64 with a message "Re processing deleted , inbound delivery IDOC , ,". When I run the program in debug mode, I can see that the control is going into the rbdapp01 program. But some where along the line, it is failing for what ever may be the reason and it does not process the IDCO, but it only populates the message.
    But when I execute the same program rbdapp01 for the same IDOC from SE38, the IDOC is processed fine.
    Looks like, I am missing something when I am calling this program rbdapp01 in another custom program. Any advice is really appreciated.
    Regards
    Rupesh.

    Hi,
    Please make use of this method of submit
    DATA : rspar_tab  TYPE TABLE OF rsparams,
            rspar_line LIKE LINE OF rspar_tab.
      rspar_line-selname = 'DOCNUM'.
        rspar_line-sign    = 'I'.
        rspar_line-option  = EQ'.
        rspar_line-low     = .
        rspar_line-high     = .
        APPEND rspar_line TO rspar_tab.
    SUBMIT RBDAPP01 WITH SELECTION-TABLE rspar_tab.
    Try to implement this code, hope this help outs
    Thanks & Regards
    Suresh

  • Online Background job for Module pool program

    Hi,
        I need to process the dialog program in background. Normally for any executable report programs by default we will have that functionality. But i need the same functionality for my module pool program. User needs 2 execute buttons - one is for direct excute (foreground execute) and the other one is for back ground processing.
       I tried with the 3 function modules job_open, job_submit & job_close. But i am keep on getting some issues and i am not sure how those will work because i wrote all the validations in direct exucte user command, now if user clicks on Background how that logic will be called and how it will be processed.
    Can any one give your valuable suggestions.
    regards
    Jaya

    Hi
    Create a Transaction code for this Program.
    Then implement the BDC Code to Process the SCreens with the Required input Values.
    Schedule this BDC Session in Backgound using RSBDCSUB.
    Reward if usefull

  • Screen does not seem to reflect changes when called from main program.....

    Hi all,
            here's an issue that i've been trying to solve for a few days now,
    i had created a screen in the screen painter, inside which i've included a table control (screen number 100: ).
    i, then created a second screen pointing to the same program as screen 100 and assigned screen number 200 to it. so both scrn 100 and scrn 200 has got table controls and the validations occur in modules from the same program.
    the issue i face is that, while any changes i make in screen 100 works fine when i call screen 100 from the main program;  it does not work when i try to modify the table control in screen 200. for example, if i were to add a new column, it messes up the allignment of the other columns in screen 200, i can't seem to assign fixed colums, etc....
    has anyone come across similar issues? if so how can i solve it? could it be an error with the SAP GUI?
    any response will be appreciated. points will be rewarded as well... if that's how things work here.
    Thanks,
    David.
    Edited by: david joseph on Aug 14, 2008 2:33 AM

    >
    david joseph wrote:
    > Hi all,
    >         here's an issue that i've been trying to solve for a few days now,
    > i had created a screen in the screen painter, inside which i've included a table control (screen number 100: ).
    >  i, then created a second screen pointing to the same program as screen 100 and assigned screen number 200 to it. so both scrn 100 and scrn 200 has got table controls and the validations occur in modules from the same program.
    >
    > the issue i face is that, while any changes i make in screen 100 works fine when i call screen 100 from the main program;  it does not work when i try to modify the table control in screen 200. for example, if i were to add a new column, it messes up the allignment of the other columns in screen 200, i can't seem to assign fixed colums, etc....
    >
    > has anyone come across similar issues? if so how can i solve it? could it be an error with the SAP GUI?
    >
    > Thanks,
    > David.
    >
    > Edited by: david joseph on Aug 14, 2008 2:33 AM
    Hi David,
    The description of the problem is not so clear.
    Let me know where I'm wrong, you have 2 screens and 2 different tablecontrols ? When you do any changes from the sapgui to the screen 100 there is no problem. But when you do that to the screen 200 is messes up ?
    My logic with table controls
    if you want 2 screens to share the same control then add the control to a subscreen
    when you want to have 2 screens with 2 differents controls :
    in main program
    CONTROLS : tc_100 type TABLEVIEW USING SCREEN 100.
    CONTROLS : tc_200 type TABLEVIEW USING SCREEN 200.
    In screen 100 / 200 assure the name of the controls are tc_100 / tc_200....
    Using this method I never have any problem....

  • BRMS Connector - Calling from ABAP program

    Hi,
    I got some error when I changed the BRFPlus from decision table to BRMS connector when calling it from an ABAP program.
    Is there any difference in the calling of those BRFs from ABAP to get the data?
    Thanks!

    Hi Carsten:
    There are documents in SCN on how to call a BRFPlus from a webdynpro.  Is the call to a BRFPlus Function from a CRM-BSP very different?  I mean, in the Webdynpro documents we found in SCN, they use the terms: controller, methods and classed, which are also terms used in BSPs, hence out of our ignorance we assume there should not be much of a difference.
    It is important to clarify that I am not a developer, but this is all to get an idea whether the scenario is totally different, or to know if what we are trying to accomplish is not possible, which I doubt.
    Any help or link is appreciated.
    Thanks,
    Juan

  • Call From Cobol Program on OS 390

     

    Don Ferguson <[email protected]> writes:
    What does IBM offer in this space? I guess its possible to envisage
    calling an EJB from a COBOL program over IIOP, but no-one has tried
    it. If this is how IBM does it then it should work with us also under 6.1
    andy
    Roman wrote:
    Hi .
    Try to WLS6 and WTC -- weblogic tuxedo connector and Elink 4 for connectivity
    between OS390 CICS and Tuxedo.
    IBM Websphere offers more as for EJB - OS390 system. But Weblogic is better
    J2EE server (global view), in my opinion.
    Roman
    "Cameron Purdy" <[email protected]> wrote:
    I'd suggest CORBA (2.3 or later).
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com
    +1.617.623.5782
    WebLogic Consulting Available
    "Marc Lenart" <[email protected]> wrote in message
    news:3a8956f2$[email protected]..
    Can you steer me in the right direction as to how I can call a sessionbean from a
    cobol program on the OS390 platform? An example wouyld be helpful.Thank
    You!

Maybe you are looking for

  • My mac OS 10.5.3 won't connect to my D-link router WBR-2310

    I have just purchased a D-link WBR2310 router. My wired pc works, but not my wireless Mac, even if the network has no protection/password. It worked with a Linksys router. When I do have to enter the WEP passwork, along with the dollar sign, it tries

  • Headphone problem after updating to IOS 4.1

    After updating my 3GS to iOS4.1, I can not adjust sound volume through headphone any more? How to fix this problem?

  • Multiple Party Shuffle playlists???

    Is there a way to create multiple party shuffle playlists?? I would like to have a party shuffle for 3 or 4 different genres of music If its not already possible, would anybody agree that this would be a good feature??

  • Compumoron attempts to play with big toys!  Disaster relief requested

    I just bought a new computer on Ebay.  It is gorgeous, a great big box with blue lights all over it.  Fans whirling aplenty.  The C drive is two 128GB Crucial C300 SSD drives in RAID 0 array and the operating system is Win 7 Professional 64bit.   I b

  • Email attachment problem - unicode?

    Hi All, I've copied some of the examples from SDN on how to send an attachment via email from ABAP. The problem is that the text file attachments are incorrect. Each character is separated by another character. If I create a text attachment that read