10-03-2007 7:10 AM
hello experts,
i am using the function module IDOC_STATUS_WRITE_TO_DATABASE
and i am encoutering the exceptions 'idoc_foreign_lock '
could anyone guide me towards understanding why i am geting this exception. i am doing batch input
thank you.
points will be rewarded
regards
priya
10-03-2007 7:21 AM
Hi priya,
U r getting this message becuase "The IDoc is currently blocked."the idoc number which u r reading is currently blocked,thats why u r getting this message..Try with other idoc number and check..also check the documentation of the FM "EDI_DOCUMENT_OPEN_FOR_PROCESS"
Regards,
Nagaraj
10-03-2007 7:21 AM
Hi priya,
U r getting this message becuase "The IDoc is currently blocked."the idoc number which u r reading is currently blocked,thats why u r getting this message..Try with other idoc number and check..also check the documentation of the FM "EDI_DOCUMENT_OPEN_FOR_PROCESS"
Regards,
Nagaraj
10-03-2007 7:22 AM
Hi,
When u r calling the FM "IDOC_STATUS_WRITE_TO_DATABASE", program internally checks whether the Database is locked or not.
In your case i can see thatLOCK MODE is EXCLUSIVE, and hence u r getting the exception 'idoc_foreign_lock '.
Program is internally trying to LOCK the DB table in EXCLUSIVE mode which is already opened by the <b>other user</b>.unless the other user closes the table u will be able to Lock the table.
Belwo is the code related to ur FM which is triggering the execption :
CASE MODE.
WHEN SHARED.
CALL FUNCTION 'ENQUEUE_ES_EDIDOCS'
EXPORTING
DOCNUM = DOCNUM
_SCOPE = '3'
WAIT = WAITOPTION
EXCEPTIONS
FOREIGN_LOCK = 04
others = 08.
WHEN EXCLUSIVE.
CALL FUNCTION 'ENQUEUE_ES_EDIDOCE'
EXPORTING
DOCNUM = DOCNUM
_SCOPE = '3'
WAIT = WAITOPTION
EXCEPTIONS
FOREIGN_LOCK = 04
others = 08.
ENDCASE.
IF SY-SUBRC EQ 04.
MESSAGE E061 WITH DOCNUM RAISING DOCUMENT_FOREIGN_LOCK.
elseif sy-subrc eq 08.
message id sy-msgid type 'A' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
revrt back if any issues,
Rewrad if helpful.
regards,
Naveen
10-03-2007 8:14 AM
hello deva and nagaraj,
it seems i am the one blocking it.
any suggestion?
well i am using the fm JOB OPEN
followed by SUBMIT RFBIBL00. which inspite having a sy-subrc eq 0, no task is being created in the background
then i have used FM JOB_CLOSE followed by fm IDOC_STATUS_WRITE_TO_DATABASE to change the status from 51 to 73
any idea ?
regards
priya
10-03-2007 12:32 PM
hi,
can u specify more clearly.
its better u paste ur code.
Revert back.
Regrads,
Naveen
10-03-2007 1:51 PM
hello experts,
thank you all for your help. it was a problem on shore
regards
priya