cancel
Showing results for 
Search instead for 
Did you mean: 

Issue related to SAP CPS

Former Member
0 Kudos

This is about an issue faced in SAP CPS.
After upgradation to CPS version M33.104-74500 from M33.74-62951 it has been noticed that the automated report that were configured in CPS to be sent as HTML attachment through an SMTP email is failing. In the job chain the report generation step is getting cpmpleted succesfully but the mail sent step is failing.

Following CPS programs and parameters are used:

System_ReportRun

Report/Expression: GLOBAL.Weekly_Backup_Job_POK_Status (name of CPS report/filter)

Report format /Expression: HTMLText

System_Mail_Send

To/Expression: xxxxxx@xxxxxx.com

Subject/Expression: Weekly POK Backup Status

Text/Expression: Weekly POK Backup Status

Relative Job/Expression: Generate Report, Job 1

Job file/Expression: report.html

The error log is as below:

-- JOB RUN STACK TRACE --

JCS-103005: Job not found. Relative job is "Generate Report, Job 1", current job is Job 108976008 (submitted from System_Mail_Send copy from 2010/04/01 15:00:19,276 America/New_York). Cannot find job 1

        at com.redwood.scheduler.apiint.model.helpers.RelativeJobFinder.a(RelativeJobFinder.java:74)

        at com.redwood.scheduler.apiint.model.helpers.RelativeJobFinder.locate(RelativeJobFinder.java:104)

        at com.redwood.scheduler.apiint.model.jobfile.JobFileExpression.locateRelativeJob(JobFileExpression.java:4)

        at com.redwood.scheduler.system.jobs.SendMail.sendMessage(SendMail.java:170)

        at com.redwood.scheduler.system.jobs.SendMail.execute(SendMail.java:151)

        at com.redwood.scheduler.systemjobservice.impl.JobWorker.doWork(JobWorker.java:253)

        at com.redwood.scheduler.infrastructure.workqueue.Worker.run(Worker.java:76)

        at java.lang.Thread.run(Thread.java:761)

It was working fine prior to upgradation. Please suggest a solution. Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

nanda_kumar21
Active Contributor
0 Kudos

The issue is that system_mail_Send is not able to identify the relative job.

Are you sure of the step name and job name mentioned? no typo?

Is Generate Report, the previous step name? the format should be <step name>, job 1

Thanks

Nanda

kedar0310
Explorer
0 Kudos

Hi Nanda Kumar,

I am Anirban's team member. Let me add to what Anirban has described.

Our issue is the syntax in the new version.

The documentation says the syntax for sending automated report is as below.

Older Version Syntax:

Step 1 - Genrate Report - Expressions - Report Name and Report Format

Step 2 - Send Email - Job File expression, Report.html

New Version Syntax:

Step 1 - Genrate Report - Expressions - Report Name and Report Format

Step 2 - Send Email - Job File expression, Job ID

(JID for the report ran job)

For the new version syntax, how do we fetch the JID (Job ID) dynamically?



Best Regards,

Kedar Pujari

nanda_kumar21
Active Contributor
0 Kudos

Can you please post the job chain screenshot with the system_send_mail selected?

I want to know what is the name of the step 1 and what have you filled for the field Relative Job for the system_mail_send.

Thanks

Nanda

kedar0310
Explorer
0 Kudos

Hi Nanda,

Please refer the screen shots here.

nanda_kumar21
Active Contributor
0 Kudos

hey Kedar,

For Job file, you just have to mention * or *.html.

* - will attach all the output files including logs

*.html - only the html outputs

For Relative job field, please provide the following parameters:

Generate Report, Job 1

then submit the job,

kedar0310
Explorer
0 Kudos

Hi Nanda Kumar,

It still does not work. CPS can not find Job 1.

In fact, it will never be Job 1 as per my understanding. The syntax says ...Generate Report, JID

The issue here is how do we determine the JID dynamically?

See the error below.

-- JOB RUN STACK TRACE --

JCS-103005: Job not found. Relative job is "Generate report, job 1", current job is Job 110767228 (submitted from System_Mail_Send copy from 2010/04/01 15:00:19,276 America/New_York). Cannot find job 1

  at com.redwood.scheduler.apiint.model.helpers.RelativeJobFinder.a(RelativeJobFinder.java:74)

  at com.redwood.scheduler.apiint.model.helpers.RelativeJobFinder.locate(RelativeJobFinder.java:104)

  at com.redwood.scheduler.apiint.model.jobfile.JobFileExpression.locateRelativeJob(JobFileExpression.java:4)

  at com.redwood.scheduler.system.jobs.SendMail.sendMessage(SendMail.java:170)

  at com.redwood.scheduler.system.jobs.SendMail.execute(SendMail.java:151)

  at com.redwood.scheduler.systemjobservice.impl.JobWorker.doWork(JobWorker.java:253)

  at com.redwood.scheduler.infrastructure.workqueue.Worker.run(Worker.java:76)

  at java.lang.Thread.run(Thread.java:761)

nanda_kumar21
Active Contributor
0 Kudos

Hi Kedar,

The relative job should be Generate Report, Job 1, please notice that "R" is upper case, previously we provided a lower case. Try this. It should work.

Thanks

Nanda

kedar0310
Explorer
0 Kudos

Hi Nanda Kumar,

I tried correcting the spelling and capitalization error as per the syntax below

Generate Report, Job 1

However, the job still failed. Error is the same and it says "Can not find job 1"

I believe dynamic JID should be determined as per the documentation from CPS.

Raising this now to SAP CPS...

nanda_kumar21
Active Contributor
0 Kudos

Hi Kedar,

There is no need of determining the job id dynamically.

This is out of the box, default utility.

Is it possible for you to paste the screenshot of the system_mail_Send job parameters of the job that failed? along with the job chain screenshot?

Thanks

Nanda

h_carpenter
Active Contributor
0 Kudos

Hi Nanda,

What is weird here, is that it worked before the upgrade.

I found an error: A job file never has the job or step name in it, so, Job File MUST be "report.html" not "Step 1 ,report.html"  (without ")

To summarize:

Make 100% sure that

Relative Job: Generate Report, Job 1

Job File: report.html

If this does not work, try to recreate a new job chain.

Regards,

HP

gmblom
Active Contributor
0 Kudos

Hello all,

This has to do with an internal change in version M33.97 that changes the way jobs are looked up. There will be a fix for this in an upcoming patch.

To make your job chain work for the moment you can choose one of these two options:

1) make the reference to the job number mentioned in the job chain dialog, in your case 'job 3'

2) change the job number (sequence number on the job chain call) in the xml tab of the job chain and reset it to 1

Regards Gerben

kedar0310
Explorer
0 Kudos

Dear Gerben,

It worked... I have used the first method  -

Relative Job - Generate Report, Job 3

Job File - Report.html

Can you please help me understand how the job number here is 3?

Why JOB 3?

Thank you for the help.

Best Regards,

Kedar Pujari

gmblom
Active Contributor
0 Kudos

Hi,

There is an internal numbering sequence, it is possible you have created multiple step calls in the past that made this number go up to 3. Like I said in my previous post, you can update the sequence number if you want.

Regards Gerben

abhishek_singh29
Active Participant
0 Kudos

Hi Anirban,

Can you please check the report is completed and generated which you are sending as your expected format. The error you are getting is releated to data is invalid.

Also if it's don't help, can you get the support file or trace file.

Regards,

Abhishek