Create an Instance of an ABAP OO Class Object in WF

Mike Pokraka wug.replies at workflowconnections.com
Tue Dec 20 15:23:25 EST 2005


Hi Roman,
Do you need an instance? If not you could just leave your methods static.

Otherwise I've found it best to just define all the BI stuff even though
it says it should work it just dies when something's missing.
So you should need a public static method 'getinstance' which simply
returns an instance of itself.

LPOR and FIND_BY_LPOR are definitely necessary if you're going to
instantiate it, WF will call it every time it switches contexts. You
should be able to implement them without keys, but have to at least return
a valid instance for FIND_BY_LPOR and a valid ref for LPOR.

Cheers
Mike

RomanWeise at gmx.net wrote:
> Hallo,
>
> after using static methods of ABAP classes in workflow steps I now wanted
> to
> give instance methods a try, which resulted in quite a lot of unexpected
> problems.
>
> I build an ABAP class including the IF_WORKFLOW interface on a 6.40
> system.
> The object is supposed to be anonymous that means I do not use the
> persistency service or even a key as it's just supposed a helper class (my
> document on ABAP Class in WF says that is an allowed technique). Then I
> defined an element of the workflow container of this class type.
>
> First I tried to create the workflow instance by using TS51900010 (generic
> instanciate) but of course that does only work for BOR objects. So I
> looked
> for a standard task doing this for ABAP Class objects without any success.
>
> Next try was calling the BI_PERSISTENT~FIND_BY_LPOR of the object in a
> container step which resulted in an error message that the value I handed
> for the LPOR importing parameter had the wrong type although they have the
> same type.
>
> Then I tried to use a special get_instance method at my ABAP class as
> wrapper for BI_PERSISTENT~FIND_BY_LPOR w/o importing parameter as I need
> no
> key for the object. But this only works if the return value of this method
> is typed like the classtype. If I use BI_PERSISTENT the workflow builder
> says the type does not exist.
>
> Ok, this at least made the workflow passing this step and putting an
> instance of my object in the workflow container. But the next step which
> executes a method of the instance ends in error state. I debugged the
> workflow for about 2 or 3 hours but just found out that there seems to be
> a
> lot of mess in there as the workflow lacks a SIBFLPOR key of the object.
>
> I am really desperated as the worklow is supposed to run till the end of
> the
> week. I know that all of that sounds like opening a lot of OSS messages
> but
> I dont think I'll get a solution this year.
>
> If someone knows a standard task to create the instance or a set of
> workarounds to get this running, please share your knowledge.
>
> Thanks a lot
>
> Roman Weise
> Tech Consultant
>
>
> --
> GMX DSL-Flatrate 1 Jahr kostenlos* + WLAN-Router ab 0,- Euro*
> Bis 31.12.2005 einsteigen! Infos unter: http://www.gmx.net/de/go/dsl
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>


Mike Pokraka
Senior Consultant
Workflow Connections Ltd.
Mobile: +44 (0)7786 910 855



More information about the SAP-WUG mailing list