Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Catch and handle ActiveX error

Former Member
0 Likes
424

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

1 REPLY 1
Read only

Former Member
0 Likes
349

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.