<?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: error when executing transaction with same parameter value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323178#M510302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the field to get the session id .. i know username is sy-uname&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2007 18:59:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-13T18:59:24Z</dc:date>
    <item>
      <title>error when executing transaction with same parameter value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323172#M510296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a transaction which executes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;parameters: p_kunnr type kna1-kunnr.

start-of-selection.
write:/ p_kunnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if a user is executing the transaction with a specific value for kunnr, and then another user executes the transaction with the same value for kunnr, then second user should receive error msg. If the first user exits from transaction, then second user can execute transaction and view kunnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 18:30:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323172#M510296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-13T18:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: error when executing transaction with same parameter value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323173#M510297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Megan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hmmmm...sounds strange. Is this the correct requirement. I dont understand why we should block someone from displaying a customer when another person is viewing it. Are you sure  you are talking about display NOT change?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 18:34:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323173#M510297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-13T18:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: error when executing transaction with same parameter value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323174#M510298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the program name is not too long, you can try something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001 .

data: name type trdir-name.

parameters: p_kunnr type kna1-kunnr.

at selection-screen.

  concatenate sy-repid p_kunnr into name.

  call function 'ENQUEUE_E_TRDIR'
    exporting
*   MODE_TRDIR           = 'X'
      name                 = name
*   X_NAME               = ' '
*   _SCOPE               = '2'
*   _WAIT                = ' '
*   _COLLECT             = ' '
   exceptions
     foreign_lock         = 1
     system_failure       = 2
     others               = 3
            .
  if sy-subrc &amp;lt;&amp;gt; 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.



start-of-selection.
  write:/ p_kunnr.

&lt;/CODE&gt;&lt;/PRE&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>Wed, 13 Jun 2007 18:37:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323174#M510298</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-13T18:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: error when executing transaction with same parameter value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323175#M510299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well this is a test program, only one user infact only one session should be able to execute the transaction for a specific value &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking something like store the userid and session number and set flag as X &lt;/P&gt;&lt;P&gt;as long as flag is X, as long as flag is X no one else will be able to run transaction for the same value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 18:49:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323175#M510299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-13T18:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: error when executing transaction with same parameter value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323176#M510300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure you can do that too, set a flag and pass it off to memory using EXPORT statement, then simply check this flag using the IMPORT statement.  You can use the lock object as well.&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>Wed, 13 Jun 2007 18:58:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323176#M510300</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-13T18:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: error when executing transaction with same parameter value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323177#M510301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what the function module does&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 18:58:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323177#M510301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-13T18:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: error when executing transaction with same parameter value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323178#M510302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the field to get the session id .. i know username is sy-uname&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 18:59:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323178#M510302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-13T18:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: error when executing transaction with same parameter value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323179#M510303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The function module is nothing more than a lock object for the table TRDIR, all this does it puts an entry in SM12 saying that this program is currently locked by a user.  You would be just taking it one step further and applying the value of P_KUNNR to the NAME field and passing this as the program name,  so then you are saying that the lock applies to this program and this value of P_KUNNR.  That's really it.   If another user comes along and do this program with the same value, the lock object will fail and give a mesasge saying that User 1 is currently locking the object.&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>Wed, 13 Jun 2007 19:00:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-executing-transaction-with-same-parameter-value/m-p/2323179#M510303</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-13T19:00:38Z</dc:date>
    </item>
  </channel>
</rss>

