cancel
Showing results for 
Search instead for 
Did you mean: 

Exceptions instead of events...

Former Member
0 Kudos

Dear Developers,

I wonder if there will be in the next releases of WD4A a way to send to an upperlevel component exceptions from a component. I mean it would be interesting to have the same behavior as events sent from a component to an upperlevel component.

Do you plan to release it ?

Sincerely,

Olivier MATT

PS: I am currently not really dealing with exceptions in my WD components and have to "translate" them manually to events that I have to define.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hi Oliver,

If I am not mistaken, you can already pass on exceptions along the call stack of method calls. Since WDA was implemented using ABAP, we have no control over how exceptions are handled and the normal ABAP way happens, which is quite powerful in its own way.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

Is it possible in a components method to define which exception classes can be raised like in a normal method of an ABAP OO Class?

In the methods of a component, I only have to possibility to define the method name and signature but I have not found any way to define the exceptions which can be raised.

Can you help me ?

Sincerely,

Olivier MATT

Message was edited by:

Olivier Matt

mohammed_anzys
Contributor
0 Kudos

Hi oliver,

In components you cannot mention the exceptions as an attribute, but you could do it in your code that you write.And acording to the exceptions you can invoke events of your choice.

As you said , it would be a beautiful functionality if they could implement exceptions at the UI level methods.

Cheers

Anzy

Former Member
0 Kudos

Hi Olivier.

I have posted a similar question some months ago:

You are not able to define it in the signature and therefore you can not raise an

exception in view/component controller methods. But if you rauise them in a

normal abap class you as (as model) you can catch it in all clalling stages.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sascha,

Thanks for the info again

Olivier MATT

thomas_szcs
Active Contributor
0 Kudos

Hi Sascha,

By rereading the old thread, something came to my mind. How about the usage of dynamic exceptions? From my understanding, it should be possible to throw/catch them without declaring them in advance.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas.

Good point. If you set CX_NO_CHECK as parent class of the exception it should

be working.

HELP:

Exceptions that are defined using subclasses of CX_NO_CHECK must not be declared explicitly in the interface of the procedure. The class CX_NO_CHECK and its subclasses are implicitly always declared and are always propagated.

Cheers,

Sascha

mohammed_anzys
Contributor
0 Kudos

Thread is getting interesting ...:-)

Message was edited by:

Mohammed Anzy S

Answers (0)