‎2006 Jul 19 2:30 PM
Dear all,
I'm creating a workflow that will perform the following.
Triggered at: Change of PO
Steps
1) Check if the PO is released.
2) If the PO is not released then do nothing and Stop.
3) If PO has been released, then reset the PO Release and send a mail to an user.
4) Stop.
Now, the workflow is working fine except for a small issue. This change is getting triggered even when a PO is released. due to this the PO can never be released.
How to overcome this?
Any pointers highly appreciated!
Cheers,
Sam
‎2006 Jul 19 2:45 PM
Hey,
SAP program treats the PO release as a CHANGE and triggers the CHANGED event.
You can create a custom event for the business object i.e. ZCHANGED and trigger ZCHANGED using change documents. Transactions SWED and SWEC are to be used to do these settings. ZCHANGED can be used as a triggering event for your workflow.
I had adopted the above approach for a similar requirement for requisitions.
-Kiran
‎2006 Jul 19 2:45 PM
Hey,
SAP program treats the PO release as a CHANGE and triggers the CHANGED event.
You can create a custom event for the business object i.e. ZCHANGED and trigger ZCHANGED using change documents. Transactions SWED and SWEC are to be used to do these settings. ZCHANGED can be used as a triggering event for your workflow.
I had adopted the above approach for a similar requirement for requisitions.
-Kiran
‎2006 Jul 19 2:57 PM
Hey Thanks Kiran.
Can you please give me a step by step procedure of links that can help me on doing this?
Thanks,
Sam
‎2006 Jul 19 3:13 PM
Hey
Create a subtype of the PO business object and add the custom event.
Enter a delegation entry using the option
Settings->Delegate on the initial screen in SWO1
In SWED make an entry for the change object EINKBELEG and select the checkbox CHANGE.
In SWEC create a new entry with the below details
EINKBELEG
BO BOR Object Type
BUS2012
ZCHANGED
Select the On Change Radiobutton.
If you have to restrict the ZCHANGED event to specific field changed then enter the field restrictions.
Detailed help from SAP at the below link: http://help.sap.com//saphelp_erp2004/helpdata/EN/c5/e4aeef453d11d189430000e829fbbd/frameset.htm
-Kiran
‎2006 Jul 21 10:26 AM
Hey Kiran,
Thanks dude. It works well. But just one more small issue....
I have to trigger my WF only when a released PO is changed and not while actually releasing the PO.
So in the field restrictions, I have to put all the fields of the tables EKKO,EKPO and one more excluding the field that corresponds to that released status flag. This is very tedious. Can i do it in any other way in the field restriction?
Cheers,
Sam
‎2006 Jul 21 10:36 AM
In the field restrictions only maintain those fields which when changed should trigger the event.
To check the PO release logic there is something called as check function module you can define in the event linkages (SWETYPV). This function is processed after the event is created and before the workflow is triggered.
Write a check function module to check if the PO is released. If the PO is not released raise an exception in the function and the workflow will not be triggered.
There is a template check function module called SWE_CD_TEMPLATE_CHECK_FB in the function group SWE_TEMPLATE.
-Kiran
‎2006 Jul 21 11:08 AM
Hi Sam,
Another easy way out can be use the <b>Start condition</b> for workflow.
In this start condition check that Attribute <b>ReleaseStatus</b> of BUS2012 object is initial/blank.
So workflow will be triggered only when PO has status as released.
Regds,
Akshay Bhagwat
‎2006 Jul 21 12:58 PM
Dear Akshay & Kiran,
I think I've not put the question in the right way.
I've already done the WF so that it gets triggered only for Release PO when changed. It is working fine.
But the WF was getting triggered even when the PO was released since SAP considers it also as changed. So as Kiran had suggested, I had created a ZCHANGED event and linked it with BUS2012.
Now my only concern was that I need to put all the fields of table in EKKO,EKPO excluding the ones that correspond to Release Status flag in EKKO.
Is there any way to exclude only those fields but consider all the other default fields???
Cheers,
Sam
‎2006 Jul 21 1:33 PM
Hey,
Even if you do not enter any field restrictions the custom event should be triggered. Is this happening?
If you do not want the custom event to be triggered when the PO is released then enter the field restriction, OldReleaseCode = NewReleaseCode.
Field restrictions are to be used only when you want to trigger events for specific field changes. For e.g. Trigger an event if the item category of a field is changed.
-Kiran
‎2006 Jul 24 4:20 PM
‎2006 Jul 25 3:48 PM