2008 Mar 17 4:18 AM
Hi All,
After running a Program in Background and whne we see the Job Overview In TCode 'SM37' (Job Selection), we get the log as per below table.
JobName ln Job CreatedBy Status
Z_LIST_DETAILS 1049JG800106 Finished
Z_LIST_DETAILS 1049JG800106 Finished
for one of my program when it is run in Background and after its completion I have to change the Status message of the JOB Indicator (typed in Bold Above) in my program from 'Finished' to 'Job Finished with Errors' in case any error occurs in the program. How can we do this ? How will I come to Know whether Job Has finised successfully or with errors and change the message accordingly.
Points will be rewarded..
Thanks
Jitendra
Hi All,
After running a Program in Background and whne we see the Job Overview In TCode 'SM37' (Job Selection), we get the log as per below table.
JobName ln Job CreatedBy Status
Z_LIST_DETAILS 1049JG800106 Finished
Z_LIST_DETAILS 1049JG800106 Finished
for one of my program when it is run in Background and after its completion I have to change the Status message of the JOB Indicator (typed in Bold Above) in my program from 'Finished' to 'Job Finished with Errors' in case any error occurs in the program. How can we do this ? How will I come to Know whether Job Has finised successfully or with errors and change the message accordingly.
Points will be rewarded..
Thanks
Jitendra
2008 Mar 17 4:36 AM
I think being a standard transation one can not change the status of SM37. Whether job was finished successfully or with error can be checked by checking Job log.
anya
2008 Mar 17 4:54 AM
hi...
if ur job is not successfull then the status will be INCOMPLETE only..
so u can see the logs there...
regds
jigar p
2008 Mar 17 5:11 AM
Hi
To do this, you have to query the table TBTCO witht the Job Name and Job Count (job id). The Status field will give you the status of execution of the background job. Hnece in your program, you will have to write a select query on TBTCO passing job name and count and fetch status. Based on this change the message to the required message. You can probably make use of the wait statment before querying the table, so that processing of the background job is complete.
Regards,
Vijay
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |