Help, need user name for wf initiator in the task text

Griffiths, Mark mark.griffiths at sap.com
Thu Feb 20 11:58:41 EST 2003


Hi Sunni,
 
Suggest you create a new instance independent method and strip the 'US' from the first two characters of your workflow initiator import parameter.  You can then use the 12 character field to instantiate the object.  You can then bind the created object from your task into your workflow to use in subsequent steps.
 
The following works fine:
 
DATA: usagent LIKE wfsyst-agent,
      myobjectkey LIKE sweinstcou-objkey.
 
swc_get_element container 'USAgent' usagent.
object-key-id = usagent+2.
swc_set_objectkey object-key-id.
swc_create_object self 'USR01' object-key-id.
 
Cheers,
 
Mark
 
Senior Consultant,
SAP UK
 
-----Original Message-----
From: Sunni sunni [mailto:sunnilondon at hotmail.com]
Sent: 20 February 2003 15:18
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Help, need user name for wf initiator in the task text
 
 
Hi
 
 
The instance-independent method USR01.FINDUSERFROMAGENTSTRUCTURE does not
return anything.
I created a new method for USR01 with the following code and an import
parameter called agent and an export parameter called name:
 
BEGIN_METHOD ZGETUSERNAME CHANGINGCONTAINER.
DATA:
ZGETUSERNAME(255),
     Agent like wfsyst-agent,   "import parameter contains wf_initiator
     NAME LIKE ADDR3_VAL-NAME_TEXT.  "attribute containing name
                                      "export
 
swc_get_element container 'Agent' Agent.  "import
SWC_GET_PROPERTY SELF 'Name'Name.
swc_set_element container 'Name' Name.   "export
 
SWC_SET_ELEMENT CONTAINER RESULT Name.  "ZGETUSERNAME.
 
END_METHOD.
 
 
 
When I test this method, I get the export parameters Result and Name filled
with the user name correctly.
When I attach this method to a background task and do the bindings I get
nothing back into the task container variables, which have the same data
type.
 
Any ideas why?
 
Cheers
Sunni
 
 
>From: "Dart, Jocelyn" <jocelyn.dart at sap.com>
>Reply-To: SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: Help, need user name for wf initiator in the task text
>Date: Thu, 20 Feb 2003 00:31:21 +0100
>
>Hi Sunni,
>If you just want to get the user name for display in a step in your
>workflow you can use instance-independent method
>USR01.FINDUSERFROMAGENTSTRUCTURE
>to translate your workflow initiator to a USR01 object.
>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: Flavio Oliveira [mailto:oliveiraflavio at hotmail.com]
>Sent: Thursday, 20 February 2003 5:35 AM
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: Help, need user name for wf initiator in the task text
>
>
>Sunni:
>
>You can create on your event a new parameter that is the user name and, on
>the event check function module you can set this parameter with the user
>name (that you can get from the object USR01).
>
>Then you create a container element on your workflow to receive the event
>parameter and populate it on the binding.
>
>Just do not forget that the key of the object USR01 is the user id and the
>workflow initiator has the string 'US' before the user id.
>
>Flavio.
>
>
> >From: Sunni sunni <sunnilondon at hotmail.com>
> >Reply-To: SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
> >To: SAP-WUG at MITVMA.MIT.EDU
> >Subject: Help, need user name for wf initiator in the task text
> >Date: Wed, 19 Feb 2003 17:22:35 +0000
> >
> >Hi
> >
> >I need to get the user name for the workflow initiator in the task
> >description text.  I've tried all sorts of bindings and tried to
>reference
> >object usr01 but no success.
> >
> >How can I link the wf initiator to this object and get the attribute user
> >name held in the user master record (in simple english)?
> >
> >
> >Any suggestions most appeciated
> >
> >Many thanks
> >Sunni
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >_________________________________________________________________
> >Chat online in real time with MSN Messenger http://messenger.msn.co.uk
>
>
>_________________________________________________________________
>Add photos to your e-mail with MSN 8. Get 2 months FREE*.
>http://join.msn.com/?page=features/featuredemail
 
 
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://messenger.msn.co.uk
 


More information about the SAP-WUG mailing list