cancel
Showing results for 
Search instead for 
Did you mean: 

subworkflow - event trigerring within workflow

Former Member
0 Kudos

Hi,

Scenario -- WF is triggered when customer creates quote and it goes to manager for approval. If the manager rejects it, work item goes back to the user. My requirement is -- if the user makes any change with price - he changes the status of the quote to 'revised' at header level. Then it should again go back to manager for approval. If the user makes some other changes and does not change the status to revised--- then it need not go back to manager. How do I keep it in loop. Is there need for me to check some table and trigger a new event and create a subworkflow. How do I go about. Please help me. It is urgent.

Thanks,

Raju

Accepted Solutions (1)

Accepted Solutions (1)

surjith_kumar
Active Contributor
0 Kudos

Hi,

When ever customer change , CHANGE event will occur right. Use <b>wait</b> step there you select "wait for Condition", then give the condition what you want.

Please reply for further clarification.

Regards,

Surjith

Former Member
0 Kudos

surjith,

whenever the customer changes anything else other than price - he will not put its status as revised (which he can do in transaction va22). even then changed event will trigger. But only when he changes price - he will update the status as revised - only then the quote should be redirected to manager for approval.

Please give me direction as to how to proceed for this.

also --- I am trying to implement bdc session in one of the steps. I copied the program from se38 into a method. There is a form routine in the code. While doing the syntax check - it says before 'form' another structure opened by form should be ended by endform. I dont understand this. Please address this question too.

Thanks,

Raju

Former Member
0 Kudos

First of all do not include new question in existing thread. Post a new Thread for this.

Your original question resolution.

Create a fork(1 necessary branch and 2 parallel branch). In one branch put the approval step. In aonther branch put the wait for Change Event Step. Put this step in a loop. Now create an attribute inside your business object or amethod that will check whether it is a price change or not. You can achieve this by Changedocument. Read CDHDR and CDPOS table. Accordingly set a flag. If the flag is X means change in price the Loop condition will tereminate. Otherwise flag not X that means changes not relevant for approval.

Please close thread if resolved.

Thanks

Arghadip

Former Member
0 Kudos

Thanks guys,

I created a step with wait for event 'changed'. In the next step - developed a function module to check if the status of the quotation is changed to revised with a return flag parameter.

Based on the return flag - proceeded with next steps.

Thank you for quick answers.

Regards,

raju.

Answers (2)

Answers (2)

KKilhavn
Active Contributor
0 Kudos

As indicated by Surjith, use a fork with two (or more, depending on your events etc) parallel branches, of which only one has to complete to complete the whole fork. One branch will contain your subworkflow, the other branch(es) the event(s) that should cause termination of the current approval subworkflow and the creation of a new approval subworkflow.

Loop until the fork has been terminated via the subworkflow.

Former Member
0 Kudos

I think the answer is in your explanation -

>................

> he changes the status of the quote to

> 'revised' at header level. >

>

>

Where do you see this state being changed? What is being set? Provide more information about the 'quote'. what is BO?

Ravi