<?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: Flushing &amp; Cathicng Exceptions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/flushing-cathicng-exceptions/m-p/2653256#M611713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can rely on the SUBRC after calling the directory_create because the flush is already present in it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at the code of the method :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;    call method handle-&amp;gt;call_method&lt;/P&gt;&lt;P&gt;&amp;gt;     exporting&lt;/P&gt;&lt;P&gt;&amp;gt;        method  = 'CreateDirectory'&lt;/P&gt;&lt;P&gt;&amp;gt;        p1      = directory&lt;/P&gt;&lt;P&gt;&amp;gt;        p_count = 1&lt;/P&gt;&lt;P&gt;&amp;gt;        queue_only = ' '&lt;/P&gt;&lt;P&gt;&amp;gt;      importing&lt;/P&gt;&lt;P&gt;&amp;gt;        result = rc&lt;/P&gt;&lt;P&gt;&amp;gt;      exceptions&lt;/P&gt;&lt;P&gt;&amp;gt;        others = 1.&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;gt;      raise cntl_error.&lt;/P&gt;&lt;P&gt;&amp;gt;    endif.&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;gt;    call method cl_gui_cfw=&amp;gt;flush&lt;/P&gt;&lt;P&gt;&amp;gt;      exceptions&lt;/P&gt;&lt;P&gt;&amp;gt;        cntl_system_error = 1&lt;/P&gt;&lt;P&gt;&amp;gt;        cntl_error        = 2&lt;/P&gt;&lt;P&gt;&amp;gt;        others            = 3.&lt;/P&gt;&lt;P&gt;&amp;gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;gt;      raise cntl_error.&lt;/P&gt;&lt;P&gt;&amp;gt;    endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2007 08:50:22 GMT</pubDate>
    <dc:creator>franois_henrotte</dc:creator>
    <dc:date>2007-08-21T08:50:22Z</dc:date>
    <item>
      <title>Flushing &amp; Cathicng Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flushing-cathicng-exceptions/m-p/2653255#M611712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ABAP-Experts,&lt;/P&gt;&lt;P&gt;I have a problem in understanding how to catch exceptions after calling method cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;Why calling "flush": Well, otherwise if there is no FLUSH after directory_create (for example) is called, the value of rc (methods internal return code) is checked prematurely. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here my attempt:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------" /&gt;&lt;P&gt;" Calling method directory_create&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_gui_frontend_services=&amp;gt;directory_create&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        directory                = tmpdir&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        rc                       = returncode&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        directory_create_failed  = 1&lt;/P&gt;&lt;P&gt;        cntl_error               = 2&lt;/P&gt;&lt;P&gt;        error_no_gui             = 3&lt;/P&gt;&lt;P&gt;        directory_access_denied  = 4&lt;/P&gt;&lt;P&gt;        directory_already_exists = 5&lt;/P&gt;&lt;P&gt;        path_not_found           = 6&lt;/P&gt;&lt;P&gt;        unknown_error            = 7&lt;/P&gt;&lt;P&gt;        not_supported_by_gui     = 8&lt;/P&gt;&lt;P&gt;        wrong_parameter          = 9&lt;/P&gt;&lt;P&gt;        others                   = 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      sy-subrc = my_sy_subrc " &amp;lt;=== ???!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------" /&gt;&lt;P&gt;" Calling method flush&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_gui_cfw=&amp;gt;flush&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    cntl_system_error = 1&lt;/P&gt;&lt;P&gt;    cntl_error        = 2&lt;/P&gt;&lt;P&gt;    others            = 3.&lt;/P&gt;&lt;P&gt;"----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      sy-subrc = my_sy_subrc2 " &amp;lt;=== ???!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my problem: How can I be sure to catch the execeptions of method cl_gui_frontend_services=&amp;gt;directory_create (1 to 10), since the flush method has its own exceptions (1 to 3)? After calling flush, I think they are overwritten by the flush exception -- checking them before the flush makes no sense, because the method is probably not executed (Automation queue).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Background: I am writing test-programs for some frontend methods, and want to catch all possible exceptions and to write them in a internal table, so that I can see which method crashes.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope my problem is clear and someone can clarify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jasmin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 09:48:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flushing-cathicng-exceptions/m-p/2653255#M611712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T09:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Flushing &amp; Cathicng Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flushing-cathicng-exceptions/m-p/2653256#M611713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can rely on the SUBRC after calling the directory_create because the flush is already present in it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at the code of the method :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;    call method handle-&amp;gt;call_method&lt;/P&gt;&lt;P&gt;&amp;gt;     exporting&lt;/P&gt;&lt;P&gt;&amp;gt;        method  = 'CreateDirectory'&lt;/P&gt;&lt;P&gt;&amp;gt;        p1      = directory&lt;/P&gt;&lt;P&gt;&amp;gt;        p_count = 1&lt;/P&gt;&lt;P&gt;&amp;gt;        queue_only = ' '&lt;/P&gt;&lt;P&gt;&amp;gt;      importing&lt;/P&gt;&lt;P&gt;&amp;gt;        result = rc&lt;/P&gt;&lt;P&gt;&amp;gt;      exceptions&lt;/P&gt;&lt;P&gt;&amp;gt;        others = 1.&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;gt;      raise cntl_error.&lt;/P&gt;&lt;P&gt;&amp;gt;    endif.&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;gt;    call method cl_gui_cfw=&amp;gt;flush&lt;/P&gt;&lt;P&gt;&amp;gt;      exceptions&lt;/P&gt;&lt;P&gt;&amp;gt;        cntl_system_error = 1&lt;/P&gt;&lt;P&gt;&amp;gt;        cntl_error        = 2&lt;/P&gt;&lt;P&gt;&amp;gt;        others            = 3.&lt;/P&gt;&lt;P&gt;&amp;gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;gt;      raise cntl_error.&lt;/P&gt;&lt;P&gt;&amp;gt;    endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 08:50:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flushing-cathicng-exceptions/m-p/2653256#M611713</guid>
      <dc:creator>franois_henrotte</dc:creator>
      <dc:date>2007-08-21T08:50:22Z</dc:date>
    </item>
  </channel>
</rss>

