Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How can you create a spoolfile from a program where have Error Message?

Former Member
0 Likes
821

I have a situation where I need a report to come out - even if I have an Error or Abort Message.

I need the report so that i can email the users in a second step of a Job.

We want the CANELLED to show in the JOB queue but when that happens by doing a message with the error it does not output any spool file.

The code is simple:

CONCATENATE c_errors

c_error_645

INTO z_msg_line SEPARATED BY space.

WRITE z_msg_line TO z_output_line.

WRITE: z_output_line.

lv_errors = 'X'.

MESSAGE ID 'ZX' TYPE 'E' NUMBER '645'.

The job stops, shows CANCELLED but not output to the spool file.

If I change message type to I for imfomation I get the spoolfile but the JOB queue shows COMPLETED so a Basis person will not catch the Cancelled job.

Thanks.

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
728

Hi ,

raise a error message of type E , to see the reason just select the job and click the job log button in the tool bar.

Read only

brad_bohn
Active Contributor
0 Likes
728

Does the email processing have to occur within the same job? Why not establish a polling process for cancelled jobs where you control the job name(s) to poll for and the linked users to email? When you find a canceled job you can read the job log messages (assuming you have logged your errors using 'S' messages and then used a final 'E' message to stop the job) using function BP_JOBLOG_READ. You could establish a spool from that (and attach it) or just embed the messages in the email body itself.

I'm not sure what your scenario is though - I would separate application errors from technical errors in your error notification process, i.e., handle error notification/emailing within your programs themselves and avoid abending jobs if possible. Are these Basis-handled errors or user-handled errors that you're talking about?

Edited by: Brad Bohn on Aug 19, 2010 3:51 PM

Read only

Former Member
0 Likes
728

In case of either an Abend Message(Type 'A') or a Short Dump Message (Type 'X'), the entire spool list is erased and thereafter unavailable.

In your case you are using Error message (Type 'E') and it should retain a spool. The same logic works perfectly fine in our system.

Just a wild guess, if there is any arrangement in your system to delete the spools for cancelled jobs.

Read only

Former Member
0 Likes
728

We found away to make it work within the way it behaves. Thanks anyway.

Read only

0 Likes
728

I have the same situation. Would you please explain what you did to make it work?

Thanks.