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:
1 - ws9900001
2 - ws9900002
.....................

if container_value = 1 start subworkflow ws9900001
with subworkflow_containerX = containerX
end if

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.
container_value=ws9900001
use container_value as the expression as described previously.

Made a test... worked great.

See Also
Workflow of Purchase Requisition Release Strategy

Get help for your SAP WF problems 
Do you have a SAP WorkFlow Question?

SAP Work Flow Books
SAP WorkFlow Process and Interview Questions Reference Books

SAP WorkFlow Tips
SAP Business WorkFlow Tips and WF Discussion Forum

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.