‎2008 Oct 14 1:08 PM
Hello everyone,
I would like to know if it is possible to have instances of a class as a part of a controller context. You know, like if you added a service call to a BAPI or a function group, but with method calls to an object instead.
I have a feeling, that it is uncommon to bring Web Dynpro and the object orientation of ABAP Objects together.
For example, i don't want the event handling code of my controllers to call function groups, which in turn make calls to my object oriented model. Is there a way to skip that nasty imperative step?
Sorry for asking questions which may sound vague or naive, I'm kind of a beginner regarding Web Dynpro and ABAP.
cheers,
Jens Barthel
‎2008 Oct 14 2:18 PM
‎2008 Oct 14 2:21 PM
‎2008 Oct 14 10:23 PM
There's no need at all to have function modules in the way.
You can have either controller attributes or context attributes defined as object references, and then call methods from those objects instead...
In both cases, you just have to use TYPE REF TO instead of TYPE when defining the attributes.
Furthermore, if you have a central class through which you interact with your OO model, you can define it as Assistance class and then you'll have an instance automatically in all the controllers...the drawback / advantage is that you do not control its instantiation which is done by the framework.
Regards
Edited by: Alejandro Bindi on Oct 14, 2008 6:23 PM