Container Operation

Dart, Jocelyn jocelyn.dart at sap.com
Tue Apr 17 00:24:24 EDT 2001


Hi Mike/Alon/Paul,
Rather than create a special method, you can instead use a task with:
 
Object SYSTEM
Method GENERICINSTANTIATE
 
This method is available for R/3 4.0 systems and above.
 
You need to pass in your object key as parameter ObjectKey (move your po
number
to here - it should give you a binding warning because the field lengths
will be different
but that's ok),
your object type as parameter ObjectType (i.e. "BUS2012")
 
The method returns ObjectInstance which is your object instance - you just
pass this to
your container element with object type BUS2012.
 
The big bonus of setting up a SYSTEM.GENERICINSTANTIATE task is you can then
use it
anywhere you need to generate an object instance from a key WITHOUT having
to create
special methods per object type.
 
Not sure what release you are on, but try looking for standard task
TS10008082 in
workflow WS10000193 as this gives an example.
 
Regards,
        Jocelyn Dart
Consultant (BBP, Ecommerce, Internet Transaction Server, Workflow)
SAP Australia
Email jocelyn.dart at sap.com <mailto:jocelyn.dart at sap.com>
Tel: +61 412 390 267
Fax: +61 2 9935 4880
 
 
-----Original Message-----
From: Raskin, Alon (Soliance) [mailto:ARaskin at cps-satx.com]
Sent: Tuesday, 17 April 2001 2:11 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Container Operation
 
 
You will need to create a method for BUS2012 called (example) CreateFromID.
The method will have one importing parameter which is the key (ekko-ebeln)
and the method will instantitate the object. The other possibility is to see
whether you have had the object reference previously (ie. triggering event)
and use the object reference from there.
 
Pseudo Code for CreateFromID.
 
swc_get_element container 'PONumber' lv_ponumber.
 
swc_create_object self 'BUS2012' lv_ponumber.
 
swc_refersh_objecet self.
 
end of method.
 
I have not tested the above code in the debugger but I have dont it before.
If the line "swc_create_object self...." does not work (check that self has
a valid handle) then replace it with "SWC_SET_OBJECTKEY lv_ponumber'.
 
It is very important for us (as workflow developers) to ensure that we use
the objects in our workflow and not store keys in our container. This causes
problems such as the one below because you can not execute a method (in this
case EDIT) on a key field, you must have the object.
 
Let me know if you have any fruther concerns.
 
Regards,
 
Alon Raskin (xtn. 3183)
Workflow Advisor - Soliance
 
 
-----Original Message-----
From: Mike Mathieson [mailto:msmathieson at hotmail.com]
Sent: Monday, 16 April 2001 11:00
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Container Operation
 
 
Specifically, I have my PO number and in my container element defined like
ekko-ebeln and I want to use BUS2012.EDIT to edit my PO.  But I can't move
my PO number to the _WI_Object_Id for this task.  What's the easiest way to
accomplish this?
 
 
>From: "Raskin, Alon (Soliance)" <ARaskin at cps-satx.com>
>Reply-To: SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: Container Operation
>Date: Mon, 16 Apr 2001 10:42:58 -0500
>
>Hi Mike,
>I am not sure I totally understand your question.... Are you saying you
>have
>the key to an object and you want to create the object? Or are you saying
>that you you want to change the key of an object variable (which already
>has
>a key) to a value that you have stored in a data variable (I assume that
>the
>key field and the data variable are the same type)?
>
>Regards,
>
>Alon Raskin (xtn. 3183)
>Workflow Advisor - Soliance
>
>
>-----Original Message-----
>From: Mike Mathieson [mailto:msmathieson at hotmail.com]
>Sent: Monday, 16 April 2001 10:15
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Container Operation
>
>
>Is there a way to move a value from a data type referenced element in a
>workflow container to a key field of an Object type referenced element?
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com
 
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
 


More information about the SAP-WUG mailing list