Skip to Content
author's profile photo Former Member
Former Member

Catch and handle ActiveX error

Hi,

My problem:

I’ve got an ActiveX-Object linked to a CL_GUI_Dialogbox_Container and I’m calling a method of this object via:

<i>call method call_method

exporting

method = 'method'

p_count = 1

p1 = param1

exceptions

cntl_error = 1

cntl_system_error = 2</i>

.

This methods opens a dialogbox. So far it works all fine.

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.

Is far as I know it should be possible using this:

<i>CALL METHOD CL_GUI_CFW=>FLUSH

EXCEPTIONS

CNTL_SYSTEM_ERROR = 1

CNTL_ERROR = 2

others = 3

.

IF SY-SUBRC <> 0.

…

ENDIF.</i>

But that doesn’t work. I always get a runtime error Message_type_x.

Looking at the logfile you can see that the error (Cancel was Pressed) is generated.

<i>

IDispatch::Invoke raised exceptionAusnahmefehler aufgetreten

(Error)(25.09.07 15:12:09.672):

…..

(Error) : Exception fire by :

(Error) : Exception info:Cancel was pressed

(Error) : Exception code:0</i>

Any suggestions how to catch this error?

Thank for help in advance.

Regards

David

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 05:32 PM

    hi,

    it depends on the return code from the ActiveX object: e.g.

    TRY.

    m_returncode = sy-subrc.

    IF m_returncode NE 0.

    GET PROPERTY OF <ActiveX-Object> 'Field' = m_returnvalue.

    ENDIF.

    catch

    ....

    ENDTRY.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.