cancel
Showing results for 
Search instead for 
Did you mean: 

Purchase Requisition Workflow

Former Member
0 Kudos

Hi All,

I have a Purchase Requisition Workflow in place which gets triggered for event ReleaseStepCreated and according to the Total Valuation of the Purchase Requisition and Release Strategy based on the Z table the Purchase Requisition is sent to different approver Group.

Now as per the new requirement, if there is a change in the Purchase Requisition quantity/price which result in changes in the total valuation and hence different approver group is responsible for approving the same, then the original Workflow should get cnacelled and new workflow should get triggered, how can I achieve the same?

I have found the BADI where upon change in the value of Quantity/Price I will write a code if the approver group is being changed then trigger the event PurchaseReqItem.significantlyChanged using Function Module SWE_EVENT_CREATE but again this particular event is not returning the release code, which is available for the event PurchaseReqItem.releaseStepCreated.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

I042439
Employee
Employee
0 Kudos

Hi Nilesh

Add BUS2105.CHANGED event as one of the triggering events of the Workflow.

Within the workflow, add a fork 1 of 2. In one branch, keep the entire process and in the other branch wait for BUS2105.CHANGED; post that wait setp, you can use termination step to COMPLETE the current instance.

When someone changes the req. it will trigger a new instance using BUS2105.CHANGED and will also complete any running instance of the same Req. from the fork

Regards,

Modak

Further, you can put start conditions for BUS2105.CHANGED if you want to trigger for specific changes only and slo check for those changes in the fork before the termination step.

Message was edited by: Modak Gupta

Former Member
0 Kudos

Hi Modak,

Thanks for your reply.

I have implementedt the Fork and Wait for event activity which waits for Significantlychanged raised. Once raised it cancels the original workflow using the process control and restart the workflow. This will work fine if Purchase Requisition is changed only once.

But Purchase Requisition can be chnaged any number of times, how this can be handled?

Thanks  in advance.

former_member185167
Active Contributor
0 Kudos

Hello,

If the PR is changed a second time then the workflow is cancelled and restarted again. What's the problem?

By the way, you should use SAP_WAPI_CREATE_EVENT, not SWE_EVENT_CREATE. Always use SAP_WAPI* when you can.

regards

Rick Bakker

Former Member
0 Kudos

Hi Nilesh,

Proper way of handling in workflow  is each time for each changes it should terminate existing instance then trigger the new workflow instance.(Even for 100 times)

For Change event as u told no release code.(I agree)

I handled the same situation.By getting the release code from the database then filling this in workflow container element ''RELEASECODE' in background method activity in the starting of the workflow.

Regards,

Ragav

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks everyone!

Former Member
0 Kudos

Hi Nilesh,

Make it simple.

you have following options.(follow any one)

1.While Trigggering Significantly change trigger another one event Releasestep Created with filled Event parameter Release code.

2.Other wise if you are using custom workflow very first step of the workflow make it Releasecode(Container element) filing from the database by using custom method.

Regards,

Ragav

former_member209217
Active Contributor
0 Kudos

Hi Nilesh,

Make use of Fork Step and no need to create a separate workflow for that. Make two branches out of the fork and 1 necessary branch.

In one branch make use of the wait event BUS2105.CHANGED and in one branch design your general steps of workflow , I mean the steps you would follow when there is no significant change in Requisition.

And you know if any of the steps gets executed as per the conditions the other one would be logically deleted

Best Regards,

lakshman