Check Job step status

HI,
   My scenario goes like this :
      I have 3 steps in a background job with 3 diff variants. I want to find out a way
to find the status of each of my job steps, and after each job step is submitted on knowing its status i want to send a corresponding mail to a few people .
How do i do this.
Answers will be rewarded,
Regards,
Rohan

Hi,
CALL FUNCTION 'BP_JOB_READ'
    EXPORTING
      job_read_jobcount     = w_jobcount
      job_read_jobname      = w_jobname
      job_read_opcode       = '20'
    IMPORTING
      job_read_jobhead      = wa_jobhead
    TABLES
      job_read_steplist     = i_jobsteplist
    EXCEPTIONS
      invalid_opcode        = 1
      job_doesnt_exist      = 2
      job_doesnt_have_steps = 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.
To Display the status text as per the status type
  CASE wa_jobhead-status.
    WHEN 'S'. WRITE: / text-033. "'Scheduled'.
    WHEN 'R'. WRITE: / text-034. "'Released'.
    WHEN 'F'. WRITE: / text-035. "'Completed'.
    WHEN 'A'. WRITE: / text-036. "'Cancelled'.
    WHEN OTHERS.
  ENDCASE.
Best regards,
Prashant

Similar Messages

  • Job Step Status

    Hi All,
    Is there any FM or table to check the status of each job step??
    I mean while my job is executing i want to check the of the job step that has finished execution.
    For e.g. If Job A having 3 steps is running.Step 1 has completed execution and Step 2 has started. At this point i want to chck the status of Step 1 and accordingly send mail to people.
    How can i achieve this.?
    Its Urgent...
    Answers will be rewarded.
    Regads,
    Rohan

    Hi Rohan,
    The information about back ground jobs are stored in table <b>TBTCO</b>.
    field STATUS denotes the status ( A - failed, F - complete , R - active )
    The primary key for this table is job name ( including the step  )
    Check this table for more details.

  • Check Status of job step

    Hi,
    i have a job having 3 steps. table TBTCO gives u the status of the 3 steps together -- job as a whole.
    How can i come to know of the status of the job at every step. i mean how will i confirm if at every step the job is executed properly or not.??
    Untill the complete job is executed, the status of each job step is Scheduled.
    Only after complete job excution u can find out the status . either finished or aborted.
    What if i want to know status at each job step?
    Kindly help,its urgent.
    Answers will be rewarded,
    regards,
    Rohan

    Hi,
    Checking  your job status with SM50 (processor type BTC) is more accurate then SM37.  SAP updates the tables TBTCO wheneveryour background jobs status change.  If SAP is shutdown, the currentjobs might not be update ontime to the table. (e.g. a background job wasshown as Active (SM37), in fact it real status should be Cancelled.
    Look at the function module <b>GET_JOB_RUNTIME_INFO</b>
    Regards
    Sudheer

  • Check Status of a job step

    Hi,
    Can anyone tell me how to check the true status of a job step.
    Using tables TBTCP , or FM BP_JOB_READ what i can come to know is the status of a job step to be 'P" ie Scheduled even when the job containing that step has finished succesfully(Status from TBTCO ).
    My Job has 3 steps.
    I want to know the status of my 1st job step and based on the status (either Aborted or Finished) i want it to proceed further n execute the 2nd step.and so on.
    IS any there way out??
    Answers will be rewarded,
    regards,
    Rohan

    Hi,
    Checking  your job status with SM50 (processor type BTC) is more accurate then SM37.  SAP updates the tables TBTCO wheneveryour background jobs status change.  If SAP is shutdown, the currentjobs might not be update ontime to the table. (e.g. a background job wasshown as Active (SM37), in fact it real status should be Cancelled.
    Look at the function module <b>GET_JOB_RUNTIME_INFO</b>
    Regards
    Sudheer

  • T code to check the job run status

    Hi Gurus,
    I am filling the setup tables for inventory, but i didn't run in background. I clicked on execute button, but suddenly i got disconnected from net and my server also.
    Now i have to check the job run status whether it is running or not.
    Request you to provide the suggessions.
    Thanks & Regards,
    Saketh

    Hi,
    if you ran job in background you can see at SM37.use proper time ,date and use id to get your job.
    if you ran on frond end then you won't see job.if your job was completed then you can see data at SE11 by using setup table name or you can see at t code NPRT by using name of the run.
    if you won't find your job then just delete your setup tables again and fill it.
    No issues.
    Thanks

  • 5 error while checking job status

    Hi,
    We are getting the following error when we are trying to check the status of the process chain through FM 'RSPC_API_CHAIN_GET_STATUS':
    5 error while checking job status.
    The real scenario is we are using an abap screen with a button on it. when the user clicks on the button we call the FM 'BP_EVENT_RAISE' to trigger the process chain. once the chain is triggered we are having an endless loop to monitor the status of the chain with FM 'RSPC_API_CHAIN_GET_STATUS' untill the chain status turns green ie G.
    Now while monitoring the status it randomly throws me the above error. it seems to work sometimes and other times it gives the popup with the said error.
    Can anybody help why we get the error.
    Regards,
    Shashank

    Hi Shanshank,
    Try to Debug the FM.
    Rgds,
    Ravi

  • All timer jobs don't start (paused in check job status)

    Hello,
    Some bad things have happend to our SharePoint Server 2010. All timer jobs suddenly stopped running. The last time they ran successfully was 09/26/11. Since that time all jobs have been scheduled to run according to their schedule but don't actually run.
    In the Check Job Status view there is a list of jobs scheduled to run 09/26/11 which are currently paused for some reasons, other jobs don't run at all. 
    Is it possible to unpause these jobs and let other jobs to run? Any ideas would be very much apprecaited. Thank you in advance.

    Hi,
    Thanks for your post.
    Pausable Timer Jobs
    You can now create pausable timer jobs. This is done by inheriting from the
    SPPausableJobDefinition and overriding Execute(SPJobState) instead of
    Execute(Guid). You can then use the current job state (SPJobState) to store values which are retrieved when the job is resumed.
    Running jobs on all content databases
    Another new timer job derivative type is the SPContentDatabaseJobDefinition.This is a timer job specifically made to perform actions on content databases. The timer job is distributed on the WFE servers and each content database is only
    processed by one job. Override the Execute(SPContentDatabase, SPJobState) to add your own processing. The job supports pausing.
    Running jobs on all Site Collections
    A really interesting new timer job type is the SPAllSitesJobDefinition. This one is derived from the SPContentDatabaseJobDefinition and has a method called
    ProcessSite(SPSite, SPJobState) which you override to process the SPSite object. This could be very useful to build site inventories/directories.
    Running job on a specific server
    The SPServerJobDefinition is a pausable timer job that is designed to be targeted to a specific server (SPServer).
    Running jobs for specific services
    The SPServiceJobDefinition is another pausable timer job that runs a job on all servers where a specific
    SPService has been provisioned. A very similar job is the
    SPFirstAvailableServiceJobDefinition which runs the job on the first available server which has a specific SPService installed. If you would like to run a job an all servers you can easily use SPServiceJobDefinition. Then use the timer job service
    (which is installed on all servers, except dedicated database servers) and pass
    SPFarm.Local.TimerService as the SPService parameter in the constructor.
    All of the new specific timer jobs are essentially smart derivatives of the SPJobDefinition but using these new abstract classes will certainly save you some time when you need to target your timer jobs.
    I hope that helps.

  • RME-Compliance check job failed and Execution status display notattempted

    Dear All,
    We did a compliance check job schedule one time/a day.but unfortunately it failed as below:
    Execution Summary
    Pending : 0
    NotAttempted : 361
    Successfull : 0
    Failed : 0
    Partial Success : 0
    How can i do?
    Thanks!

    Use this document:
    http://www.cisco.com/en/US/docs/net_mgmt/ciscoworks_resource_manager_essentials/4.0/user/guide/over.html

  • Background Job Step

    Hi,
    I have 3 steps in my job. I want to check the status of each job step and if that job step fails , send email to certain people.
    How do i go abt doing abt it??
    In table TBTCP --  it gives the status of each job step as 'P' ie scheduled even for the finished ones... so i cant get correct data from TBTCP.
    Is der any FM implementing the same??
    Its Urgent.
    Answers will be rewarded,
    regards,
    Rohan

    Hi Rohan,
    Instead of creating the stpes, why don't you create the Job after completing the Fisrt job and for the Third Job select after completion of the Second job, so that you will get the Status in TBTCP table from there you can write the code to send the email
    Regards
    Sudheer

  • Process Chain step status

    Hello All,
    In one of our process chain , we have an AND step, where in its checks its 4 preeceding steps, its all 4 are green,the AND Step executes and it goes to the next step.
    Chain is running fine since many years. But yesterday , we faced the issue that even if the preeceding steps were green, the AND step status showed Completed  rather it should show Successfully Completed.
    So we had to manually change the status to Successfully Completed  and it went fine.
    We check with the Basis also, the system was fine during that point.
    Any pointers why the step did not get the Status as Successfully Completed.
    Job name: BI_PROCESS_AND
    Regards,
    Mayank

    Hi,
    You can find the necessary logs & status of the process chains in the RSPCLOGCHAIN table.
    Let's know the status.
    Also check in table RSPCPROCESSLOG
    Let us know the details.
    Reg
    Pra

  • RAR Job Scheduler Status

    hi,
    In RAR I have a message in the Job Scheduler which says :
    Job Scheduler Status: unknown error
    therefore jobs are not working...
    thanks for help me
    actual config :
    GRC AC 5.3 SP10
    Edited by: Aurélien GARDE on Jan 21, 2010 3:18 PM

    Hi Aurélien GARDE ,
       I am not very clear about your question, however I am assuming that you are getting the error when running the Background Job , If this is the case  ,please check following
    1)     http://:/sap/CCBgStatus.jsp - it should come up with status u201Crunningu201D
    2) Check Analysis Engine Daemon Manager
    Type URL http://:/sap/CCADStatus.jsp - it should come up with
    status  u201Crunningu201D By default you should see 3 bg job threads and 5 web services threads per server
    Could you please let us know the findings ,If there is blank screen for step 2, then you need to apply note number 999785 , which will resolve your issue.
    Thanks & Regards
    Umashankar T

  • 5. We need additional time to process your transaction You should get an email from us by next business day. If you don't hear back from us, you can check your order status on your account page or call us at +1 800-585-0774. If you're not in North America

    Step 5.
    5. We need additional time to process your transaction You should get an email from us by next business day. If you don't hear back from us, you can check your order status on your account page or call us at +1 800-585-0774. If you're not in North America, you can look up a local number here. For now, check out all the great free features of Creative Cloud! Get started with trials
    I keep getting this.
    The Bank and Paypal states that Adobe needs to process my transaction twice.
    I have no order number/ no status nor contact from Adobe. I called customer service and he transferred me to sales where the phone rang with no answer.

    Since this is an open forum, not Adobe support... you need to contact Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • SQL Server Agent Job Failing on Job Step

    Hi,
    Firstly, apologies if this post has been made in the wrong group.  Running SQL Server 2012.  I'm attempting to add a SQL Server Agent Job which calls a stored procedure that sends a Database Mail message.  The SQL Server and SQL Server Agent
    both run under the NT AUTHORITY\NETWORK SERVICE account.  The Database Mail service has been enabled, and a public profile created.  When running the stored procedure manually, I receive no errors - everything runs as expected and I do receive an
    email containing the expected information.
    I've created the job, job step, job schedule, attached the schedule to the job, and assigned the job to server, all using T-SQL without error.  I've also enabled the mail profile on the SQL Server Agent, and I know that part is working because when
    the job fails, I get an email notification of the failure.
    I've checked the command text in the job step and parsed it within the SQL Job Step Edit window to confirm, it shows as parsing correctly.  However, when I manually run the job itself, I get the following:
    Execution of job failed.  See the history log for details.
    I check the history log and it shows:
    [474] Unable to refresh Database Mail profile Database Mail Profile. (reason: ) (Not a typo, the history log shows no reason)
    [260] Unable to start mail session.
    [396] An idle CPU condition has not been defined - OnIdle job schedules will have no effect
    The command text on the failing job step is as follows:
    DECLARE @date [varchar](10)
    SET @date = CAST(GETDATE() AS [varchar](10))
    EXEC [dbo].[GetExceptions]
    @company = 'MyCompany',
    @checkDate = @date
    With regard to the date value being passed as varchar: This stored procedure is used to check for exceptions against multiple databases on this server (hence the company parameter) via dynamic SQL.  I'd much prefer to use proper data typing but this
    is the only way I could get it to work.
    Does anyone have any suggestions on anything else I could check, or insights into why this is failing?  Any help is greatly appreciated!
    Best Regards
    Brad

    I am not sure if this really helps but I would do follow the below steps:
    1. make sure sql server agent has database mail enabled(rigt click on server agent--properties--alert system--enable database mail and choose right profile.) and RESTART THE SQL SERVER AGENT.(i know you said it i working, but sometimes,  restart the
    sql server agent might fix)
    2. check agent error log and check if any error messages.
    3. run the command text you mentioned in sql server and see if it is working.(i know you said it is working but just to make sure).
    4. make sure sql server agent service user has permissions to run database mail in msdb. check this https://msdn.microsoft.com/en-us/library/ms186358.aspx
    5. Check the output from select * from msdb.dbo.sysmail_log and if it says anything
    6.it does not look like the job log is getting truncated but to make sure, get the job step output to a text file.to do this, edit the job step and on the job step properties click on advanced,  enter path to the output file. this will give the complete
    output for the step.
    Hope it Helps!!

  • How to terminate the next job step in Background job?

    Hi,
    I have the requirement from the user that want to terminate the next job step in the background job that currently running (Status Active).
    For example, Background Job A, contains 5 job step, once the background is running, we would like Job A not run thru job step 4 and 5, just run up to job step 3. 
    Anyone have any idea how can I do that?
    Thanks
    Nattawat S.

    Hi,
              Try to delete instead of cancel in SM37.
    To cancel and active job, select the job from SM37 and Click on STOP button in application toolbar. You can refer to your other thread for more info.
    Regards

  • Unable to add more than around 4000 characters to a job step

    Solved. A trigger existed on the job steps table which captured any changes before and after. The insert table was limited changes to 4000 characters.
    SQL Server 2012 SP2 Enterprise Edition (11.0.5058.0) on Windows Server 2008 R2
    At some point a few months ago we encountered an issue where we hit a size limit of ~4000 characters on the amount of text we could enter into a Transact-SQL
    step of an Agent job. Attempting to create a job like this with sp_add_job will produce the error
    Msg 50000, Level 16, State 10, Procedure sp_add_jobstep_internal, Line 255
    String or binary data would be truncated.
    Adding the job step via SSMS yields
    Alter failed for JobStep 'xxx'. (Microsoft.SqlServer.Smo)
    Additional information:
    An exception occurred while executing a Transact-SQL statement or batch (Microsoft.SqlServer.ConnectionInfo)
    String or binary data would be truncated.
    The statement has been terminated. (Microsoft SQL Server, Error: 8152)
    I've checked sp_add_jobstep_internal, sp_add_jobstep and the sysjobsteps table and all references to the command field are nvarchar(max). We can run the same
    job creation code without error on a SQL Server 2008 R2 Enterprise Edition machine and two SQL Server 2012 SP2 Developer Edition boxes. All our 2012 servers were fresh installs, not upgrades.
    Any ideas on what is going on and how to fix it would be welcome.
    (I realise I could run this as a stored proc or split the step into multiple steps)

    It is
    nvarchar(max)   technically around 1 billion character. 
    The reason it is limited to 4000 because till 4000 character nvarchar(MAX) behave like  NVARCHAR(4000) i.e. 8000 bytes (size of data page per row). and if the size increase from 8000 bytes then it will be pointed to next data page. May bein cae of dynamic
    SQL you can exceed 8000 bytes (i.e. 4000 characters).
    It is always a good practice to keep long t-sql code in a stored procedure for maintainability and security.
    Glad to help! Please remember to accept the answer if you found it helpful. It will be useful for future readers having same issue.
    My Profile on Microsoft ASP.NET forum

Maybe you are looking for