Application Development 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: 

how to prevent to process a job in sm37 when it's already running there.

Former Member
0 Kudos

I want generate a error message and stop the processor when a job is execute in sm37 while same job is there(not cancled or stopped).

for this purpose I want to use some function or some thing......

I had used some function for this purpose but they are just blocking on released condition.I mean when we execute a job for sm37 as immediate ,it's job status become active in sm37.And my function gives no of job return 0 ,so it's allowing second time to execute in sm37 also which I don't want.

currently i used following function

CALL FUNCTION 'C14Z_BATCH_JOB_EXIST_CHECK'

EXPORTING

I_JOBSEL_PARAM_IN = ITAB_JOB

I_REPORT_NAME = 'ZFI01UPA_OPT'

IMPORTING

E_NUMBER_OF_JOBS_FOUND = E

here it's (E) = 0,when job status is active in sm37,otherwise working properly.

So I need some another functions or way(except lock object) to solve this urgent problem?

Please suggest me as soon as possible.

2 REPLIES 2

Former Member
0 Kudos

Please try this.

SM50 -> Select corresponding your PID -> Process (Menu) -> Cancel without core

<b>Reward points</b>

Regards

0 Kudos

Dear Friend,

Thanks for reply.

I want a dynamically solution for this purpose.I don't want to manually do somethings.

See,what my logic is?

I want to prevent to process a job in sm37 if its in active,release , schedule and reday status there.I don't want to process a job at same time when its already there and further I want to generate a error message there on my screen.

Please suggest me.