SAP_WAPI_START_WORKFLOW

Michael Pokraka workflow at quirky.me.uk
Thu Mar 10 06:30:59 EST 2005


Hi Rick, 
Your second call should be for the first workitem in the flow, not for the
workflow itself, so you need to read the log to get it's ID. 
Cheers
Mike

--- "Josefek, Richard" <RJosefek at massmutual.com> wrote:

> When I try Phil's approach, I am getting the following error message.
>  
> Work item 000000025352: Type F cannot be executed several times
>  
> I have created a workflow with a single step (decision task)
>  
> When I call SAP_WAPI_START_WORKFLOW I get the WI ID returned.
> I then call SAP_WAPI_EXECUTE_WORKITEM sending the WI ID from step 1, this is
> when I get the return error:
> Work item 000000025352: Type F cannot be executed several times
>  
> Any thoughts?
>  
> Rick
>  
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu]On Behalf Of
> Dart, Jocelyn
> Sent: Thursday, February 17, 2005 11:30 PM
> To: SAP Workflow Users' Group
> Subject: RE: SAP_WAPI_START_WORKFLOW
> 
> 
> Old function modules are risky. Please use WAPIs as suggested by Phil. 
> Jocelyn 
> 
> 
>   _____  
> 
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
> Griffiths, Mark
> Sent: Wednesday,16 February 2005 9:59 PM
> To: SAP Workflow Users' Group
> Subject: RE: SAP_WAPI_START_WORKFLOW
> 
> 
> No hacking required: try using SWW_WI_START_SIMPLE (description "Creation and
> Immediate Start of WI - Simplified Interface").
>  
> It isn't a WAPI but is included in the BC610/BIT610 course (so it has an air
> of officialdom about it).
>  
> Cheers,
>  
> Mark
>  
> SAP UK
> 
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
> Soady, Phil
> Sent: 16 February 2005 10:34
> To: SAP Workflow Users' Group
> Subject: RE: SAP_WAPI_START_WORKFLOW
> 
> 
> HAcks allowed ?
> read on...
>  
> call SAP_WAPI_START_WORKFLOW  (commit work and wait).
> You may need to place a short wait statement in there.
>  
> Wait upto n seconds.
>  
> you get the WORKITEM ID back.
>  
>  
>  
> Then call
> SAP_WAPI_EXECUTE_WORKITEM   
>  
> If the first step is a dialog one.  Away she goes....
>  
> Worse case scenario is you read all workitems using
> SAP_WAPI_WORKITEMS_BY_TASK 
>  for a TASK to be executed. It should belong to the WORKITEM ID  of the
> Workflow actually started.
> then call SAP_WAPI_EXECUTE_WORKITEM  with this ID.
>  
> I just tested this with a single step WFLOW.
>  
> WSXXXXXX
> has 1 step 
> decision task
>  
>  
>  
> SE37 SAP_WAPI_START_WORKFLOW  
> The SE37 on SAP_WAPI_EXECUTE_WORKITEM  with the returned wI ID.
> It worked.
>  
>  
> DONT FORGET: The WSxxxxxx needs to have the user calling it as an agent, not
> just the tasks!
>  
> ;-) Smoking
>  
>  
>  
> 
> Phil Soady 
> Senior Consultant 
> Business Technologies 
> SAP Australia 
> M  +61 (0) 412 213 079 
> E   <mailto:phil.soady at sap.com> phil.soady at sap.com 
> 
>  
> 
> 
>   _____  
> 
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
> Dart, Jocelyn
> Sent: Wednesday,16 February 2005 12:27 PM
> To: SAP Workflow Users' Group
> Subject: RE: SAP_WAPI_START_WORKFLOW
> 
> 
> Rick, 
> No, you are correct, the WAPI can only start the workflow.  It can't
> interrupt the current transaction as this could cause logical unit of work
> issues with the current transaction, e.g. data may not be saved or data
> relationships may be corrupted.  What you can do is use your own screen, e.g.
> in a  BADI if it is available and allows you to do this, and then pass this
> information to the workflow using the WAPI - e.g. so that the workflow can
> then skip that first step as it already has the data. 
>  
> Other than that, yes you can raise the work item as an express item, which
> will give a message with the option of going immediately to their inbox. 
>  
> Would you please give me the chapter/section/page/statement you are referring
> to and we'll put a clarification up on the workflowbook site. 
> Regards,
> Jocelyn 
> 
> 
>   _____  
> 
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
> Josefek, Richard
> Sent: Wednesday,16 February 2005 7:55 AM
> To: SAP-WUG at MITVMA.MIT.EDU
> Subject: SAP_WAPI_START_WORKFLOW
> 
> 
> 
> I am trying to get the first step of my workflow to popup immediately without
> the user visiting their inbox. In the publication "Practical Workflow for
> SAP" it seems to infer that this can be accomplished by using
> SAP_WAPI_START_WORKFLOW.
> 
> For testing purposes, I have a single step workflow that brings up a form for
> the user to fill out. I have been trying to use this WAPI and have had some
> success in starting the workflow, but it appears in the users inbox. 
> 
> Does anyone have any experience with this. Can you enlighten me as to how to
> get this form to popup when the WAPI is executed?
> 
> Thanx
> 
> Rick
> 
> ---------------------------------------------------------
> This e-mail transmission may contain information that is proprietary,
> privileged and/or confidential and is intended exclusively for the person(s)
> to whom it is addressed. Any use, copying, retention or disclosure by any
> person other than the intended recipient or the intended recipient's
> designees is strictly prohibited. If you are not the intended recipient or
> their designee, please notify the sender immediately by return e-mail and
> delete all copies. 
> 
> ---------------------------------------------------------
> 
> 
> > _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
> 


More information about the SAP-WUG mailing list