cancel
Showing results for 
Search instead for 
Did you mean: 

Raising clause in component controller method

Former Member
0 Kudos

Hi all.

I am currently trying to raise an exception in a component controller method which

has to be catched by the calling viewcontroller. But I can't find a way to define

the raise clause. Am i blind or is this not possible?

Thank you in advance.

Cheers,

Sascha

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hi Sascha,

This is not possible. The view designer does not support everything that is supported by ABAP OO (like static methods or attributes, constant values, catching any event of any class, etc). Main reasons are that either a certain feature does not fit into WD (static methods) or violates the holy grail of platform independence of WD in ABAP and Java. In WDJ you won't be able to define two methods that have the same name (although the Java language would support it in contrast to ABAP).

Anyways, there have been small expections to this rule in order to adopt WD better to a specific platform. Nonetheless, it would be strange to completely rebuild the ABAP class builder for the purpose of enabling all kinds of ABAP OO language features within the Web Dynrpo design time. Of course, it is obvious that every developer wants to use exceptions, optional parameters, constant values, etc. Hence the assistance class concept was introduced. It doesn't mean that we won't add optional parameters, exceptions or refactoring in future. It means that the assistance class is the (already existing) place to unleash the full power of ABAP OO and all the powerful features that come along with using the class builder such as the refactoring framework and much, much more. The assistance class allows for an easy and convinient integration of ABAP OO into the WDA environment and it's highly advised to use it.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas.

Thanks for the answer. It is pretty dissapointing but ok. I just wanted to forward the exception which is raised by a model method. So I catch it in the comp controller method and just return the message.

Cheers,

Sascha

Answers (1)

Answers (1)

SergioFerrari
Active Contributor
0 Kudos

You are not blind, I think the following post is very interesting:

https://forums.sdn.sap.com/click.jspa?searchID=644915&messageID=2774067

Sergio