---
title: "转 Demo on working with “Nested / SubWorkflows”"
author: "evangxli"
date: "2013-08-07T11:41:23Z"
tags: []
categories: ["行业应用"]
slug: "demo-on-working-with-nested-subworkflows"
draft: false
lastmod: "2013-08-07T11:41:23Z"
id: 1917157
url: "https://sapabap.iteye.com/blog/1917157"
---

#### Demo on working with "Nested / SubWorkflows"

By Avinash Palavai, StraVis IT Solutions from [Link](http://www.saptechnical.com/)

 

**Prerequisite :  Should have basic idea of worklow and usage of [Send Mail](http://saptechnical.com/Tutorials/Workflow/WorkflowTutorialOne/WorkFlowTutorial1.htm) and Activity Steps.**

1)     Go to the transaction **SWDD** ( Workflow Builder ). By default, it opens the last developed workflow. So click on create ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.4.jpg) to create a new Workflow. Below screen appears.

     ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.5.jpg)

2)     Now create a step “**Send Mail**”, by double clicking on Undefined Step.

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.6.jpg)

3)     Now the below screen appears and, fill the screen as shown below and click on Transfer and to graphic ( ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.7.jpg)).  

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.8.jpg)

4)     Now a pop up appears and give the abbreviation and name of the task as below,

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.9.jpg)

5)     Your workflow will look like below,

    ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.10.jpg)

6)     Save and activate the workflow, now a workflow no. will be assigned to your workflow as shown below,

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.11.jpg)

7)     Now again create a new workflow, repeating the steps (1 & 2) and fill the “Send Mail” step as below,

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.12.jpg)

8)     This time give the name as Main workflow as shown below,

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.13.jpg)

9)     Your 2nd workflow (Main Workflow) would now appear as below and create an additional step “**Activity**” to trigger the sub workflow.

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.14.jpg)

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Index.15.jpg)

10)  Now the below screen appears enter the **Sub workflow no. (WS99900005**) i.e., created above and the step name as shown below and click on Transfer and to graphic ( ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Page2.16.jpg)).  

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Page2.17.jpg)

11)  This is how your main Workflow looks like,

  ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Page2.18.jpg)

12)  Save and activate and a Workflow no. will be generated as shown below,

  ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Page2.19.jpg)

13)  Now you can test run the workflow, by clicking on the test ( ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Page2.20.jpg)), and the below test screen ppears.

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Page2.21.jpg)

14\) Click on execute ( ![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Page2.22.jpg)). Now your main workflow and the subworkflow nested in it is also executed.

15\) Go to your Business workplace (**SBWP**) and check the inbox. You will find two mails with the titles

“**Mail in Main Workflow**” triggered from main WF and “**Mail in Sub Workflow**” triggered from Sub WF.

![](http://www.saptechnical.com/Tutorials/Workflow/SubWorkflow/Page2.23.jpg)