<?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 Locking Program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543109#M1265810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have program called ZLOADFILE   and it runs in background. my requirement is when i schedule the program ZLOADFILE in background ,i have to check if this program is already been running in background by any user , if it is already running then my job should be cancelled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me know if there is any functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 May 2009 06:51:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-01T06:51:22Z</dc:date>
    <item>
      <title>Locking Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543109#M1265810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have program called ZLOADFILE   and it runs in background. my requirement is when i schedule the program ZLOADFILE in background ,i have to check if this program is already been running in background by any user , if it is already running then my job should be cancelled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me know if there is any functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2009 06:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543109#M1265810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-01T06:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Locking Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543110#M1265811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I think, you can create some table and define lock object for it with &lt;EM&gt;write&lt;/EM&gt; mode.&lt;/P&gt;&lt;P&gt;In program you should place code of locking that table.&lt;/P&gt;&lt;P&gt;After attempt of setting lock, check &lt;EM&gt;FOREIGN_LOCK&lt;/EM&gt; exception of&lt;/P&gt;&lt;P&gt;corresponding function module.&lt;/P&gt;&lt;P&gt;If exception is raised, this means that one program already works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2009 07:22:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543110#M1265811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-01T07:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Locking Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543111#M1265812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a lock entry while running the program so that other users may not be able to run ur program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to create one lock object and using the generated function module which sounds like enqueue_*****&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lock the program from being executed by another user while running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To chk whether ur lock is successful or not goto tcode sm12 and chk the entries.if its successful u will find an entry with program name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2009 07:28:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543111#M1265812</guid>
      <dc:creator>former_member209217</dc:creator>
      <dc:date>2009-05-01T07:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Locking Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543112#M1265813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the Following FM to check wether the program is locked or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'ENQUEUE_READ'
    EXPORTING
      gclient               = ' '
      gname                 = 'TRDIR'
      garg                  = lw_uname
      guname                = ' '
    TABLES
      enq                   = lt_locked
    EXCEPTIONS
      communication_failure = 1
      system_failure        = 2
      OTHERS                = 3.

  IF sy-subrc = 0.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2009 08:24:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locking-program/m-p/5543112#M1265813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-01T08:24:17Z</dc:date>
    </item>
  </channel>
</rss>

