SWC_GET_MANAGER' function module

Kimball, Schuyler schuyler.kimball at sap.com
Wed Nov 5 23:25:04 EST 2003


Hi Paul and Monica,
Paul, thanks for catching my oversight (it's late at night here--oh well).
I agree--put the code into a method as you described, and then use a
process step that populates the workflow container as needed.  Much cleaner.
 
Monica, are you looking to read the workflow initiator specifically from the
_event_ container?  I ask because if you only need that data item once
you're inside a running workflow, it's provided via the _workflow_ container.
 
Otherwise, I assume you need this data item as part of a start condition
or a check function module?  If so, you're facing the dilemma of
needing information about the event, but not being able to get at it
except in a method--and the method needs to be invoked inside the
workflow we're considering running.
 
In that case, you'd need to implement check function module and not a
start condition, because the check function module can examine
the contents of the event container and act on them (via the
TABLES parameter named EVENT_CONTAINER; search online help for
"check function module" for more info).  A start condition cannot
do this, to my knowledge.
 
Hope this is useful to you.
 
Regards,
 
Sky Kimball
 
-----Original Message-----
From: Paul Batey [mailto:Paul.Batey at intelligroup.com.au]
Sent: Wednesday, November 05, 2003 10:26 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: SWC_GET_MANAGER' function module
 
 
I'm not sure an attribute is the best place to do this.  The object
doesn't know anything about the workflow container unless information is
passed in via an import parameter on a method, or you have some
convoluted code to read a workflow container.  How about creating a role
based on a function and passing in the object reference and have the FM
determine the appropriate agent?
 
If you really really want an attribute to do this you would have to call
SAP_WAPI_WORKITEMS_TO_OBJECT and determine the correct workflow instance
(how? Most recent?  Dodgy!) and then read WORKLIST-WI_CREATOR which
gives you _WF_INITIATOR for that workflow.
 
Cheers,
 
Paul
-----Original Message-----
From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of
Kimball, Schuyler
Sent: Thursday, 6 November 2003 2:15 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: SWC_GET_MANAGER' function module
 
Hi Monica,
To populate the container for checking the workflow initiator's manager,
try the following in your attribute:
 
  data: l_wf_initiator type wfsyst-initiator.
  swc_get_element container '_wf_initiator' l_wf_initiator.
 
  swc_set_element my_container 'org_object' l_wf_initiator.
  call function 'swx_get_manager'
  ...
 
I think this should work, but since I haven't tested it out, YMMV.
 
Regards,
 
Sky Kimball
Senior Development Consultant
Global Professional Services Organization
SAP NetWeaver Practice Unit
SAP America
 
E   schuyler.kimball at sap.com
http://www.sap.com
 
-----Original Message-----
From: M Doe [mailto:monica_sap at hotmail.com]
Sent: Wednesday, November 05, 2003 8:30 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: SWC_GET_MANAGER' function module
 
 
Thank you all for replying to my question about the 'SWX_GET_MANAGER'
function module.
Sue- I actually wrote 'swc' instead of 'swx' so you are right.
 
Jocelyn - I did use the code that you had mentioned in your reply
swc_set_element my_container 'org_object' ususername
call function 'swx_get_manager'
 
I actually created an attribute and between the "get propery" and "end
property" I am calling the function module.  Right now I am manually
entering the us and the user name eg.
 
swc_set_element my_container 'org_object' ussmith
 
and I am getting right results. But instead of manually entering us and the
username I want the userid of the initiator or the event creator in there.
How do I specify the username of the wf-initiator?
 
How do I specify that I need the manager of the wf_initiator.  How do I get
that information out of the event container.  I have looked at the help in
the system but not been able to figure it out.  So really what I want in
that result of this attribute is the manager of the wf-initiator or the
event creator.
 
How would I accomplish that?
 
I would appreciate  if you shed some light on this.
 
Thanks .
 
Regards,
Monica
 
 
>From: "Susan R. Keohan" <skeohan at mit.edu>
>Reply-To: SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: SWC_GET_MANAGER' function module
>Date: Thu, 30 Oct 2003 14:51:38 -0500
>
>Hi Monica,
>
>In our system, we have a function called SWX_GET_MANAGER.  I think this
may
>be the one you are
>referring to ??
>
>When I test it, I fill in the Actor_tab with the 'US' and username.
Then
>after I hit the wrench, it
>  would return the manager (I think, but we don't have chief positions,
so
>this is all speculation
>on my part).
>
>Typically I have seen the ac_container used to store values being
returned
>from functions.
>
>Try it this way and see if it works!
>Sue
>
>M Doe wrote:
>
>>Hi all,
>>
>>I am a little confused about something relating to the function module
>>"swc_get_manager".  When I simulate test the role 168 which uses this
>>function module I can enter "us' and then the user name and it brings
back
>>the managerwhich is fine.
>>
>>But when I test the function module 'swc_get_manger' by itself it
brings
>>back 2 tables: actor_tab and ac_container.  I understand that the
input
>>data
>>must be in ac_container so when I double click on it to enter us and
the
>>user name it brings back the fields: element, tab_in , ele, t and
value.
>>
>>These are flds from the structure 'swcont'.  My question is where do I
>>enter
>>us and the user name.
>>
>>There is also no documentation on the interface of this function
module.
>>What values it is expecting in the fields : element, tab_in, ele, t
and
>>value.
>>
>>Thanks.
>>
>>Regards,
>>Monica
>>
>>_________________________________________________________________
>>Add MSN 8 Internet Software to your current Internet access and enjoy
>>patented spam control and more.  Get two months FREE!
>>http://join.msn.com/?page=dept/byoa
>
>--
>Susan R. Keohan
>SAP Workflow Developer
>MIT Lincoln Laboratory
>244 Wood Street
>LI-200
>Lexington, MA. 02420
>781-981-3561
>keohan at ll.mit.edu
 
_________________________________________________________________
Crave some Miles Davis or Grateful Dead?  Your old favorites are always
playing on MSN Radio Plus. Trial month free!
http://join.msn.com/?page=offers/premiumradio
 


More information about the SAP-WUG mailing list