Getting _wf_initiator from a task

Rick Sample Rick.Sample at gbe.com
Fri Oct 11 09:18:44 EDT 2002


I did find some objects that worked.
<obj.obj.obj>.NAME worked fine.
then I thought I had it. So I added <obj.obj.obj>.TELEPHONE with the
.NAME
and gave me a 32 bit char limit error. Could not resolve to long obj
strings with
same over 32 chars. *sigh!*
Created a container element and moved on. Hopefully in newer release we
could
extend some tasks. Base tasks holding some common methods / attr. and
definning once.
SAP looks to be moving to more OO world which would make life easier
for me.
 
Thanks again Jocelyn and all...
No responce necessary.
 
>>> jocelyn.dart at sap.com 10/10/2002 10:11:38 PM >>>
Hi Rick, That's fine. I come from a non-OO background, although
I try to keep to OO rules as much as possible, but sometimes I
like to see what's going on and a little separation can reduce
confusion, but I don't consider myself any sort of OO expert and
I take your point.
 
Like I said, you could set up a virutal attribute on _Workitem and
use that provided you make your attribute performance-efficient
if you are going to make heavy use of it. It was only performance
I was worried about for your approach.
 
By the way, I had a look on the system after your question and
noticed at workflow level you have a container element
_WORKITEM (each workflow instance is a work item itself)
pointing to object type FLOWITEM with attributes
Initiator and Initiatorfield which are close to what you are
after.  Although I'd still suggest maybe creating your own
attribute pointed to USR01 (user master) to get the correct
name/telephone.
 
Re the rest of your suggestions - raise them with your local SAP user
group if you
want them on a development request. Things like that don't change
unless people ask for them. Unfortunately the business object
tools are still lagging behind the ABAP OO tools.
 
 
Regards,
        Jocelyn Dart
Consultant (SRM, EBP, Workflow)
and co-author of the book
"Practical Workflow for SAP"
SAP Australia
email: jocelyn.dart at sap.com
phone: +61 412 390 267
fax:   +61 2 9935 4880
 
 
 
 
 
 
 
 
 
-----Original Message-----
From: Rick Sample [mailto:Rick.Sample at gbe.com]
Sent: Thursday, 10 October 2002 10:15 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Getting _wf_initiator from a task
 
 
>>Don't use workitem.createdbyuser as the workflow initiator
Figured out this one. Was looking for some _WorkFlow equivalent to the
_workitem.
Didn't find one that fit. Tried use of the .fatherorxxx something or
other, but ran into 32 bit length limit.
I come from an OO background and if we have objects that exist - use
them! Or create new  "instances".
Ran out of time searching so used the old school approach of creating
separate containers
in WF def, and the dozens of Tasks. _That_ is a hassle. Especially
when
we have no global search - replace,
no copy container element to another task, no friendly
attribute/method
type helpers to suggest previous elements
(with suggested same data types!), etc.
Not starting a flame war. Period! Every env. has it pros/ cons.
But it is lacking in a lot of development areas from more modern
tools.
Hope 6.2+ has better tools.
 
>>It's usually better to be explicit - less hassle during monitoring,
>>troubleshooting and future maintenance - and it really isn't all
that
much extra work.
Sorry, I know you are a SAP pro, but I couldn't disagree more as a
general rule - non SAP!
I made a typo with a Task Element named zAnnualSalary and WF def
called
zAnualSalary.
Took me two hours and lots of java (drinkable kind of java) to find
it!
If there is an method/attribute that can be called from obj that
already exists in any quasi OO language,
define it once, and use it! I avoids needles overhead of
setup/breakdown time, it avoids typos, it avoids
naming elements with same name with different data types, etc., etc.
 
I am new to SAP. So I just may be totally in left field, but don't
think so.
 
Hope you take my opinions as just my opinions. No personal hit! I
think
you and many
on this list are a God send!
 
Thanks Much!
And, everyone, sorry in advance for my rants! But if no one complains,
nothing changes!
 
P.S.
Order your book, but still waiting. Hopefully choked full of "tips".
 
>>> jocelyn.dart at sap.com 10/9/2002 6:37:25 PM >>>
Hi Rick,
Don't use workitem.createdbyuser as the workflow initiator
- that could be different people in different circumstances
e.g. workflow initiator,
the person who executed the previous workitem or WF-BATCH.
 
I think you are making more work for yourself by trying to
avoid creating explicit container elements to handle this.
 
Even linking to the parent of a work item is dubious as it
doesn't cater for scenarios using subflows within workflows.
 
You could potentially create a delegated subtype of _WORKITEM
and use a virtual attribute to find the initiator by finding
the top-level workflow and reading its worflow initiator container
element but to me that sounds dubious from a performance
perspective.
 
Standard practice is ...
1) From your triggering event to the workflow, bind the event
creator element to the workflow initiator element.
2) Create a workflow container element based on USR01.
3) Add a step based on USR01.FINDUSERFROMAGENTSTRUCTURE to convert
your initiator to a USR01 object.
4) Pass the USR01 object to each task you want to display the
details.
 
If you have the same pattern in many tasks you might
want to ensure that the USR01 element is called the same thing
in all tasks and make that a standard at your site.
 
It's usually better to be explicit - less hassle during monitoring,
troubleshooting and future maintenance - and it really isn't all that
much extra work.
 
Regards,
        Jocelyn Dart
Consultant (SRM, EBP, Workflow)
and co-author of the book
"Practical Workflow for SAP"
SAP Australia
email: jocelyn.dart at sap.com
phone: +61 412 390 267
fax:   +61 2 9935 4880
 
 
 
 
 
-----Original Message-----
From: Rick Sample [mailto:Rick.Sample at gbe.com]
Sent: Wednesday, 9 October 2002 10:33 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Getting _wf_initiator from a task
 
 
I can get the _wf_initiator (USmyname) which is the work item creator
as
well
and display it in my tasks description text like this:
 
...
Created by:
<H>&_WORKITEM.CREATEDBYUSER.NAME&</> <H>
&_WORKITEM.CREATEDBYUSER.TELEPHONE&</>
...
 
When I go to my second task , which has a different user execute that
task,
I want to display the _wf_initiator's name, telephone, etc. The above
code
obviously give me the task creator. Not the Wf initiators data.
 
All the tasks in my workflow I want to display workflow initiator's
data in the above layout.
I don't want to create a wf container type USR01 element to store for
I
 know it must be in an object somewhere.
How do I get the wf_initiators data from any task as an object verses
just the USmyname?
 
Demo flow to look at?
Thanks!
 


More information about the SAP-WUG mailing list