Generating Sub Workflow
Is there a way for me, inside a workflow, start a subworkflow not by putting it in a task but by sending parameters like "wsxxxxxx" (subworkflow) with container x, y and z. Then wait for the end of this subworkflow and continue. Explaining... what I need to do is to start a subworkflow based on a customizing table that starts the correct one from a parameter in the container. Table:
if container_value = 1 start subworkflow ws9900001
Is there a standard function to do this??? Why don't you create a Condition Step ? Therefore, you could trigger the right subworkflow according to the criteria. The purpose is to have that information in a table and that the primary workflow doesn't get very complicated. If I have 20 subworkflows I don't have a condition with 20 exits. It also needs to become more flexible, that is, if I need a new subworkflow I just add this in the table. I have already implemented this way... with the conditions, but the production requests for changes are heavy and this would ease the process in the future, that is, be extremeally flexible. OK, I see where your problem is. Unfortunately, I don't think SAP provide us an easy way to swap the subworkflows yet. For those who knows how to do this, please let us know, it's very useful. In the meanwhile, what I could think of is writing a custom method to choose the subworkflow and trigger it dynamically. Therefore, you could create a table to maintain the subworkflows and the criteria easily. So you'll need an ABAPer to do that for you if you're not familiar with ABAP. Hope this helps. 1. Add one of your subflows to the main workflow as an activity step and define the binding. This subflow is just a place-holder and will be replaced by another subflow when the workflow runs. 2. In the step definition specify "Task to be determined using an expression" and specify which container element (or expression) contains the subflow ID to be used. At run time, the place-holder subflow will be replaced by the subflow that is specified by the expression. In other words this expression reads the table that you created to find the subworkflow to call and this subworkflow is called by the main workflow instead of the (static) place-holder subflow. Yes, there is a standard function.
Made a test... worked great.
See Also
Get help for your SAP WF problems
SAP Work Flow Books
SAP WorkFlow Tips
Best regards,
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|