<?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: Catch and handle ActiveX error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-and-handle-activex-error/m-p/2853150#M668679</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;it depends on the return code from the ActiveX object: e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TRY.&lt;/P&gt;&lt;P&gt;    m_returncode = sy-subrc.&lt;/P&gt;&lt;P&gt;    IF m_returncode NE 0.&lt;/P&gt;&lt;P&gt;      GET PROPERTY OF &amp;lt;ActiveX-Object&amp;gt; 'Field' = m_returnvalue.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;catch&lt;/P&gt;&lt;P&gt;   ....&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Dec 2007 17:32:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-03T17:32:36Z</dc:date>
    <item>
      <title>Catch and handle ActiveX error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-and-handle-activex-error/m-p/2853149#M668678</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;My problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&amp;#146;ve got an ActiveX-Object linked to a CL_GUI_Dialogbox_Container  and I&amp;#146;m calling a method of this object via:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;call method call_method&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      method  = 'method'&lt;/P&gt;&lt;P&gt;      p_count = 1&lt;/P&gt;&lt;P&gt;    p1      = param1&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;             cntl_error = 1&lt;/P&gt;&lt;P&gt;             cntl_system_error = 2&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;             &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This methods opens a dialogbox. So far it works all fine.&lt;/P&gt;&lt;P&gt;If the user presses the cancel button, the activex control produces an error (which I have to catch). My problem is that I am not able to catch this error.&lt;/P&gt;&lt;P&gt;Is far as I know it should be possible using this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;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;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;#133;&lt;/P&gt;&lt;P&gt;ENDIF.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that doesn&amp;#146;t work. I always get a runtime error Message_type_x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the logfile you can see that the error (Cancel was Pressed) is generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&lt;/P&gt;&lt;P&gt;IDispatch::Invoke raised exceptionAusnahmefehler aufgetreten&lt;/P&gt;&lt;P&gt;(Error)(25.09.07 15:12:09.672):    &lt;/P&gt;&lt;P&gt;&amp;#133;..    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Error)                       :    Exception fire by : &lt;/P&gt;&lt;P&gt;(Error)                       :    Exception info:Cancel was pressed&lt;/P&gt;&lt;P&gt;(Error)                       :    Exception code:0&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions how to catch this error?&lt;/P&gt;&lt;P&gt;Thank for help in advance.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 13:31:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-and-handle-activex-error/m-p/2853149#M668678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T13:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Catch and handle ActiveX error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-and-handle-activex-error/m-p/2853150#M668679</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;it depends on the return code from the ActiveX object: e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TRY.&lt;/P&gt;&lt;P&gt;    m_returncode = sy-subrc.&lt;/P&gt;&lt;P&gt;    IF m_returncode NE 0.&lt;/P&gt;&lt;P&gt;      GET PROPERTY OF &amp;lt;ActiveX-Object&amp;gt; 'Field' = m_returnvalue.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;catch&lt;/P&gt;&lt;P&gt;   ....&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2007 17:32:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-and-handle-activex-error/m-p/2853150#M668679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-03T17:32:36Z</dc:date>
    </item>
  </channel>
</rss>

