2005 Dec 09 5:47 PM
Hi all,
I have to make a program that should post email to multiple recipients based on the batch job failures. i do have a routine to post emails. but can u people help me with the logic to using that with the basis of job names.
thanks,
kiran.
2005 Dec 09 6:13 PM
I guess I would create a custom table for storing the job name and the email addresses that need to be notified. Job name would be the key of the table, and another field for holding the email address.
<b>Job Name Email Address</b>
Z_YOUR_JOB [email protected]
z_YOUR_JOB [email protected]Then you can retrieve the email addresses by job name and send the emails.
select * into table icusttable
from zcusttable
where job_name = <the_job_name>.
loop at icusttable.
mailrec-receiver = icusttable-email.
mailrec-rec_type = 'U'.
append mailrec.
endloop.
Regards,
Rich Heilman
Hi all,
I have to make a program that should post email to multiple recipients based on the batch job failures. i do have a routine to post emails. but can u people help me with the logic to using that with the basis of job names.
thanks,
kiran.
2005 Dec 09 6:10 PM
The Batch names are stored in the table APQI.
You can query that table and find the status (QSTATE) and accordingly build the logic to send the email to whoever you want.
Regards,
ravi
2005 Dec 09 6:12 PM
Take a look at table <b>APQI</b>
I believe that the field <b>GROUPID</b> denotes the jobname. You can also give the <b>PROGID</b> (programme name) along with it!
I think you will get the status of the job from the field <b>APQI-QSTATE</b>
Do verify these....
2005 Dec 09 6:13 PM
I guess I would create a custom table for storing the job name and the email addresses that need to be notified. Job name would be the key of the table, and another field for holding the email address.
<b>Job Name Email Address</b>
Z_YOUR_JOB [email protected]
z_YOUR_JOB [email protected]Then you can retrieve the email addresses by job name and send the emails.
select * into table icusttable
from zcusttable
where job_name = <the_job_name>.
loop at icusttable.
mailrec-receiver = icusttable-email.
mailrec-rec_type = 'U'.
append mailrec.
endloop.
Regards,
Rich Heilman
2005 Dec 09 6:33 PM
Hi Rich Heilman,
Thanks for the info. the problem is there are batch jobs which deal with the interfaces of 5 different countries and based on those jobs i have to send the emails. can u plz help me with that logic.
thanks in advance,
kishore.
2005 Dec 09 6:45 PM
2005 Dec 09 6:52 PM
2005 Dec 09 6:56 PM
Hi,
In that case you need to maintain the country also along with other information in the ztable and based on the SY_LANGU you can decide which one went wrong.
Regards,
Suman