AW: AW: Getting current agent (name) from workflow work item

Shoaib Mirza shoaib_mirza at hotmail.com
Tue Jan 26 17:58:47 EST 2010


 

Hi Paul

 

Thanks for your reply, you're right and I've just realised that this workflow does have subworkflows!!

 

---------

So Im thinking.

 

I take the top workitem that I have, 

select from table swwwihead to find the child workitems of type F, (there seem to be just two subworkflows started here always)

save these as the new 'top' work items in an internal table

 

select from swwwihead again for the first of the new work items (the new top work item)

take the last entry of the list output type 'W' to represent the last dialog work item

save this workitem nr

 

repeat the above step for the next 'top' work item of the parallel branch for the other subworkflow, and save this work item nr

 

run the below function module 'SAP_WAPI_WORKITEM_RECIPIENTS' to get the user/s for each derived work item

------------------

 

I would have to repeat this for potentially hundreds of line items just before an alv list is output.

 

Is there a better way?

 

Best Regards

Sunni

 

 
 
> Subject: RE: AW: AW: Getting current agent (name) from workflow work item
> To: sap-wug at mit.edu
> From: Paul.Bakker at osr.treasury.qld.gov.au
> Date: Wed, 27 Jan 2010 07:59:37 +1000
> 
> Sunni,
> 
> I think there's a problem with your concept of 'last workitem'.
> 
> A workflow can, of course, have multiple dialog workitems active at once
> (e.g. in parallel branches).
> Which one would you then want the details of?
> 
> cheers
> Paul
> 
> 
> 
> 
> Shoaib Mirza 
> <shoaib_mirza at hot 
> mail.com> To 
> Sent by: <sap-wug at mit.edu> 
> sap-wug-bounces at m cc 
> it.edu 
> Subject 
> RE: AW: AW: Getting current agent 
> 27/01/2010 07:37 (name) from workflow work item 
> AM 
> 
> 
> Please respond to 
> "SAP Workflow 
> Users' Group" 
> <sap-wug at mit.edu> 
> 
> 
> 
> 
> 
> 
> 
> Hi
> 
> This doesn't seem to work, or are we missing something in the code.
> This gives the details of the top level workflow item. I can not see the
> latest work item being processed in the workflow.
> 
> Any ideas how to get this information?
> 
> Thanks
> Sunni
> 
> From: Benjamin.Koeb at comlineag.de
> To: sap-wug at mit.edu
> Date: Tue, 26 Jan 2010 20:22:00 +0100
> Subject: AW: AW: Getting current agent (name) from workflow work item
> 
> Hi Sunni,
> 
> that’s no problem, if you have the ‘top’ workitem, just select swwwihead
> with ‘where’-clause: WI_CHCKWI = your_top_wi_id
> Try this select statement:
> SELECT SINGLE * FROM SWWWIHEAD into wa_SWWWIHEAD
> WHERE WI_CHCKWI = lv_top_wi_id
> AND wi_type = 'W'
> AND ( WI_STAT = 'READY' or WI_STAT = 'STARTED' ).
> You should get the actual workitem, with this information you can call the
> function module.
> 
> Hope that helps…
> 
> Benny
> 
> Von: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] Im Auftrag
> von Shoaib Mirza
> Gesendet: Dienstag, 26. Januar 2010 18:17
> An: sap-wug at mit.edu
> Betreff: RE: AW: Getting current agent (name) from workflow work item
> 
> Hi
> 
> Thanks for that, but my issue is that I don't have the work item id of the
> current task. I only have the 'top' work item id of the workflow. That
> does not have any agents.
> 
> So I need to go down the workflow to the final workitem and get the agents
> from that. (Maybe then I can use the function below to get the agents)
> 
> Any ideas how I can do that.
> 
> Kind Regards
> Sunni
> 
> 
> 
> 
> From: Benjamin.Koeb at comlineag.de
> To: sap-wug at mit.edu
> Date: Tue, 26 Jan 2010 17:51:09 +0100
> Subject: AW: Getting current agent (name) from workflow work item
> Hi Sunni,
> 
> you can read the actual (Workitem status = started) agent from table
> SWWWIHEAD-WI_AAGENT with key = WI_ID. This works fine for workitems with
> status = started, if the status = ready the field wi_aagent is empty! For
> workitems with status ready, try to use function module
> SAP_WAPI_WORKITEM_RECIPIENTS:
> 
> CALL FUNCTION 'SAP_WAPI_WORKITEM_RECIPIENTS'
> EXPORTING
> workitem_id = lv_wi_id
> tables
> recipients = it_recipients.
> 
> That’s my way, maybe there are better ones?
> 
> Regards,
> 
> Benny
> 
> Von: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] Im Auftrag
> von Shoaib Mirza
> Gesendet: Dienstag, 26. Januar 2010 17:37
> An: sap-wug at mit.edu
> Betreff: Getting current agent (name) from workflow work item
> 
> Hi
> 
> Please can you let me know how I would go about getting the current agent
> of a workflow from the workitem id of the workflow. I looked for a wapi
> but could not find one suitable.
> 
> Kindest Regards
> Sunni
> 
> 
> 
> Do you have a story that started on Hotmail? Tell us now
> 
> 
> 
> 
> Got a cool Hotmail story? Tell us now
> 
> 
> 
> Not got a Hotmail account? Sign-up now - Free
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
> 
> 
> 
> ******************************************************************************************************************************************************
> 
> Only an individual or entity who is intended to be a recipient of this e-mail may access or use the information contained in this e-mail or any of its attachments. Opinions contained in this e-mail or any of its attachments do not necessarily reflect the opinions of Queensland Treasury.
> 
> The contents of this e-mail and any attachments are confidential and may be legally privileged and the subject of copyright. If you have received this e-mail in error, please notify Queensland Treasury immediately and erase all copies of the e-mail and the attachments. Queensland Treasury uses virus scanning software. However, it is not liable for viruses present in this e-mail or in any attachment. 
> 
> ******************************************************************************************************************************************************
> 
> 
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
 		 	   		  
_________________________________________________________________
Got a cool Hotmail story? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20100126/31f6b8b1/attachment.htm


More information about the SAP-WUG mailing list