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

background job ???

Former Member
0 Likes
732

i have an question about the background job.

i have program , the program have a parameter is company.when you run this program, you must input the company.

requirement:

at the same time , if exist two different companies run this program in background ,then allow to run this .

but if at the same time ,if exist two same companies run this program, it is not allowed .

so how to control this in program ?

i have an question about the background job.

i have program , the program have a parameter is company.when you run this program, you must input the company.

requirement:

at the same time , if exist two different companies run this program in background ,then allow to run this .

but if at the same time ,if exist two same companies run this program, it is not allowed .

so how to control this in program ?

7 REPLIES 7
Read only

Former Member
0 Likes
707

when the program runs, use export statement.

EXPORT <value > to memory ID 'MEM_PROG_RUN'

and in the code check the value of the memory to see if the program is already running

Read only

0 Likes
707

Sorry, i can't understand your answer. If my program online run ,this it doesn't apply this to my requirement.

Read only

Former Member
0 Likes
707

Hey Ming,

Does your this prog create a background job?

Regards,

Ravi

Read only

0 Likes
707

No, i will manually create the background job in sm36.

Read only

0 Likes
707

Hi,

You can use the below code:

If not sy-batch is initial.

read the select options to an internal table.

use describe statement to get the no. of entries in Internal table.

if no. of items in itab is more than 1.

use stop.

Thanks,

Sriram Ponna.

Read only

0 Likes
707

sorry ,it also can't resolve my problem .If my select-options have many low values .then under this situation, what can i do ?

Read only

Former Member
0 Likes
707

Hi Ming,

What you can probably try is to lock the Company Code object at the start of the code(Start of selection)

ENQUEUE_ECOP_BUKRS

and at the end of the program deque it using DEQUEUE_ECOP_BUKRS.

at you selection screen, you can validate if the company code are not locked using the same FM: ENQUEUE_ECOP_BUKRS. If it is not locked, you can proceed . Else you can raise an error.

Regards,

Ravi Kanth Talagana