P. 1
Advanced Features in SAP Workflow From Version 6.40

Advanced Features in SAP Workflow From Version 6.40

|Views: 10|Likes:
Published by Ricardo Chiappe

More info:

Published by: Ricardo Chiappe on Mar 18, 2013
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Advanced Features in SAP® Workflow from version 6.


• • •

Exception Handling in Workflow SWITCH in "Multi-condition" step Demo on "Local Workflow"

Exception Handling in SAP® Business Workflow

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

• • • •

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

Following are the screenshots representing how a “Block” appears in the workflow definition and in the workflow log:

Defining a Block • • Start a new workflow definition using the transaction SWDD Double-click on the “Undefined step” and select “Block”. Each “Block” can have its own container elements. . All the parent container elements are visible within the “Block”.Fig: Appearance of “Block” in the Workflow definition. 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.

g. Dummy_Excep. If an exception is caught. everything inside the block is cancelled. If the exception is not caught. which would be raised in the workflow definition. Blocks can handle exceptions. Two branches would be appearing between the block begin and block end. program results in dump) • • Create a new workflow and define a new step “Block” as mentioned earlier page. process is set to an ERROR state (This could be compared to TRYCATCH in ABAPTM programs. Exception branch is taken whenever the exception. for e. by clicking on the button left to the exception name Go back to the main screen. The workflow definition would be appearing as follows: All the dependent steps could be defined with in the Block start and Block end. is triggered..• Enter the step name and leave the block type as “Standard”. As mentioned earlier. click on the tab “Exceptions” and make an entry of a new exception. as shown below. • • Activate the exception defined above. In the “Block” step. Press Enter. “Dummy_Excep”. . If exception is not caught.

In the event name. Define a mail step in the exception branch of the block (for testing purpose – to ensure that this exception branch is taken. Enter the step name and the outcome name. The execution flow of the exception handling is shown below: .• Exceptions are triggered using the step “Process Control”. • • Uncheck “Step not in workflow log” if you would like to see this step in the workflow log. Select “Throw Exception” in the function. select the exception name defined earlier (see the screenshot below). when the exception is triggered). Define a new step “Process Control” in the normal branch.

NW04 and NW04s. In SWITCH. the workflow system checks the value of the basis of comparison against the defined comparison values (as shown below).20. It is assumed that the reader of this Tutorial has already some knowledge in Business Workflow and has worked on “Multiple Condition” step earlier.SWITCH in multiple condition SAP® has introduced new features in Business Workflow in the releases 6. In the case of “CASE”. . This Tutorial introduces you to a new feature SWITCH provided in the step “Multiple Condition” of SAP® Workflow. each branch of it carries a condition definition. 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”. 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). We can visualize “Multiple Condition” with SWITCH as a group of “Condition” steps.

Set the “Properties” as import. . Following screen appears: Select the “Switch” option in the Type field. Double click on the undefined step to create a step “Multiple Condition”.

.Different types of conditions can be defined for each “Outcome”. Please note that: • • • The conditions are defined in the given order. a default branch is taken (“Other values” in the definition). The first branch whose condition is evaluated TRUE is considered. If none of the condition is TRUE.

Following are the conditions used in our example: The workflow definition would appear as follows: .

we would explain creating and working with a local workflow.   . Create a new workflow definition. Understanding "Local Workflow"   In this tutorial.Insert an email step for each branch and check the output for various “Carrid” values.   Go to Transaction SWDD.

  Go to Basic data (hat symbol) as shown in above screenshot.   .     Fill-in the Abbreviation and Description and click on the tab “Version-Dependent (Current Workflow Version).

  Enter a name for a local event.     Go back to the main screen and create a new step.   .

Also select “Trigger Local Event” in the Event Creator.     .  Select the step “Event Creator”. Provide the Step Name and Outcome Name.

    Go back to the main screen and create a new step (See the screenshot below)   .Enter the name of the event we defined earlier.

  Select the step “Local Workflow”   .

In the screen shown below. enter the step name and also event name we created earlier. In the local workflow definition. . Go back to the main screen. right click and click on Create.

Create a new step “Mail”. Go back to the main screen. The workflow definition would look as follows: .

Follow is the screenshot from the workflow log. You might not be able to find the email in your SAP inbox. . The workflow would continue further after the step “Event creator” without waiting for the local workflow to complete.Activate your workflow and test your workflow definition. So let us create a step “User Decision” after the step “Event Creator” in the workflow definition. When the main workflow is ended. the local workflow would automatically end with a status “Logically deleted”.


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)   .

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->