Skip to Content
0
Jun 06, 2012 at 01:31 AM

trying to use subclass in workflow, but superclass is instantiated

35 Views

As time goes on, I'm gradually switching my new workflow developments to OO, just to see what the benefits are.

Not sure I've found any yet... :-)

Anyway, I have just run into a strange problem. I have defined a superclass ZCL_CLASS and a subclass ZCL_SUB_CLASS.

The subclass inherits all the methods of the superclass, and you can redefine them, which is good. However I've noticed that you can't redefine the critical method BI_PERSISTENT~FIND_BY_LPOR, because it is a 'static' method.

This causes a big problem when I start a workflow containing a ZCL_SUB_CLASS object, because I've found that FIND_BY_LPOR instantiates an object of type ZCL_CLASS in the container!

The workflow therefore runs into an error when it tries to execute <SuperclassObject>->MY_SUBCLASS_METHOD... it reports that the method does not exist.

I must be doing something wrong.. but what is it?

merci,

Paul Bakker