<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: IDOC_STATUS_WRITE_TO_DATABASE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831208#M662642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When u r calling the FM "IDOC_STATUS_WRITE_TO_DATABASE", program internally checks whether the Database is locked or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case i can see thatLOCK  MODE is EXCLUSIVE, and hence u r getting the exception 'idoc_foreign_lock '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program is internally trying to LOCK the DB table in EXCLUSIVE mode which is already opened by the &amp;lt;b&amp;gt;other user&amp;lt;/b&amp;gt;.unless the other user closes the table u will be able to Lock the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Belwo is the code related to ur FM which is triggering the execption  :&lt;/P&gt;&lt;P&gt;CASE MODE.&lt;/P&gt;&lt;P&gt;    WHEN SHARED.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'ENQUEUE_ES_EDIDOCS'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;             DOCNUM         = DOCNUM&lt;/P&gt;&lt;P&gt;             _SCOPE         = '3'&lt;/P&gt;&lt;P&gt;             &lt;U&gt;WAIT          = WAIT&lt;/U&gt;OPTION&lt;/P&gt;&lt;P&gt;           EXCEPTIONS&lt;/P&gt;&lt;P&gt;             FOREIGN_LOCK   = 04&lt;/P&gt;&lt;P&gt;             others         = 08.&lt;/P&gt;&lt;P&gt;    WHEN EXCLUSIVE.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'ENQUEUE_ES_EDIDOCE'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;             DOCNUM         = DOCNUM&lt;/P&gt;&lt;P&gt;             _SCOPE         = '3'&lt;/P&gt;&lt;P&gt;             &lt;U&gt;WAIT          = WAIT&lt;/U&gt;OPTION&lt;/P&gt;&lt;P&gt;           EXCEPTIONS&lt;/P&gt;&lt;P&gt;             FOREIGN_LOCK   = 04&lt;/P&gt;&lt;P&gt;             others         = 08.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC EQ 04.&lt;/P&gt;&lt;P&gt;    MESSAGE E061 WITH DOCNUM RAISING DOCUMENT_FOREIGN_LOCK.&lt;/P&gt;&lt;P&gt;  elseif sy-subrc eq 08.&lt;/P&gt;&lt;P&gt;    message id sy-msgid type 'A' number sy-msgno&lt;/P&gt;&lt;P&gt;            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;revrt back if any issues,&lt;/P&gt;&lt;P&gt;Rewrad if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2007 06:22:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-03T06:22:04Z</dc:date>
    <item>
      <title>IDOC_STATUS_WRITE_TO_DATABASE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831206#M662640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am using the function module IDOC_STATUS_WRITE_TO_DATABASE&lt;/P&gt;&lt;P&gt;and i am encoutering the exceptions 'idoc_foreign_lock '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could anyone guide me towards understanding why i am geting this exception. i am doing batch input&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;points will be rewarded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 06:10:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831206#M662640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T06:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC_STATUS_WRITE_TO_DATABASE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831207#M662641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 06:21:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831207#M662641</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-10-03T06:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC_STATUS_WRITE_TO_DATABASE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831208#M662642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When u r calling the FM "IDOC_STATUS_WRITE_TO_DATABASE", program internally checks whether the Database is locked or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case i can see thatLOCK  MODE is EXCLUSIVE, and hence u r getting the exception 'idoc_foreign_lock '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program is internally trying to LOCK the DB table in EXCLUSIVE mode which is already opened by the &amp;lt;b&amp;gt;other user&amp;lt;/b&amp;gt;.unless the other user closes the table u will be able to Lock the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Belwo is the code related to ur FM which is triggering the execption  :&lt;/P&gt;&lt;P&gt;CASE MODE.&lt;/P&gt;&lt;P&gt;    WHEN SHARED.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'ENQUEUE_ES_EDIDOCS'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;             DOCNUM         = DOCNUM&lt;/P&gt;&lt;P&gt;             _SCOPE         = '3'&lt;/P&gt;&lt;P&gt;             &lt;U&gt;WAIT          = WAIT&lt;/U&gt;OPTION&lt;/P&gt;&lt;P&gt;           EXCEPTIONS&lt;/P&gt;&lt;P&gt;             FOREIGN_LOCK   = 04&lt;/P&gt;&lt;P&gt;             others         = 08.&lt;/P&gt;&lt;P&gt;    WHEN EXCLUSIVE.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'ENQUEUE_ES_EDIDOCE'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;             DOCNUM         = DOCNUM&lt;/P&gt;&lt;P&gt;             _SCOPE         = '3'&lt;/P&gt;&lt;P&gt;             &lt;U&gt;WAIT          = WAIT&lt;/U&gt;OPTION&lt;/P&gt;&lt;P&gt;           EXCEPTIONS&lt;/P&gt;&lt;P&gt;             FOREIGN_LOCK   = 04&lt;/P&gt;&lt;P&gt;             others         = 08.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC EQ 04.&lt;/P&gt;&lt;P&gt;    MESSAGE E061 WITH DOCNUM RAISING DOCUMENT_FOREIGN_LOCK.&lt;/P&gt;&lt;P&gt;  elseif sy-subrc eq 08.&lt;/P&gt;&lt;P&gt;    message id sy-msgid type 'A' number sy-msgno&lt;/P&gt;&lt;P&gt;            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;revrt back if any issues,&lt;/P&gt;&lt;P&gt;Rewrad if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 06:22:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831208#M662642</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T06:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC_STATUS_WRITE_TO_DATABASE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831209#M662643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello deva and nagaraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it seems i am the one blocking it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well i am using the fm JOB OPEN&lt;/P&gt;&lt;P&gt;followed by SUBMIT RFBIBL00. which inspite having a sy-subrc eq 0, no task is being created in the background&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then  i have used FM JOB_CLOSE followed by fm IDOC_STATUS_WRITE_TO_DATABASE to change the status from 51 to 73&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any idea ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 07:14:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831209#M662643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T07:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC_STATUS_WRITE_TO_DATABASE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831210#M662644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;can u specify more clearly.&lt;/P&gt;&lt;P&gt;its better u paste ur code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Revert back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrads,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 11:32:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831210#M662644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T11:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC_STATUS_WRITE_TO_DATABASE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831211#M662645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you all for your help. it was a problem on shore&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 12:51:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-status-write-to-database/m-p/2831211#M662645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T12:51:44Z</dc:date>
    </item>
  </channel>
</rss>

