I am creating this blog when i came across finding objects in component extension 3 and how workflow is triggered in the process. request audience to share ideas where this is used.
The central tool for creating, displaying and processing a workflow is the workflow builder (Transaction SWDD). Within the workflow builder you can create all components of a workflow, for getting the data from one step to another.
Generally, most of the workflows are started by an event (for example, when a material is created or when a accident occurs). You define which data from this event needs to be passed to the workflow.
However you can also start any workflow directly. Let us create a simple workflow and start the workflow directly, using the testing tools.
Call transaction SWDD. When the workflow builder is called for the first time, a newly created initial workflow definition appears or else last created workflow appears. In such cases you can opt to create a new workflow by pressing “Create New Workflow. The following screen appears.
Now select the undefined step and select Create step or double click the undefined step. Now among the different steps chose the User Decision by double clicking on it
Now enter the title for the user decision “ Take decision”. Also enter the decision texts as Accept and Cancel. On pressing enter, the outcome values default to the Decision texts but you can specify your own names, if desired. Now we need to select the agent. Agent is the person to whom the work item needs to be sent.
Select the User from the drop down list and enter the user name say fgeorge to whom the work item needs to be sent. In general, this type of agent assignment is not done. Agents are generally assigned using the expression, agent assignment rule or organization object (job, position etc.).
Now select Transfer and to graphic button. Following screen appears:
Now we need to include a mail step to be sent to the requestor. Now select the line “Accept” and do a right click. Select Create.
Now select the step “Send Mail” from the list.
Now enter the subject and the body of the message for the mail to be sent.
Now select Transfer and to graphic button.A popup appears requesting for the abbreviation and the name for this task. Enter the same and press enter.
You get another pop up to enter the package. Now enter the package as local object and press enter.
You might get an error like this.
Enter the text in the main box below. The error will be removed. Save the data.
Now select Transfer and to graphic button. U will get a popup as below. Choose local object
You will find the screen as below with the workflow WS98100244 being assigned and status as New, Saved
To execute the workflow, activate it by choosing the activate button.
Test the workflow by choosing Test. The following screen appears
Now choose Execute to start the workflow.
Now the recipient would receive a work item in his SAP® inbox (Transaction SBWP).
Choose one among Approve or Reject as part of the user decision. He can select the third option to retain the work item in his inbox and make the decision later. Now suppose that the recipient has chosen one of the first options. Now a mail would be sent to the requestor with the status of his request
After u click Approve, u get the status as below
When you check ur inbox in txn SBWP, the status of workflow is displayed.
Please share thoughts on how this can be developed to suit our business requirements.