<?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 Execution to be continued based on condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827111#M1470882</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; My program has to be wait  in particular line based on condition.&lt;/P&gt;&lt;P&gt; The condition is If this program is running already in another instance, this program has to be wait &lt;/P&gt;&lt;P&gt; till that instance is finished its processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ramakrishna L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Mar 2010 17:38:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-28T17:38:11Z</dc:date>
    <item>
      <title>Execution to be continued based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827111#M1470882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; My program has to be wait  in particular line based on condition.&lt;/P&gt;&lt;P&gt; The condition is If this program is running already in another instance, this program has to be wait &lt;/P&gt;&lt;P&gt; till that instance is finished its processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ramakrishna L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Mar 2010 17:38:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827111#M1470882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-28T17:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Execution to be continued based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827112#M1470883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rama&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on this particular condition your report has to set a lock entry.&lt;/P&gt;&lt;P&gt;For example, the lock object E_RSCATGLX is explictly used to "Lock Report RSCATGLX Against Parallel Execution".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could "abuse" this lock object by simply using your report name as argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, you logic could look like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...
START-OF-SELECTION.

DO.
  CALL FUNCTION 'ENQUEUE_E_RSCATGLX'
     EXPORTING
          RSCATGLX = &amp;lt;name of your report&amp;gt;
EXCEPTIONS
              FOREIGN_LOCK
              SYSTEM_FAILURE.
  IF ( syst-subrc = 0 ).
    EXIT.  " leave DO loop
  ELSE.
    WAIT UP TO 5 SECONDS.
  ENDIF.

ENDDO.
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course you should define a time-out (e.g. 100x 5 seconds) to avoid an endless loop in case that the foreign lock is never removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Mar 2010 19:51:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827112#M1470883</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-03-28T19:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Execution to be continued based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827113#M1470884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Along with this you should also use the parameter wait = 'X' in the call function which waits for some time to check if the lock gets released and rest the above process is fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 06:19:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827113#M1470884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T06:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Execution to be continued based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827114#M1470885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : prg type INDX-SRTFD value 'ZTEST1_CHECJ'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if count ne 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_ESINDX'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   MODE_INDX            = 'E'&lt;/P&gt;&lt;P&gt;   MANDT                = SY-MANDT&lt;/P&gt;&lt;P&gt;   RELID                = 'ZZ'&lt;/P&gt;&lt;P&gt;   SRTFD                = prg                     " program name&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  SRTF2                =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_RELID              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_SRTFD              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_SRTF2              = ' '&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;/UL&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;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;else.&lt;/P&gt;&lt;P&gt; exit.&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can i use this ?&lt;/P&gt;&lt;P&gt;If it is use can i give function module name in the SRTFD field instead of program name?&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;Ramakrishna L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 06:34:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execution-to-be-continued-based-on-condition/m-p/6827114#M1470885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T06:34:46Z</dc:date>
    </item>
  </channel>
</rss>

