<?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: Lock for transaction code. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881884#M51764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It may not be the best way, but maybe you could use the functionality behind transaction code SM01.  Here you can lock/unlock the transaction code. If you look at the program, all it is really doing is updating table TSTC field CINFO.  CINFO = 80 when unlocked,  CINFO = A0 when locked.  You could just update the field accordingly and then call this function module right after.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For locking&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'RSAU_WRITE_SM01_LOG'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;          TCODE           = TSTC-TCODE&lt;/P&gt;&lt;P&gt;          LOCK            = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For unlocking&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'RSAU_WRITE_SM01_LOG'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;          TCODE           = TSTC-TCODE&lt;/P&gt;&lt;P&gt;          UNLOCK            = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This isn't the way I would do it since it is a direct database update, but it is another option.&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jan 2005 15:54:24 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2005-01-07T15:54:24Z</dc:date>
    <item>
      <title>Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881880#M51760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have created screen executed with Transaction code,having few Controls inside screen. &lt;/P&gt;&lt;P&gt;As soon as I enter action(click push button) inside the screen.(ie Transaction code), this transaction screen should be locked, and other users should not use the transaction simultaneously in the present System.&lt;/P&gt;&lt;P&gt;I have to do it inside the ABAP coding. could you please help me how to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2005 03:25:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881880#M51760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-07T03:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881881#M51761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can lock tables for changes or a single line in table.&lt;/P&gt;&lt;P&gt;If your aim is to prevent any changes in a table by other users when one user is already maintaining it than you should use lock object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating a lock object goto transaction code se11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in lock object field write the [E + name of your table] and push create.&lt;/P&gt;&lt;P&gt;In tables tab write the name of your table in the name field and choose a lock mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after creating lock object your &lt;/P&gt;&lt;P&gt;lock   FM will be ENQUEUE_lockobjectname&lt;/P&gt;&lt;P&gt;unlock FM will be DEQUEUE_lockobjectname&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------" /&gt;&lt;P&gt;If it helps please give points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2005 07:17:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881881#M51761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-07T07:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881882#M51762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and in continuation to Fuat Ulugay's answer....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any user has opened the custom transaction, make sure you call the ENQUEUE Function Module. And after calling the FM, check for the sy-subrc, in case that sy-subrc fails, someone has already opened the custom transaction. If it is successful, no one has started the transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subramanian V.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2005 07:46:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881882#M51762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-07T07:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881883#M51763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use function module ENQUEUE_E_TABLE to lock anything.  Make up a key for your transaction.  Maybe the transaction code will work, just make sure the key you make up can never be a real table name.  For example, if your transaction name is ZTRAN, then use key ZTRAN$ as the lock for your transaction.  With the $ in the name, it can never be a real table name.  Then invoke ENQUEUE_E_TABLE passing TABNAME = 'ZTRAN$'.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason you can make up a key is that we are not really locking anything.  We are creating an entry in a lock list that SAP maintains in a central server.  As long as all users of the lock use it correctly, for example, all users use ZTRAN$ as the lock of your transaction, then this will should meet your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Likewise, you use FM DEQUEUE_E_TABLE to release the lock or FM DEQUEUE_ALL to release all or your locks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2005 14:50:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881883#M51763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-07T14:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881884#M51764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It may not be the best way, but maybe you could use the functionality behind transaction code SM01.  Here you can lock/unlock the transaction code. If you look at the program, all it is really doing is updating table TSTC field CINFO.  CINFO = 80 when unlocked,  CINFO = A0 when locked.  You could just update the field accordingly and then call this function module right after.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For locking&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'RSAU_WRITE_SM01_LOG'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;          TCODE           = TSTC-TCODE&lt;/P&gt;&lt;P&gt;          LOCK            = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For unlocking&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'RSAU_WRITE_SM01_LOG'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;          TCODE           = TSTC-TCODE&lt;/P&gt;&lt;P&gt;          UNLOCK            = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This isn't the way I would do it since it is a direct database update, but it is another option.&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2005 15:54:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881884#M51764</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-01-07T15:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881885#M51765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TO use FM ENQUEUE_E_TABLE &lt;/P&gt;&lt;P&gt;I tried Creating Key ZTRAN$, using SE11 in LOCK OBJECT entry.&lt;/P&gt;&lt;P&gt;but it says "non alphanumeric char is not allowed."&lt;/P&gt;&lt;P&gt;I cant create key for my transaction.&lt;/P&gt;&lt;P&gt;Could you please tell me the step to create key.and sample&lt;/P&gt;&lt;P&gt;code to write inside the FM?&lt;/P&gt;&lt;P&gt;Would be great help.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Jan 2005 02:23:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881885#M51765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-08T02:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881886#M51766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No SE11 necessary.  Just invoke function module ENQUEUE_E_TABLE and pass ZTRAN$ to parameter TABNAME.  The function module does not care what TABNAME you pass, the important thing is that another user of your program who also tries to lock ZTRAN$ will be denied.  You can do a where used on the FM to find examples, but you will likely find examples that use a real table name.  That is also fine, but as I mentioned, the FM does not care whether it is a real table or not.  The locking process is matching up names so having a unique key is important.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know how it goes!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Jan 2005 20:35:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881886#M51766</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-08T20:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881887#M51767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai&lt;/P&gt;&lt;P&gt;I used below FM with parameter 'ZTRAN$' for TABNAME as u said.my transaction name is ZTRANS.&lt;/P&gt;&lt;P&gt;Now tell me onething, If same user opens the same transaction again(\n) , transaction opens for simultaneous access.&lt;/P&gt;&lt;P&gt;How to deal this case..will this FM cover this function also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_E_TABLE'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MODE_RSTABLE         = 'E'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   TABNAME              =  'ZTRAN$'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VARKEY               =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_TABNAME            = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_VARKEY             = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  _SCOPE               = '2'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  _WAIT                = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  _COLLECT             = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FOREIGN_LOCK         = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  SYSTEM_FAILURE       = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS               = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jan 2005 05:15:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881887#M51767</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-11T05:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881888#M51768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you /n, the transaction is terminated and all locks invoked by the transaction are released.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you mean /o to open a new mode, then the user is treated as if they are a different userid and the lock request will fail in the new mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jan 2005 16:57:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881888#M51768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-11T16:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lock for transaction code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881889#M51769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please do not forget to award points as you see fit.  Glad to hear that you are getting a lot of good feedback from the forum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jan 2005 14:25:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-for-transaction-code/m-p/881889#M51769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-13T14:25:46Z</dc:date>
    </item>
  </channel>
</rss>

