cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduled Job List download in CPS Redwood

0 Kudos

Hello ,

I am new to REDWOOD CPS (Build : M33.104-74500). Our SAP ECC , BW , GRC Systems are connected to SAP REDWOOD CPS where all the batch jobs gets triggered from CPS to SAP System.  I want download a list of batch jobs which are scheduled (all Periodic jobs) . I want to down load the  batch job name and Frequency. Can any one help me out how can i achieve this or any Report that would generating this list.

Thanks in Advance!

Regards,

Krishna

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Krishna Kumar,

If you are comfortable with the reports then please follow below steps to get the list of scheduled jobs.

Step 1: On left hand side select Definitions in that select "Reports".

Step 2: Then right click and select new report.

Step 3: Then in first tab provide basic info like name to report and description and in Query select option Object Definition Query: select * from Job;

Step 4: Then select Columns tab and create the below column by clicking Add button.

               Column1: Name

               Column2: Status

               Column3: Submit Frame

               Column4: Date

As mentioned in Above screenshot give below Field value to column

Name--> JobDefinition

Status-->Status

Submit Frame-->SubmitFrame

Date-->ScheduledStartTime

Also do not forget to give Column Order in incremental order and please do not duplicate the order number.

Step 5: Then please select the Selection Tab and add selection criteria as below.

Left Report Column : Status

Operation: Equal To

Column: Select Value Option--> Scheduled

Step 6: Then save the report. Or you can see the Preview by clicking Report Preview Tab.

Step 7: Then right click the report and Select Submit or you can create the New Job Definition if you require this to run again and every time you run the job definition you can get the out put as list of scheduled jobs.

Hope this will help you.

Regards,

Amarjeet Kamble

former_member206885
Participant
0 Kudos

Hi Krishna,

Amarjeet suggested an easiest way to do it.

If you want to use the script, then make sure you have defined queue for the job 'JOB_LIST_DOWNLOAD'. A null value is getting returned when trying to read the queue name for this job. If you don't want the queue name to be listed, then you can remove the queue column from the script and re-run it again.

Thanks,

Tinku

Answers (1)

Answers (1)

former_member206885
Participant
0 Kudos

Please use the attached script.

Thanks,

Tinku

0 Kudos

Hello Tinku ,

May i know the steps how to run.

I have tried to run by creating a new job by selecting redwood script under job Definitions and it failed with error.

-- JOB RUN STACK TRACE --

com.redwood.scheduler.script.api.ScriptEngineEvaluationException

at com.redwood.scheduler.script.java.impl.Java.evaluate(Java.java:87)

at com.redwood.scheduler.scriptjobservice.impl.ScriptJob.execute(ScriptJob.java:138)

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:763)

Caused by: com.redwood.scheduler.script.api.ScriptEngineEvaluationException

at com.redwood.scheduler.script.java.impl.Java.evaluateJava(Java.java:147)

at com.redwood.scheduler.script.java.impl.Java.access$0(Java.java:134)

at com.redwood.scheduler.script.java.impl.Java$1.call(Java.java:80)

at com.redwood.scheduler.script.java.impl.Java.evaluateCallable(Java.java:115)

at com.redwood.scheduler.script.java.impl.Java.evaluate(Java.java:74)

... 4 more

Caused by: com.redwood.scheduler.infrastructure.exception.ReplacementException

at com.redwood.scheduler.infrastructure.util.ExceptionUtil.wrap(ExceptionUtil.java:236)

... 9 more

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at com.redwood.scheduler.script.java.impl.Java.evaluateJava(Java.java:143)

... 8 more

Caused by: java.lang.NullPointerException: while trying to invoke the method com.redwood.scheduler.api.model.Queue.getName() of a null object returned from com.redwood.scheduler.api.model.JobDefinition.getDefaultQueue()

at com.redwood.scheduler.custom.JOB_LIST_DOWNLOADshowChain(JOB_LIST_DOWNLOAD.java:user code 187)

at com.redwood.scheduler.custom.JOB_LIST_DOWNLOADlistChain(JOB_LIST_DOWNLOAD.java:user code 72)

at com.redwood.scheduler.custom.JOB_LIST_DOWNLOADexecute(JOB_LIST_DOWNLOAD.java:user code 19)

at com.redwood.scheduler.custom.JOB_LIST_DOWNLOADStub.jcsExecute(JOB_LIST_DOWNLOADStub.java:28)

... 13 more