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

Stop a job from program.

Former Member
0 Likes
501

Hi All,

I am using the FM - SXPG_COMMAND_EXECUTE , to execute an unix commands from my report program.

If there are any errors in the execution of the commds , i am capturing them and stopping the execution of program using STOP.

The report is being run as backgroung job.

Even though STOP is executed in the report, in SM37 the status of the job is shown as finished.

I want the status of the job to be cancelled when the program encounters STOP or when the execution of unix commands fails.

Can you please tell me how to make the job as cancelled when the execution of unix commands fails.

Regards,

Chandan

3 REPLIES 3
Read only

former_member194669
Active Contributor
0 Likes
454

Hi,

Instead of using STOP in program use

Message e999(<your message class>) with 'Erorr during execution"

aRs

Read only

Former Member
0 Likes
454

Hi ARS,

If i use the mesaege, will it

1) stop the further ececution of program?

2) Will the status fo the job be 'Cancelled' in SM37.

Please let me know

Chandan

Read only

0 Likes
454

Hi,

Yes you are right.

aRs