Create an Instance of an ABAP OO Class Object in WF

Dart, Jocelyn jocelyn.dart at sap.com
Tue Dec 20 20:54:43 EST 2005


Hi Roman, 

 
What you need to do is add a CreateInstance method to your class which
executes a 
CREATE OBJECT myclass statement and returns an instance of your class to
the task/workflow.

Don't call the BI_PERSISTENT~FIND_BY_LPOR method - that's purely for
internal 
use by workflow. 

Not having any key may still prove a problem - as workflow uses the LPOR
key to uniquely identify the instance.    
If you don't want a "real" key, just generate a GUID using function
module GUID_CREATE. 
But try it without first.  I've used ABAP OO instances but only with a
key so far. 

Please let us know how you go. 

Regards,
Jocelyn Dart
Senior Consultant
SAP Australia Pty Ltd.
Level 1/168 Walker St.
North Sydney 
NSW, 2060
Australia
T   +61 412 390 267
M   + 61 412 390 267
E   jocelyn.dart at sap.com
http://www.sap.com

The information contained in or attached to this electronic transmission
is confidential and may be legally privileged. It is intended only for
the person or entity to which it is addressed. If you are not the
intended recipient, you are hereby notified that any distribution,
copying, review, retransmission, dissemination or other use of this
electronic transmission or the information contained in it is strictly
prohibited. If you have received this electronic transmission in error,
please immediately contact the sender to arrange for the return of the
original documents. 
Electronic transmission cannot be guaranteed to be secure and
accordingly, the sender does not accept liability for any such data
corruption, interception, unauthorized amendment, viruses, delays or the
consequences thereof.
Any views expressed in this electronic transmission are those of the
individual sender, except where the message states otherwise and the
sender is authorized to state them to be the views of SAP AG or any of
its subsidiaries. SAP AG, its subsidiaries, and their directors,
officers and employees make no representation nor accept any liability
for the accuracy or completeness of the views or information contained
herein. Please be aware that the furnishing of any pricing information/
business proposal herein is indicative only, is subject to change and
shall not be construed as an offer or as constituting a binding
agreement on the part of SAP AG or any of its subsidiaries to enter into
any relationship, unless otherwise expressly stated. 


-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of RomanWeise at gmx.net
Sent: Wednesday, 21 December 2005 4:12 AM
To: sap-wug at mit.edu
Subject: Create an Instance of an ABAP OO Class Object in WF

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




More information about the SAP-WUG mailing list