Create workflow and start first workitem

Dart, Jocelyn jocelyn.dart at sap.com
Sun Oct 19 20:02:25 EDT 2003


Hi Mike and all,
I'm afraid it's not quite that simple.  Of course in order for the application to trigger event creation, the first part of the event creation needs to occur as part of the application's updates - which then depends on whether the application uses a dialog update or usese the update task.  Most applications do and should use the update task to perform updates.  However there are always exceptions.  The second part of the event management is to actually start the workflow itself, where transactional RFC is used to enforce separation.
There are variations to this in various circumstances.  Such as when creating new materials the relationship between the work item and the creation process has special needs so that the new material number can be passed back to the work item via a terminating event, and of course for debugging purposes it is possible to perform the whole event management synchronously.
Or in other words, you may find it works differently when changing materials as opposed to creating them.
There's a section in the book and in the SAP Library help that explains the process further.
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: Michael Pokraka [mailto:workflow at quirky.me.uk]
Sent: Saturday,18 October 2003 12:14 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Create workflow and start first workitem
 
 
Hi Fred,
Very interesting indeed! I was quite sure materials are savend in an update task - at least that is how we've done it in custom programs.
So this means that it's not the event manager that seperates a workflow from it's originating user/dialog session, but rather the fact that most events are raised in an update task - which is automatically a background process. Makes perfect sense now, you learn something every day....
 
Thanks for the info,
Cheers
Mike
 
 
On Fri, Oct 17, 2003 at 03:45:36PM +0200, Kouw, FA - SPLTX wrote:
> Mike,
>
> We're on 4.6C. Below the event data, the user who created/saved the material is shown as the user in the event data (KLM26139).
>
> =====
> Event instance ID     657775
>
> Object type           BUS1001006
> Key                   1277M75G09-FRED
> Event                 CREATED
> User                  KLM26139
> Main program          SAPMMG01
> Date                  17.10.2003
> Time                  14:50:09
> UTC                   20.031.017.125.010
>
> Receiver type         WS90000003
> Receiver ID           000000619088
> Receiver FM           SWW_WI_CREATE_VIA_EVENT
> Receiver type FM
> Check function        SWB_CHECK_FB_START_COND_EVAL
> Status                Receiver started correctly
>
> =====
>
> In program SAPMMG01 function 'MATERIAL_MAINTAIN_DIALOGUE' is called, so maybe materials are saved in dialog rather than in an update task.
>
> Regards,
>
> Fred Kouw
>
> Michael Pokraka wrote:
>
> > Hmmmm, interesting. (That'd be tech speak for "I've no clue"), what version is this?
> > A possibility is that materials are saved in dialog rather than in an update task. I wouldn't rely on this - as this could change, or enabling the event queue would stop this from happening.
> >
> > I have to admit this is not quite how I understood things and I'd be curious to know how this works.
> >
> > On a different not, how can one STOP this from happening when starting tasks with SWUS...
> > Cheers
> > Mike
> >
> > On Fri, Oct 17, 2003 at 02:55:38PM +0200, Kouw, FA - SPLTX wrote:
> > > Hi,
> > >
> > > Mike, we use event 'Created' of BUS1001006 (Standard material) to start a custom material master workflow (the event is triggered by standard SAP after creating a new material). If the user who created the material is a possible and responsible agent of the first work item it is automatically executed (the user
> > > does not have to start it from the inbox).
> > >
> > > Can you explain this, maybe something is possible for Werner?
> > >
> > > Regards,
> > >
> > > Fred
> > >
> > > Michael Pokraka wrote:
> > >
> > > > Hi Werner,
> > > > By raising an event you are passing control over to the event manager. Thus the connection to the user's dialog session is lost and the workitem has to be accessed via the inbox.
> > > > If you start the workflow directly without an event you can achieve what you are after. SAP_WAPI_START_WORKFLOW is probably what you want. Be aware that this way you have to handle any errors yourself, there's no event queue/linkage or other trace by which a flow can be restarted if things didn't go to plan.
> > > >
> > > > Happy Fridays
> > > > Cheers
> > > > Mike
> > > >
> > > > On Fri, Oct 17, 2003 at 02:13:41PM +0200, Werner Kv_l wrote:
> > > > > Hi all,
> > > > >
> > > > > i programmed a report and used FM SWE_EVENT_CREATE to start a workflow.
> > > > > The workflow starts without a problem.
> > > > > But i do not achieve that the first workitem is executed right after the
> > > > > start of the workflow.
> > > > > I tried FM SAP_WAPI_EXECUTE_WORKITEM, but i am missing the ID of this
> > > > > workitem
> > > > > Is there a chance to get the ID of the workitem of a workflow?
> > > > > Or is there another possibility to execute the first workitem, so that users
> > > > > do not have to call their business workplace first?
> > > > >
> > > > > Thanks and nice weekend!
> > > > > Werner.
> > > >
> > > > _________________________________________________________________________________________
> > > > This inbound message from KPN has been checked for all known viruses by KPN IV-Scan, powered by MessageLabs.
> > > > For further information visit: http://www.veiliginternet.nl
> > > > _____________________________________________________________________________________________
> > >
> > >
> > > **********************************************************************
> > > This e-mail and any attachment may contain confidential and privileged
> > > material intended for the addressee only. If you are not the addressee, you
> > > are notified that no part of the e-mail or any attachment may be disclosed,
> > > copied or distributed, and that any other action related to this e-mail or
> > > attachment is strictly prohibited, and may be unlawful. If you have received
> > > this e-mail by error, please notify the sender immediately by return e-mail,
> > > and delete this message. Koninklijke Luchtvaart Maatschappij NV (KLM), its
> > > subsidiaries and/or its employees shall not be liable for the incorrect or
> > > incomplete transmission of this e-mail or any attachments, nor responsible
> > > for any delay in receipt.
> > > **********************************************************************
> > >
> > > _____________________________________________________________________________________________
> > > This outbound message from KPN has been checked for all known viruses by KPN IV-Scan, powered by MessageLabs.
> > > For further information visit: http://www.veiliginternet.nl
> > > _____________________________________________________________________________________________
> >
> > _________________________________________________________________________________________
> > This inbound message from KPN has been checked for all known viruses by KPN IV-Scan, powered by MessageLabs.
> > For further information visit: http://www.veiliginternet.nl
> > _____________________________________________________________________________________________
>
>
> **********************************************************************
> This e-mail and any attachment may contain confidential and privileged
> material intended for the addressee only. If you are not the addressee, you
> are notified that no part of the e-mail or any attachment may be disclosed,
> copied or distributed, and that any other action related to this e-mail or
> attachment is strictly prohibited, and may be unlawful. If you have received
> this e-mail by error, please notify the sender immediately by return e-mail,
> and delete this message. Koninklijke Luchtvaart Maatschappij NV (KLM), its
> subsidiaries and/or its employees shall not be liable for the incorrect or
> incomplete transmission of this e-mail or any attachments, nor responsible
> for any delay in receipt.
> **********************************************************************
>
> _____________________________________________________________________________________________
> This outbound message from KPN has been checked for all known viruses by KPN IV-Scan, powered by MessageLabs.
> For further information visit: http://www.veiliginternet.nl
> _____________________________________________________________________________________________
 


More information about the SAP-WUG mailing list