<?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 How to debug a program exit in a Workflow ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-debug-a-program-exit-in-a-workflow/m-p/2217531#M475651</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;                  How to debug a program exit in a workflow when the workflow is triggered ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Apr 2007 05:15:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-26T05:15:25Z</dc:date>
    <item>
      <title>How to debug a program exit in a Workflow ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-debug-a-program-exit-in-a-workflow/m-p/2217531#M475651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;                  How to debug a program exit in a workflow when the workflow is triggered ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 05:15:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-debug-a-program-exit-in-a-workflow/m-p/2217531#M475651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T05:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug a program exit in a Workflow ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-debug-a-program-exit-in-a-workflow/m-p/2217532#M475652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In 4.6c I did this by creating a function module and a table (zsm50_debug). In the table are just two fields: User name (key), and a flag (yes/no).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION zsm50_debug.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     REFERENCE(Z_DEBUG_USER) LIKE  SY-UNAME
*"----------------------------------------------------------------------
  DATA: z_exit,
        z_debug.

  CLEAR: z_debug.

  DATA: starttime   TYPE t,
        currenttime TYPE t,
        time_passed TYPE i.

  starttime = sy-uzeit.

* Check if debugging is switched on
  SELECT SINGLE debug FROM  zsm50_debug
                      INTO  z_debug
                      WHERE uname = z_debug_user.
* Debugging is switched on:
  IF z_debug = 'X'.
*   Not an endless loop, but it will continue after approx. 1 minute...
*   Plenty of time to go to SM50 to debug the program and continue!
    DO.
*     Change the value of z_exit to 'X' to exit the loop an stay in
*     debug mode.
      IF z_exit = 'X'.
        EXIT.
      ENDIF.
*     To prevent an endless loop (if the user forgot that debugging was
*     switched on in ZSM50_DEBUG, time is measured to allow the program
*     to continue after 2 minutes
      GET TIME FIELD currenttime.
      time_passed = currenttime - starttime.
      IF time_passed &amp;gt; 120.
        WRITE: / '!!!==========================================!!!'.
        WRITE: / '!!!DEBUGGING STILL SWITCHED ON IN ZSM50_DEBUG!!!'.
        WRITE: / '!!!    Program was delayed by two minutes    !!!'.
        WRITE: / '!!!==========================================!!!'.
        EXIT.
      ENDIF.
    ENDDO.
  ENDIF.

ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM reads the table and checks if the flag is switched on. If so, it loops for two minutes. After that, it continues regardless. If not flagged, it continues immediately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way, you can debug any program that is running in the background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In every method I program I add this FM right in the beginning. With authorization for SM50, I can then debug the program (in production it may be difficult to get the correct server, if there are more).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 05:57:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-debug-a-program-exit-in-a-workflow/m-p/2217532#M475652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T05:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug a program exit in a Workflow ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-debug-a-program-exit-in-a-workflow/m-p/2217533#M475653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Edwin for the post, I was struggling all day long to figure out whats going on in my program exit. This really helped me and I appreciate that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 03:31:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-debug-a-program-exit-in-a-workflow/m-p/2217533#M475653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-15T03:31:06Z</dc:date>
    </item>
  </channel>
</rss>

