Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Spool Output script issue

Hi All,

Greetings..!!!

Recently we have upgraded from CPS to BPA. After migration we are facing issue with the script which sends the spool output of ABAP program from the job. Below is the script.


import com.redwood.scheduler.api.exception.ParameterDefaultValueUnavailableException;
import com.redwood.scheduler.api.exception.SchedulerAPIPersistenceException;
import com.redwood.scheduler.api.model.Job;
import com.redwood.scheduler.api.model.enumeration.JobStatus;
import com.redwood.scheduler.custom.Destination;
import com.redwood.scheduler.custom.libraries.destinations.DestinationCallback;
import com.redwood.scheduler.custom.libraries.destinations.FormatNotSupportedException;
import com.redwood.scheduler.custom.libraries.destinations.ObjectNotFoundException;

{
   Destination destination = new Destination(jcsSession, jcsJob, jcsErrLog, CallId, JobId, new DestinationCallback()
     {
       public void prepareDestinationJob(String srcJobFormatPartitionName, String srcJobFormatName, Destination dest)
         throws ObjectNotFoundException, ParameterDefaultValueUnavailableException, SchedulerAPIPersistenceException, FormatNotSupportedException
       {
         {
           Job destJob = dest.prepareJob("GLOBAL", "EMAIL_OUTPUT_DefineThis", PRIORITY, QUEUE_PARTITION, QUEUE_NAME, RECURRENCE_DATA, STARTTIME, STATUS_ON_SUBMIT, SUBMIT_FRAME_PARTITION, SUBMIT_FRAME_NAME, TIME_WINDOW_PARTITION, TIME_WINDOW_NAME);
           destJob.getJobParameterByName("P_TO").setInValueString(P_TO);
           destJob.getJobParameterByName("P_ATTACH_FILE").setInValueString(P_ATTACH_FILE);
         }
       }

       public boolean precondition(Destination dest)
       {
         return true;
       }
     });
   destination.execute();
}

The script EMAIL_OUTPUT_DefineThis  used in the above program is as below.

Job ${P_PARENT} SAP JOB ${pParentJobName} has finished

[Headers]
subject=Job ${P_PARENT} SAP JOB ${pParentJobName} has finished
[Attachments]
@{name}-@{index}.txt=Parent:?type=output

After running this below error we have received as exception.

Failed to set return code of current job

Constraint violation on Job of Process Definition EMAIL_OUTPUT_DefineThis

Validation failed for parameter 'null': java.lang.NullPointerException:while trying to invoke the method com.redwood.scheduler.api.constraint.ConstraintJobParameter.getInValueString() of a null object loaded from local variable 'jp'

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question