Attribute filled in SWO1 but not in workflow container

'Mark Pyc' Mark.Pyc at bhint.com
Wed Apr 14 06:31:58 EDT 2004


G'day Rob,
 
Word of warning:
I don't really trust the use of the 'global' data of the object to handle
persistence between method calls. Many things can work wonderfully in SWO1
where the transaction ensures that everything remains resident in memory,
but won't work in a live workflow.
 
Even in the case where you have two background methods in a row - forget
that, they can be bundled into a single method.
 
Even if the scenario works in testing of the workflow and the data remains
in memory as desired, in a real situation an error which stops the
workflow between the 'SET' and the use of the attribute will cripple you.
 
As Joc recommends, use a table to store the data. If you don't have a
table, make a new one. If there is no logical key to use, you may need to
use something like WF instance id...??
 
Have fun,
Mark
 
 
 
 
 
"Dart, Jocelyn" <jocelyn.dart at sap.com>
Sent by: SAP Workflow <Owner-SAP-WUG at MITVMA.MIT.EDU>
14/04/2004 08:55
Please respond to SAP Workflow Users' Group
 
 
        To:     SAP-WUG at MITVMA.MIT.EDU
        cc:
        Subject:        Re: Attribute filled in SWO1 but not in workflow container
 
 
Hi Rob,
Um...what's your attribute code to read the Logid attribute?
 
Normally attributes are read from the database or calculated.
So you would normally have your method update the appropriate table.
Otherwise the data won't be persistent.
 
You could try using an object-private-
intermediate field to hold the data and see if that works in your given
scenario.
Should be ok if the object doesn't get refreshed or re-instanced in the
meantime.
 
However it would be safer to save the data somewhere.
 
Jocelyn
 
-----Original Message-----
From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of
Robert.vande.Berg at nuon.com
Sent: Wednesday,14 April 2004 5:17 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Attribute filled in SWO1 but not in workflow container
 
 
It still doesn't work in the workflow...
The method is now:
 
begin_method set_logid changing container.
 
DATA:
      lognumber LIKE balhdr-lognumber,
      logid LIKE balhdr-lognumber.
swc_get_element container 'LogNumber' lognumber.
logid = lognumber.
swc_set_element container 'LogID' logid.
 
end_method.
 
-----Oorspronkelijk bericht-----
Van: Dart, Jocelyn [mailto:jocelyn.dart at sap.com]
Verzonden: woensdag 14 april 2004 8:58
Aan: SAP-WUG at MITVMA.MIT.EDU
Onderwerp: Re: Attribute filled in SWO1 but not in workflow container
 
 
Rob,
It sets it back into the object (not workflow) container - from which
object
attributes are returned to the workflow.
Try it.
Jocelyn
 
-----Original Message-----
From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of
Robert.vande.Berg at nuon.com
Sent: Wednesday,14 April 2004 4:52 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Attribute filled in SWO1 but not in workflow container
 
 
But that sets the element back into the container, not as an attribute,
does
it??
 
-----Oorspronkelijk bericht-----
Van: 'Mark Pyc' [mailto:Mark.Pyc at bhint.com]
Verzonden: dinsdag 13 april 2004 18:07
Aan: SAP-WUG at MITVMA.MIT.EDU
Onderwerp: Re: Attribute filled in SWO1 but not in workflow container
 
 
Maybe the commented out set of the container element?
 
 
 
 
 
Robert.vande.Berg at nuon.com
Sent by: SAP Workflow <Owner-SAP-WUG at MITVMA.MIT.EDU>
13/04/2004 16:49
Please respond to SAP Workflow Users' Group
 
 
        To:     SAP-WUG at MITVMA.MIT.EDU
        cc:
        Subject:        Attribute filled in SWO1 but not in workflow
container
 
 
Hi all.
 
 
 
I created an attribute LOGID and a method SET_LOGID.
 
The attribute is virtual.
 
 
 
The method works fine when I test it in SWO1, the attribute is filled and
it
can be used in a secondary method for the workflow.
 
But when I test it in the workflow, the attribute is NOT filled. Bindings
are right, so what could be the problem??
 
 
 
The method:
 
BEGIN_METHOD SET_LOGID CHANGING CONTAINER.
 
 
 
DATA:
 
      LOGNUMBER LIKE BALHDR-LOGNUMBER.
 
  SWC_GET_ELEMENT CONTAINER 'LogNumber' LOGNUMBER.
 
  OBJECT-LOGID = LOGNUMBER.
 
*  swc_set_element container LOGNUMBER OBJECT-LOGID.
 
 
 
END_METHOD.
 
 
 
Does anybody know??
 
 
 
Regards,
 


More information about the SAP-WUG mailing list