Advanced Features in SAP Workflow From Version 6.40

Download Advanced Features in SAP Workflow From Version 6.40

Post on 12-Nov-2014

20 views

Category:

Documents

2 download

Embed Size (px)

DESCRIPTION

sap

TRANSCRIPT

<p>Advanced Features in SAP Workflow from version 6.40</p> <p>Exception Handling in Workflow SWITCH in "Multi-condition" step Demo on "Local Workflow"</p> <p>Exception Handling in SAP Business Workflow</p> <p>From the release of SAP NW04 version, SAP has introduced many new features among which exception handling is one. Exception handling is done in workflow using Blocks (TRY-CATCH mechanism). Blocks is one of the new features introduced from NW04 version. This document details about the usage of Blocks and the approach to trigger and handle the exceptions. Pre-requisites It is assumed that the reader of this article has some knowledge in SAP workflow and has worked with the steps Mail, Process control earlier. Overview of Blocks</p> <p>Blocks could be treated as folders combining a group of dependent work items. They are shown as folders in the workflow log. Each block would have start and end nodes. Blocks can be deadline monitored (only Latest End) Blocks can catch exceptions</p> <p>Following are the screenshots representing how a Block appears in the workflow definition and in the workflow log:</p> <p>Fig: Appearance of Block in the Workflow definition.</p> <p>Fig: Appearance of Block in the Workflow log A Block is completed only if the dependent work items are complete or in the final state. If a Block is cancelled, all its dependent work items are cancelled. Each Block can have its own container elements. All the parent container elements are visible within the Block. Defining a Block</p> <p>Start a new workflow definition using the transaction SWDD Double-click on the Undefined step and select Block.</p> <p>Enter the step name and leave the block type as Standard. Press Enter. The workflow definition would be appearing as follows:</p> <p>All the dependent steps could be defined with in the Block start and Block end.</p> <p>As mentioned earlier, Blocks can handle exceptions. If an exception is caught, everything inside the block is cancelled. If exception is not caught, process is set to an ERROR state (This could be compared to TRYCATCH in ABAPTM programs. If the exception is not caught, program results in dump)</p> <p>Create a new workflow and define a new step Block as mentioned earlier page. In the Block step, click on the tab Exceptions and make an entry of a new exception, for e.g., Dummy_Excep, which would be raised in the workflow definition.</p> <p>Activate the exception defined above, by clicking on the button left to the exception name Go back to the main screen. Two branches would be appearing between the block begin and block end, as shown below. Exception branch is taken whenever the exception, Dummy_Excep, is triggered.</p> <p>Exceptions are triggered using the step Process Control. Define a new step Process Control in the normal branch. Enter the step name and the outcome name. Select Throw Exception in the function. In the event name, select the exception name defined earlier (see the screenshot below).</p> <p>Uncheck Step not in workflow log if you would like to see this step in the workflow log. Define a mail step in the exception branch of the block (for testing purpose to ensure that this exception branch is taken, when the exception is triggered). The execution flow of the exception handling is shown below:</p> <p>SWITCH in multiple condition</p> <p>SAP has introduced new features in Business Workflow in the releases 6.20, NW04 and NW04s. This Tutorial introduces you to a new feature SWITCH provided in the step Multiple Condition of SAP Workflow. It is assumed that the reader of this Tutorial has already some knowledge in Business Workflow and has worked on Multiple Condition step earlier. The SWITCH feature in the step Multiple Condition is provided from the release NW04. The only feature available before NW04 with this step is CASE. In the case of CASE, the workflow system checks the value of the basis of comparison against the defined comparison values (as shown below).</p> <p>In SWITCH, each branch of it carries a condition definition. We can visualize Multiple Condition with SWITCH as a group of Condition steps. Small scenario using Multiple Condition with SWITCH is shown below: Create a new workflow definition with a container element CARRID (Well known example for training purposes).</p> <p>Set the Properties as import. Double click on the undefined step to create a step Multiple Condition. Following screen appears:</p> <p>Select</p> <p>the</p> <p>Switch</p> <p>option</p> <p>in</p> <p>the</p> <p>Type</p> <p>field.</p> <p>Different types of conditions can be defined for each Outcome. Please note that:</p> <p>The conditions are defined in the given order. The first branch whose condition is evaluated TRUE is considered. If none of the condition is TRUE, a default branch is taken (Other values in the definition).</p> <p>Following</p> <p>are</p> <p>the</p> <p>conditions</p> <p>used</p> <p>in</p> <p>our</p> <p>example:</p> <p>The workflow definition would appear as follows:</p> <p>Insert an email step for each branch and check the output for various Carrid values.</p> <p>Understanding"LocalWorkflow"In this tutorial, we would explain creating and working with a local workflow. Go to Transaction SWDD. Create a new workflow definition. </p> <p>Go to Basic data (hat symbol) as shown in above screenshot. </p> <p>Fill-in the Abbreviation and Description and click on the tab Version-Dependent (Current Workflow Version). </p> <p>Enter a name for a local event. </p> <p>Go back to the main screen and create a new step. </p> <p>Select the step Event Creator. Provide the Step Name and Outcome Name. Also select Trigger Local Event in the Event Creator. </p> <p>Enter the name of the event we defined earlier. </p> <p>Go back to the main screen and create a new step (See the screenshot below) </p> <p>Select the step Local Workflow </p> <p>In the screen shown below, enter the step name and also event name we created earlier.</p> <p>Go back to the main screen. In the local workflow definition, right click and click on Create.</p> <p>Create a new step Mail.</p> <p>Go back to the main screen. The workflow definition would look as follows:</p> <p>Activate your workflow and test your workflow definition. You might not be able to find the email in your SAP inbox. Follow is the screenshot from the workflow log.</p> <p>When the main workflow is ended, the local workflow would automatically end with a status Logically deleted. The workflow would continue further after the step Event creator without waiting for the local workflow to complete. So let us create a step User Decision after the step Event Creator in the workflow definition.</p> <p>Activate and test run your workflow definition. You would now observe an email and also work item regarding the user decision step in your SAP Inbox (see the screenshot below)</p>