<?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: sample code please in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387870#M188760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Example code for &lt;/P&gt;&lt;P&gt;lock the table&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_EVVBAKE'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_VBAK            = 'E'&lt;/P&gt;&lt;P&gt;   MANDT                = SY-MANDT&lt;/P&gt;&lt;P&gt;   VBELN                = VBAK-VBELN&lt;/P&gt;&lt;P&gt;   X_VBELN              = ' '&lt;/P&gt;&lt;P&gt;   _SCOPE               = '2'&lt;/P&gt;&lt;P&gt;   _WAIT                = ' '&lt;/P&gt;&lt;P&gt;   _COLLECT             = ' '&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   FOREIGN_LOCK         = 1&lt;/P&gt;&lt;P&gt;   SYSTEM_FAILURE       = 2&lt;/P&gt;&lt;P&gt;   OTHERS               = 3&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY 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;Update/insert into your dbase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then unlock the table&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DEQUEUE_EVVBAKE'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_VBAK            = 'E'&lt;/P&gt;&lt;P&gt;   MANDT                = SY-MANDT&lt;/P&gt;&lt;P&gt;   VBELN                = VBAK-VBELN&lt;/P&gt;&lt;P&gt;   X_VBELN              = ' '&lt;/P&gt;&lt;P&gt;   _SCOPE               = '2'&lt;/P&gt;&lt;P&gt;   _WAIT                = ' '&lt;/P&gt;&lt;P&gt;   _COLLECT             = ' '&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   FOREIGN_LOCK         = 1&lt;/P&gt;&lt;P&gt;   SYSTEM_FAILURE       = 2&lt;/P&gt;&lt;P&gt;   OTHERS               = 3&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY 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;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 09 Jul 2006 10:25:30 GMT</pubDate>
    <dc:creator>Manohar2u</dc:creator>
    <dc:date>2006-07-09T10:25:30Z</dc:date>
    <item>
      <title>sample code please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387868#M188758</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 any one give me sample code for the following &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  locking table while updating&lt;/P&gt;&lt;P&gt;  and unlock after the updation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jul 2006 10:13:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387868#M188758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-09T10:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: sample code please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387869#M188759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi zakir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*...locking the table Mbew.&lt;/P&gt;&lt;P&gt;     CALL FUNCTION 'ENQUEUE_E_TABLE'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;               TABNAME        = 'MBEW'&lt;/P&gt;&lt;P&gt;               VARKEY         = V_KEY&lt;/P&gt;&lt;P&gt;          EXCEPTIONS&lt;/P&gt;&lt;P&gt;               FOREIGN_LOCK   = 1&lt;/P&gt;&lt;P&gt;               SYSTEM_FAILURE = 2&lt;/P&gt;&lt;P&gt;               OTHERS         = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IF SY-SUBRC = 1.&lt;/P&gt;&lt;P&gt;       CLEAR V_KEY.&lt;/P&gt;&lt;P&gt;       MESSAGE S999(ZSD) WITH&lt;/P&gt;&lt;P&gt;       'MBEW Table being processed by another User'.&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;*....Modifying table Mbew&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     LOOP AT IT_TABLE.&lt;/P&gt;&lt;P&gt;       UPDATE MBEW SET   LAEPR = IT_TABLE-LAEPR&lt;/P&gt;&lt;P&gt;                   WHERE MATNR = IT_TABLE-MATNR&lt;/P&gt;&lt;P&gt;                     AND BWKEY = IT_TABLE-BWKEY.&lt;/P&gt;&lt;P&gt;     ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*... Unlocking the table Mbew.&lt;/P&gt;&lt;P&gt;     CHECK V_KEY EQ SPACE.&lt;/P&gt;&lt;P&gt;     CALL FUNCTION 'DEQUEUE_E_TABLE'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;               TABNAME        = 'MBEW'&lt;/P&gt;&lt;P&gt;               VARKEY         = V_KEY&lt;/P&gt;&lt;P&gt;          EXCEPTIONS&lt;/P&gt;&lt;P&gt;               SYSTEM_FAILURE = 2&lt;/P&gt;&lt;P&gt;               OTHERS         = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IF SY-SUBRC = 1.&lt;/P&gt;&lt;P&gt;       CLEAR V_KEY.&lt;/P&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;zakir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jul 2006 10:21:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387869#M188759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-09T10:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: sample code please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387870#M188760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Example code for &lt;/P&gt;&lt;P&gt;lock the table&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_EVVBAKE'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_VBAK            = 'E'&lt;/P&gt;&lt;P&gt;   MANDT                = SY-MANDT&lt;/P&gt;&lt;P&gt;   VBELN                = VBAK-VBELN&lt;/P&gt;&lt;P&gt;   X_VBELN              = ' '&lt;/P&gt;&lt;P&gt;   _SCOPE               = '2'&lt;/P&gt;&lt;P&gt;   _WAIT                = ' '&lt;/P&gt;&lt;P&gt;   _COLLECT             = ' '&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   FOREIGN_LOCK         = 1&lt;/P&gt;&lt;P&gt;   SYSTEM_FAILURE       = 2&lt;/P&gt;&lt;P&gt;   OTHERS               = 3&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY 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;Update/insert into your dbase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then unlock the table&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DEQUEUE_EVVBAKE'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_VBAK            = 'E'&lt;/P&gt;&lt;P&gt;   MANDT                = SY-MANDT&lt;/P&gt;&lt;P&gt;   VBELN                = VBAK-VBELN&lt;/P&gt;&lt;P&gt;   X_VBELN              = ' '&lt;/P&gt;&lt;P&gt;   _SCOPE               = '2'&lt;/P&gt;&lt;P&gt;   _WAIT                = ' '&lt;/P&gt;&lt;P&gt;   _COLLECT             = ' '&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   FOREIGN_LOCK         = 1&lt;/P&gt;&lt;P&gt;   SYSTEM_FAILURE       = 2&lt;/P&gt;&lt;P&gt;   OTHERS               = 3&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY 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;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jul 2006 10:25:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387870#M188760</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-07-09T10:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: sample code please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387871#M188761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are looking for locking Z table, then you should create lock objects from SE11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use FM's ENQUEUE_&amp;lt;TABNAME&amp;gt; and DEQUEUE_&amp;lt;TABNAME&amp;gt; for locking and unlocking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to this link for further details&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jul 2006 10:28:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387871#M188761</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-07-09T10:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: sample code please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387872#M188762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zakir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to SE11 and create lock object on the table with specified fields , system will generate 'ENQUEUE... ' and 'DEQUEUE.....' FM's , call those FM's like below :&lt;/P&gt;&lt;P&gt;(with these FM's you can specify row level locking also, which normal system Enqueue/Dequeue FM's will not give)&lt;/P&gt;&lt;P&gt;call function 'ENQUEUE....'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;insert or modify table statements&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'DEQUEUE....'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jul 2006 10:29:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-code-please/m-p/1387872#M188762</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-07-09T10:29:33Z</dc:date>
    </item>
  </channel>
</rss>

