start condition with virtual attribute doesn't work (resend)

Mark Pyc mark_pyc at gillette.com
Fri Sep 24 09:27:06 EDT 2004


G'day Wiz,
 
Sorry if this is a resend from this morning, but the list seems to be
playing up again.
 
Make sure that your attribute doesn't rely on data from another attribute
or if it does make sure you perform a SWC_GET_PROPERTY ... SELF before
using the value. There is no guarantee of the order in which attributes are
evaluated.
 
There have been previous discussions about the fact that in certain cases
(like SWO1 tests I think) attributes are calculated twice. This may be why
sometimes these attributes resolve and other times they don't. With a
double pass almost all cross-attribute reliance problems should be
resolved. However if it doesn't always happen then it's just plain
confusing.
 
Can't guarantee that's the problem, but worth a look.
 
Have fun,
Mark
 
 
 
                      Wiz David
                      <yidysap at yahoo.com>         To:      SAP-WUG at MITVMA.MIT.EDU
                      Sent by: SAP                cc:
                      Workflow                    Subject: Re: start condition with virtual attribute doesn't work
                      <Owner-SAP-WUG at MITV
                      MA.MIT.EDU>
 
 
                      24 Sep 2004 14:05
                      Please respond to
                      SAP Workflow Users'
                      Group
 
 
 
 
 
 
Hi Viktor & Robert,
 
 
 
Thanks for yours response .
 
 
 
About yours questions in my Business object I have a virtual attribute the
used two field with value one amount another its price (virtual attribute =
price * amount).  The WF start from Fun  SWE_EVENT_CREATE  for all new line
(the user has SAP_ALL) after that I created a start condition via
transaction SWB_COND for a workflow and here I also asked on the virtual
attribute to decide if to start or not (z_virtual_value > 5000).
 
 
 
What I can do to be sure that always before the start condition  execute my
virtual attribute will generated(I don t want to do that in my program that
start the Fun SWE_EVENT_CREATE)?
 
 
T.I.A
 
Wiz
 
Viktor Smusin <Viktor_Smusin at atlantm.com> wrote:
 
 
 
 
Hi, Wiz!
 
I'm dealing with a similar problem right now. I guess your problem is the
same as me: the code that calculates your virtual attribute requires some
authorizations. And for the "Condition" step type the user who performs
this code isn't necessarily WF-BATCH, and it doesn't necessarily have the
required authorizations. I've made several tests and it looks like the user
performing the code for this step type is the same user who was the agent
for the previous "Activity" step type.
 
I found 3 ways of solving this problem:
 
1. Rearrange your workflow so that the "Activity"-step previous to your
"Condition"-step is a background step. If it's so, then both steps are
performed by WF-BATCH which has SAP_ALL authorizations.
 
2. A more universal way. Add a method to your business object interface
which checks your condition and returns "X" if it's true or " " otherwise.
Create a background single-step task which calls this method. Then add an
element to your workflow's container which holds the values of the same
type. And just before your condition check in the workflow place an
"Activity"-step which calls this method. And in the condition itself check
the value of the container element, not of your virtual attribute (you
doesn't need it anymore).
 
3. Similar like 2., but specify a result parameter for your method with a
reference to an ABAP Dictionary field which has a domain that can hold 2
different values: "X" and " ". For example, you can specify the reference
to the field RSDXX-MARK. And instead of your "Condition" step type place an
"Acitvity" step type in your workflow. Then you'll have 2 branches after
this step which correspond to the 2 variants of the result of your
condition.
 
Hope that helps.
 
I'd like to know more exactly who is the user which performes the code
calculating the virtual attribute in the "Condition" step type, though. Am
I right that it's the agent for the last "Activity" step performed in the
WF?
 
Viktor Smusin
Minsk, Belarus
 
 
 
 
Wiz David
To: SAP-WUG at MITVMA.MIT.EDU
Sent by: SAP cc: (bcc: Viktor Smusin/072/Minsk/AtlantM-Inc)
Workflow Subject: start condition with virtual attribute doesn't work
MA.MIT.EDU>
 
 
24.09.2004 08:23
Please respond to
SAP Workflow Users'
Group
 
 
 
 
 
 
Hi all,
 
 
 
While I create start condition that was based on virtual attribute I found
that it s ignore my condition. Further More I see in the log the virtual
attribute with the correct value,
 
Its looks like that in runtime it s not calculate the value yet. but when
we go inside the log it s already calculated.
 
If I m changing the condition as to be based on data based attribute it
works fine.
 
Even inside the workflow if the first step it s condition on virtual
attribute it s ignore my condition although in log I see value on my
virtual attribute.
 
 
 
How can I solve this problem without added field to my table that will
contain the calculate value?
 
 
 
T.I.A
 
 
 
Wiz
 
 
 
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
 
 
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 


More information about the SAP-WUG mailing list