SWC_GET_MANAGER' function module

M Doe monica_sap at hotmail.com
Fri Nov 7 12:32:54 EST 2003


Hi Paul,
 
When I use that statement - my workflow does not even start. I get no syntax
errors when I syntax test this code.  It just can't find the chief.   Is
there some other statement that I need before this statement.  My code is as
follows:
 
data: namewithleadingus like wfsyst-agent.
SWC_GET_PROPERTY SELF 'Namewithleadingus' namewithleadingus.
swc_container my_container.
swc_set_element my_container 'org_object' namewithleadingus.
call function 'SWX_GET_MANAGER'.
..
 
The function works because when I enter 'USSMITH' instead of
namewithleadingus with the swc_get_element statement it brings back the
chief.
 
How do I enter the initiator or username automatically is the question?
 
Joceyln had also mentioed in the earlier email using the namewithleadingus
but I don't know if she meant it as a variable or as a system name.
 
Thanks.
 
Regards,
Monica
 
 
>From: Paul Batey <Paul.Batey at intelligroup.com.au>
>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: Fri, 7 Nov 2003 10:57:08 +1100
>
>Try:
>
>SWC_GET_PROPERTY SELF 'Namewithleadingus' <a variable of your choice>
>
>-----Original Message-----
>From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of M
>Doe
>Sent: Friday, 7 November 2003 6:10 AM
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: SWC_GET_MANAGER' function module
>
>Hi all,
>
>Sky- I did try to use your solution with the wf_initiator but it did not
>work.
>
>I do see another attribute in this business object which is
>"lastchangedby"
>and it is a relational attribute which has a attribute
>"namewithleadingus"
>which is what I need in my container below.
>
>swc_set_element my_container 'org_object' namewithleadingus.
>
>
>How do I get that attribute in there.  Is that possible?
>
>I need this attribute because I have a sendmail step as the first step
>in my
>workflow which should go to the manager of the initiator.  This has to
>be
>sent by email so if I choose receiptent type= email address then I have
>to
>specify the email address of the manager which is what I am trying to
>get
>with this new attribute that I want to create.
>
>If someone knows of an easier way- please let me know.  How can I use
>Role168 to send email to the manager is what I am looking for?
>
>
>Thanks.
>
>Regards
>Monica
>
>
>
>
> >From: "Kimball, Schuyler" <schuyler.kimball at sap.com>
> >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, 6 Nov 2003 05:25:04 +0100
> >
> >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
>
>_________________________________________________________________
>Great deals on high-speed Internet access as low as $26.95.
>https://broadband.msn.com (Prices may vary by service area.)
 
_________________________________________________________________
MSN Shopping upgraded for the holidays!  Snappier product search...
http://shopping.msn.com
 


More information about the SAP-WUG mailing list