cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPS alerts with basic alerting module

former_member1244799
Participant
0 Kudos

Hi All,

We have only basic alerting module and we are using M33.68971 version Can you please advise, if it is possible to do the below things with the basic alerting module? If so, please advise.

1) From Monday to Friday,  whenever a job gets failed in CPS, an email needs to be sent to servicedesk@abc.com.

2) On Saturday and Sunday, whenever a job gets failed in CPS, an email need to be sent to the corresponding group as per the application area.

Thank you in advance.

Regards,

Ramana

Accepted Solutions (1)

Accepted Solutions (1)

former_member1244799
Participant
0 Kudos


Hi All,

A small correction to my above question.

1) Whenever a job gets failed in CPS, an email needs to be sent to servicedesk@abc.com.

2) On Saturday and Sunday, whenever a job gets failed in CPS, an email needs to be sent to servicedesk@abc.com as well as  to corresponding group owner as per the application area.

3) Also can we create a text message (SMS) by sending an e-mail to the corresponding group owner as per the application area.

Please advise.

Thank you in advance.

Regards,

Ramana

nanda_kumar21
Active Contributor
0 Kudos

you can create a job chain with

step 1 -  your job definition

step 2 - system_email_send - add servicedesk@abc.com

step 3 - system_email_send - servicedesk@abc.com and group owner

add pre-condition on step 2 and step 3 to restrict as per your requirement.

thanks

Nanda

former_member1244799
Participant
0 Kudos

Hi Nanda,

Instead of configuring the email step for each and every job chain, How about creating one Email job chain with above email steps as you suggested with a wait event  and configure every job with the same raise event which raises whenever the job gets errored or killed. But how can we dynamically catch the job id, job description and job name of a failed job and send an email to the service desk. Please advise.

Regards,

Ramana

nanda_kumar21
Active Contributor
0 Kudos

You can use the following REL to get that information:

=waitEvents.<eventName>.raiserJobId

=waitEvents.<eventName>.raiserComment

The job definitions should set the raiser comment, from which you can get the Job Description, status.

thanks

Nanda

former_member1244799
Participant
0 Kudos

Hi Nanda,

Thank you so so much for putting me in the right direction. Now I am able to get the 'job id' and     ' job description' with the below REL fuction.

=waitEvents.EVENT_EMAIL.raiserJobId

=Query.getString('select Job.Description from Job where Job.JobId = ? ',  [waitEvents.EVENT_EMAIL.raiserJobId])

But I am unable to get the job defintion name and job status using the below REL function. It says invalid parameter when I refer the parameters with the below values.

=Query.getString('select
Job.JobDefinition from Job where Job.JobId = ? ',
[waitEvents.EVENT_EMAIL.raiserJobId])

=Query.getString('select
Job.Status from Job where Job.JobId = ? ',
[waitEvents.EVENT_EMAIL.raiserJobId])

Could you please advise on how to get the job name and job status.

Regards,

Ramana

nanda_kumar21
Active Contributor
0 Kudos

Job.JobDefinition will just return the UniqueId from JobDefinition table.

it should be "Job.JobStatus from Job"

thanks

Nanda

former_member1244799
Participant
0 Kudos

Hi Nanda,

Thank you. Strangely "Job.Status" worked now. It didn't work before. Can you please advise how can I get job name also.

Regards,

Ramana

former_member1244799
Participant
0 Kudos

Hi All,

I have defined the second parameter say 'parameter2' to get the 'job description' with the below REL.

=Query.getString('select Job.Description from Job where Job.JobId = ? ', [waitEvents.EVENT_EMAIL.raiserJobId])

I have defined the third parameter say 'parameter3' to get the 'job name' with the below REL by referring the second parameter in the below query.

=Query.getString('select JobDefinition.Name from JobDefinition where JobDefinition.Description = ? ', [parameters.parameter2])

Thank you so much nanda for pointing me in the right direction.

Regards,

Ramana

former_member1244799
Participant
0 Kudos

Hi All,

Nanda or anyone, can you please advise me how can I get the parent job chain id or parent job chain name using REL with the above information job defintion name or job defintion description.

I closed the thread too early.

Thank you in advance.

Regards,

Ramana

Former Member
0 Kudos

If the job description is same for two jobs. You will get any job name. Instead use the below REL to get the job name.

To get the job name..

=Query.getString('select Jd.Name from JobDefinition Jd, Job Jb where Jb.JobDefinition = Jd.UniqueId and Jb.JobId = ? ', [waitEvents.EVENT_EMAIL.raiserJobId]).

Regards,

Nanak.

Answers (1)

Answers (1)

nanda_kumar21
Active Contributor
0 Kudos

Setup an event and raise on completion of all the jobs you mentioned.

Create a job chain with system_mail_send jobs and pass job name as suggested by Nanak.

thanks

Nanda