How to know if a workflow instance have already been executed

Kjetil Kilhavn KJETILK at statoil.com
Thu Jun 16 02:38:33 EDT 2005


In your pseudocode you have a bug as far as I can see, but I suppose
that doesn't apply to the real code. You state that if the withholding
tax approval has been executed you should start the withholding tax
approval
------ if withholding tax approval workflow has not been executed for
this invoice or it is not set to completed nor to started then 
-------------- start release for posting approval worlflow 
-------else 
-------------- start withholding tax approval workflow 

 
Perhaps you should just check that the workflow is not cancelled? If it
is the type W item you check it can be selected (reserved) as well, and
committed if confirmation of completion is required. It can of course
also be in error or cancelled. If it is the type F item you check I
suppose completed and ready should cover what you want.
 
You can usually check if there is a timing issue by debugging. If it
works when you are debugging and doesn't work otherwise it is most
likely a timing issue. Otherwise you should dump the information you
find about the work items to see what statuses are reported.
-- 
Kjetil Kilhavn, Statoil KTJ IT BKS
 


________________________________

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Cristiana D'Agosto
Sent: 16. juni 2005 03:26
To: SAP Workflow Users' Group
Subject: How to know if a workflow instance have already been executed



4.7 

>From MIR7, upon selecting button Save as Completed, obj type/event
bus2081.completedtorelease is published. 

In my client, this event can start more than one customized workflows:
withholding tax approval and release for posting workflow. 

I have a receiver FM that is testing if the withholding tax approval
workflow should start (based on Vendor master data); if it doesnt then
the release for posting workflow starts. 

Withholding tax approval wf : goes to the agent to enter details on
regards to withholding tax and then goes to AP. The AP guys then enter
whatever they have to in the invoice and click Save as Completed -
bus2081.completedtorelease is published and bus2081.completedtoreleased
is published. 

I need to control that workflow for withholding tax approval does not
start again. 

How in my receiver FM can I check if the withholding tax approval
workflow has been completed or it is being processed ? The withholding
tax approval should only start once (if applicable, depends on vendor
master data). 

If the vendor in the invoice is subject to withholding tax, I am using
FM SWI_WORKITEMS_OF_OBJECT_GET to retrieve all the workflows that have
started for my objkey and then checking if there is any instance of the
withholding tax approval that is set to either 'completed' or 'started'
- but I think the events happen too fast and table swwwihead doesn't get
update on time. 

The client would like to have the users always using button Save as
Completed. 

1 - bus2081.completedtorelease 
2 - Receiver FM is called 
3 - Within FM: 
if withholding tax is applicable then 
------ if withholding tax approval workflow has not been executed for
this invoice or it is not set to completed nor to started then 
-------------- start release for posting approval worlflow 
-------else 
-------------- start withholding tax approval workflow 
------ end if 
else 
-------- start release for posting approval workflow 
end if 

Any ideas on how to achieve what I need? 

Much thanks for any help!

Regards, 

Cristiana
_________________________________
Cristiana d'Agosto
IBM Business Consulting Services
Mobile:  +61 417 927 224
cristiana.dagosto at au1.ibm.com


-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20050616/172edc24/attachment.htm


More information about the SAP-WUG mailing list