2007 Dec 14 8:39 AM
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 ?
2007 Dec 14 8:49 AM
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
2007 Dec 17 1:42 AM
Sorry, i can't understand your answer. If my program online run ,this it doesn't apply this to my requirement.
2007 Dec 17 5:57 AM
Hey Ming,
Does your this prog create a background job?
Regards,
Ravi
2007 Dec 17 7:50 AM
2007 Dec 17 7:57 AM
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.
2007 Dec 18 1:09 AM
sorry ,it also can't resolve my problem .If my select-options have many low values .then under this situation, what can i do ?
2007 Dec 18 1:29 AM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |