PO WF triggers twice ?JUNK MAIL? 4 ?JUNK MAIL? 4

Khanna, Manish manish.khanna at amd.com
Tue Nov 15 23:41:13 EST 2005


Hi Jocelyn,

Thanks for the suggestion.

1. I tried using both FMs , but it did not trigger the event or start
the WF in check FM. I tried extentions 'STARTING NEW TASK and IN
BACKGROUND TASK'; none of them helped.

2. We are responsible to enhance the existing business workflows. I've
to use whats already with minimal impact on the business.

-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Dart, Jocelyn
Sent: Wednesday, November 16, 2005 9:00 AM
To: SAP Workflow Users' Group
Subject: RE: PO WF triggers twice ?JUNK MAIL? 4 ?JUNK MAIL? 4

Manish, 

1. ***Please*** use the released for customer functin
SAP_WAPI_START_WORKFLOW not the internal function SWW_WI_START Better
still use an event and SAP_WAPI_CREATE_EVENT rather than starting a
workflow directly

2. Instead of re-using the standard PO/PR events which have their own
criteria for start, why don't you extend the object type EINKBELEG by
delegation to include your own custom event - by which you start *your*
workflow. 

Your workflow can then raise the standard event if you still need it.


Regards,
Jocelyn Dart
Senior Consultant
SAP Australia Pty Ltd.
Level 1/168 Walker St.
North Sydney
NSW, 2060
Australia
T   +61 412 390 267
M   + 61 412 390 267
E   jocelyn.dart at sap.com
http://www.sap.com

The information contained in or attached to this electronic transmission
is confidential and may be legally privileged. It is intended only for
the person or entity to which it is addressed. If you are not the
intended recipient, you are hereby notified that any distribution,
copying, review, retransmission, dissemination or other use of this
electronic transmission or the information contained in it is strictly
prohibited. If you have received this electronic transmission in error,
please immediately contact the sender to arrange for the return of the
original documents. 
Electronic transmission cannot be guaranteed to be secure and
accordingly, the sender does not accept liability for any such data
corruption, interception, unauthorized amendment, viruses, delays or the
consequences thereof.
Any views expressed in this electronic transmission are those of the
individual sender, except where the message states otherwise and the
sender is authorized to state them to be the views of SAP AG or any of
its subsidiaries. SAP AG, its subsidiaries, and their directors,
officers and employees make no representation nor accept any liability
for the accuracy or completeness of the views or information contained
herein. Please be aware that the furnishing of any pricing information/
business proposal herein is indicative only, is subject to change and
shall not be construed as an offer or as constituting a binding
agreement on the part of SAP AG or any of its subsidiaries to enter into
any relationship, unless otherwise expressly stated. 


-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Khanna, Manish
Sent: Wednesday, 16 November 2005 1:50 PM
To: SAP Workflow Users' Group
Subject: RE: PO WF triggers twice ?JUNK MAIL? 4

Hi Mike,

There are no explicit commits. It is in the code of standard FM
SWW_WI_START.

I'm working on a solution to start purchasing workflows on
"change"(change to qty field as price field is disabled) of consignment
documents. Since consignment docs cannot have release strategy hence the
change was captured in a check FM in SWEC.

All is running well. Any change to a purchasing doc is captured where I
filter out as per my requirement. Once OK I start respective WF for
objtype BUS2012/BUS2013/BUS2014.

In SWW_WI_START I found that it triggers the WF twice. Further debugging
revealed that SWP_WORKFLOW_INSTANCE_CREATE creates one WF whereas the
other is triggered by event creation once the commit happens.

Now exactly where the event data is generated and why I'm not sure.

Thanks
Manish

-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Mike Pokraka
Sent: Tuesday, November 15, 2005 4:33 PM
To: SAP Workflow Users' Group
Subject: RE: PO WF triggers twice ?JUNK MAIL? 4

Hi Manish,
The check function is called in the LUW which raised the event. Thus
introducing a commit work (by using SWW_WI_START) will commit the
calling function, which obviously contained something to trigger the
extra event.

Using commits in this way is generally not a good idea, you can cause
havoc if e.g. the caller decides to roll back later in the program then
half your data is already in the DB because you've introduced a commit
in the middle of the LUW. Oops.

Use events, let us know what the issues were? As a matter of interest,
why trigger a WF from a check function?

Cheers
Mike

Khanna, Manish wrote:
> Apologies for the typo error.
>
> The code is written in a check FM that starts WF for PO and SA 
> conditionally. We have custom WF for our requirement.
>
> Event triggering did not work in that check FM (bcoz of update task
> issue) that is why I'm using the SWW_WI_START FM to start purchasing 
> workflows.
>
> I debug the code of SWW_WI_START and found the following..
> 1. It goes to SWW_WI_START->SWW_FI_START->SWW_FI_CREATE
> 2. In SWW_FI_CREATE, the code creats an entry in SWWWIHEAD. Till this 
> point there is only 1 WF.
> 3. In the end of SWW_FI_CREATE there is SWW_WI_LOG_WRITE_SUCCESS.. 
> Which has comit work deep inside.. The moment this comit work is 
> fired, a second workflow is triggered + event 
> BUS2012-releasestepcreated is also triggered.
> Now I'm confused from where this 2nd WF is triggered.
>
> WF trace does not show anything and so does SWEL.
>
> Thanks
> Manish
>
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On 
> Behalf Of Mike Pokraka
> Sent: Tuesday, November 15, 2005 11:48 AM
> To: SAP Workflow Users' Group
> Subject: Re: PO WF triggers twice
>
> Hi Manish,
> Assuming you use SWW_WI_START (why?) to start a workflow not a PO, 
> which workflow and what steps does it execute when you get the event?
> Mike Pokraka
> Senior Consultant
> Workflow Connections Ltd.
> Mobile: +44 (0)7786 910 855
>
> Khanna, Manish wrote:
>> Hi,
>>
>> Following are the SWEC entries.
>>
>> EINKBELEG     BUS2012                 CHANGED
>> EINKBELEG     QCYBUS2012          CREATED
>> EINKBELEG     BUS2011                 QUOTATIONCREATED
>> EINKBELEG     BUS2010                 RFQUPDATED
>> EINKBELEG     BUS2012                 CUSTCHANGED
>> EINKBELEG     BUS2013                 CUSTCHANGED
>> EINKBELEG     BUS2014                 CUSTCHANGED
>> EINKBELEG     FREBUS2012           CREATED
>> EINKBELEG
>>
>>
>> However when I start a PO using SWW_WI_START. Now this should start 
>> the WF directly. However the moment this executes it fires BUS2012 
>> 'RELEASESTEPCREATED' . As a result, 2 WF are triggered, one thru 
>> SWW_WI_START and another through the event.
>>
>> Dont know why this happens :(
>>
>> Thanks
>> Manish
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug



_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug

_______________________________________________
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