2008 Aug 06 4:01 PM
Dear all,
I have a customize program that will perform records insertion into Ztable.
Program will be executed into background with more than one job due to different variant.
My concerns:
1. Since the program running in background for different variant at the same time, and the program is doing the data insertion(for different company code) into same table(Ztable). Will in cause any record insertion failure?
2. How should i declare the lock?
Please comment.
2008 Aug 06 4:22 PM
use fm ENQUEUE_E_TABLE:
example:
...
sptab-tabname = c_sperr.
sptab-varkey = sy-mandt.
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = sptab-tabname
varkey = sptab-varkey
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE x001(000) WITH ...
ENDIF.
hope that helps
Andreas
Dear all,
I have a customize program that will perform records insertion into Ztable.
Program will be executed into background with more than one job due to different variant.
My concerns:
1. Since the program running in background for different variant at the same time, and the program is doing the data insertion(for different company code) into same table(Ztable). Will in cause any record insertion failure?
2. How should i declare the lock?
Please comment.
2008 Aug 06 4:06 PM
2008 Aug 06 4:22 PM
use fm ENQUEUE_E_TABLE:
example:
...
sptab-tabname = c_sperr.
sptab-varkey = sy-mandt.
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = sptab-tabname
varkey = sptab-varkey
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE x001(000) WITH ...
ENDIF.
hope that helps
Andreas
2008 Aug 06 4:41 PM
Hi,
Thanks for your reply. However I'm not looking for a full table locking. For my case, same program running at the same time during the update into same Ztable, full table locking will cause rest of the job fail.
Thanks.
2008 Aug 06 4:49 PM
Write Do 9999 times ..enddo.
enque the table and once the insertion is done ,deque the table.
Ashok
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |