33
Workitems, UWL and Web Dynpro for ABAP Thomas Kosog Platinum SAP Workflow Consultant

Workflow Web Dynpro UWLs

Embed Size (px)

Citation preview

Page 1: Workflow Web Dynpro UWLs

Workitems, UWL andWeb Dynpro for ABAP

Thomas KosogPlatinum SAP Workflow Consultant

Page 2: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 2

Topics

UWL (Universal Worklist) on the Enterprise Portal EP 6.0

UWL Configuration Steps

Generate XML File to define Workitems for the UWL

Advanced Configuration for a User Decision on the UWL

Design and Program for a Web Dynpro for ABAP Application,so it can be called from a Workitem

Test Web Dynpro to execute a User Decisionand look at the Workflow Log

Integrate the Web Dynpro for ABAP Applicationinto your Workflow

Advantages of Web Dynpro for Workflow

Page 3: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 3

1995

EP 5.0

2003

SAP NetWeaver ‘04

SAP NetWeaver 2004s

BusinessWorkflow

UniversalWorklist

+ CollaborationTasksBPM

+ GuidedProcedures

Business Task Management is Evolutionary

+ Work ItemcallingWeb Dynprofor ABAP

Web Dynpro for ABAP is available with SAP NW 2004s

Page 4: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 4

Roleresolution

rule

Org.structure

Task

Person

Position

Work-place

Group

Organi-zationalelement

Execute

Forward

Add Note

Replace

Earliest start

Latest start

Latest end

Roles

Keystructure

Attributes

Methods

ABAP

CallTransaction

INCLUDE<cntn01>

ABAP OO

Objects

Work items

Event Work item

Functionmodule

Workflow

Publish &subscribe

flexible coupling

Events

TaskObjects

AGENT

Events

Trigger

Workflow Engine

No changes in the Workflow Engine for the Web Dynpro for ABAP approach

Page 5: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 5

Workflow Builder

Detail

Header

Steps

Step Types

Birds-eyeView

Information

No changes in the Workflow Builder for the Web Dynpro for ABAP approach

Page 6: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 6

Universal Worklist

UWL is part of the standard user end role, accessed via Home - Work

Hint: To Refresh your lists of tasks, use the dropdown menu near the Hide Preview link.

UWL advantages: connection to several systems, UserDecision with mandatory text, launch Web Dynpro for ABAP(Web Dynpro for ABAP applications should be started from the Portal)

Page 7: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 7

Workflow Steps based on User Decisions

Continue ?End ?

Continue ?End ?

Continue ?End ?

Continue ?End ?

Continue ?End ?

StandardTaskTS00008267SAP-GUI

StandardTaskTS00008267UWLStandard

CustomTaskTS98700001UWLSAP GUIfor HTML

CustomTaskTS98700002CustomUWL XMLconfigurationfor userdecision

CustomTaskTS98700003CustomUWL XMLconfigurationfile forWeb DynproLauncher

Start-Date: ______Initiator: ______

Reason:

Go-On End

Page 8: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 8

UWL with custom configured User Decision

USER DECISIONwith mandatory Text“Reason”

Workflow AttachmentUWL MEMO

Display log of currentWorkitem, upload filesand create “Ad Hoc” Tasks

Display log of allyour Workflows

Warning messagesSelect primary WI orWI delegated to you

Delegate

Page 9: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 9

UWL Configuration Steps

Goal: Workitem in UWL calls a Web Dynpro for ABAP application

1. Build Web Dynpro for ABAP applicationvia transaction SE80

2. Test via transaction SE80 or URL(Logon to SAP is required)

3. Use transaction SWFVISUto prepare standard setting foryour Workitem in the UWL

4. Portal UWL Administration5. Test Workitem from UWL

(No extra Logon is required)6. Advanced Configuration

via custom XML file for special UWL featuresor Portal Wizard

Page 10: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 10

Basic Configuration for the Universal Worklist

Sequence of major steps:- Portal Setup- Landscape configuration- Menu: System Administration / System Configuration /

Universal Worklist Administration

Important:Do not forget to clear the cacheand also delete the expired workitems

- ActivateSystems Inyour Landscape

- RegisterSystems andItem Types

Result:Portal willload one XMLfile, where eachtask has itsown definition

Page 11: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 11

Additional Configuration for the Universal Worklist

Set to TRUEto see moreWorkitem informationduring Testing

Next Page

Change settingswithout customcreated XML files.Available with recentPortal Support Pack

Page 12: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 12

XML File Administration

At runtime, when you refreshyour UWL in the Portal, thenthe Portal will search throughall XML files (or the cache)in the priority sequencefrom high to low.

In the display on the left,each line is its own XML file.

One Workflow Task can bedefined in many XML files.

In the UWL each Workitemwill be displayed based onthe configuration setting ofthe correspondingWorkflow Task, which wasfound first.

Hint: Upload custom XML files from your PC as “High”

Page 13: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 13

Download, Copy and Change XML File

When you download a XML file, you don’t have to delete this XML file in the Portal.Only keep those Item Types in your file, which you want to change and erase the others.Afterwards upload the file with a custom name and the priority “High”.

Approval with optional text

Rejection requires a reason

Page 14: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 14

Let SAP generate a XML file for You

Z_USER_DECISION

TransactionSWFVISU on yourSAP system,where you definedyour Workflow

Hint: Add this configuration to a customizing transport

Steps:- Enter your Task- Select

“ABAP Web Dynpro”- Enter your Web

Dynpro Application- The namespace

is always “SAP”

Page 15: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 15

Generated XML Configuration

“Z_USER_DECISION”

The generated XML is “ready to go”.You do not have to change the XML file, which was generated by SAP

Page 16: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 16

Advantage of User Decision for Web Dynpro

No special Business Object required

Decision of the Web Dynpro applications can easily be mappedinto options of the User Decision, for example- Approved (or ‘Yes’)- Rejected (or ‘No’)

Workflow Builder provides a special step type

Workflow provides one branch for every option

Workflow Log shows, which decision was selected by whom

Page 17: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 17

Accessing Workflow Data without a Web Dynpro Application

Step 1

Step 3Task 98700001

Step 2

WorkitemFor Step 3

WorkitemContainer

(local)

WorkflowInstance

WorkflowContainer(global)

Workflow Definition(Design Time)

Workflow Runtime

WorkflowContainer

Binding

Load data when WI is created

Return data when WI completed

BusinessObjectMethod

BusinessObjectMethod

Launch

AutomaticKey &ParameterAccess

Page 18: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 18

Accessing Workflow Data from a Web Dynpro Application

Workflow at runtimeWhen the task is based on a Web Dynpro,then the application has to read the WI Containerand update the WI Container explicitly

WorkflowContainer User Decision

Work itemContainer

UWL

Work itemContainer

Data

Work

itemID

WorkflowContainer

Data

Data

1. Automatic

2. Automatic5. Automatic

4.B CustomProgram

3. Aut

omati

c

4.AAutomatic

Page 19: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 19

Web Dynpro Component Architecture

Business Logic

(Models)

ComponentController

Model 1

Model 2

Contains Usagedeclarations

Usa

ge d

ecla

ratio

ns

W e b D y n p r o C o m p o n e n t

Components

CustomController

Component Interface

InterfaceController

Interface view

WindowWindowController

ViewLayout

ViewController

M

M

M

M

M

Interface view

SAP Web Dynpro uses principles of MVC paradigmModel holdsbusiness logic,when BAPI calls areused

Views define- field layout &

context mapping- buttons & actions

Controller handle theuser input

Window MethodHandleStartis called by inboundplug of yourWeb Dynpro whenlaunched from UWL

Page 20: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 20

Prepare Web Dynpro for ABAP Application for UWL

- Define STARTAs an Inbound Plug- Declare STARTas “the” Plug,when applicationis called- Provide defaultFor testing

Web DynproEvent Handlerwill callassignedMethod,whenapplicationis launched

Page 21: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 21

Context for Component Controller & Window

- Define Contextfor the ComponentController

- Define ControllerUsagefor your window

Drag & DropContextinto yourwindowcontext(Mapping+ Binding)

Page 22: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 22

Window – Method “HANDLESTART” Load Context

Read Workitem Container and load Context

Page 23: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 23

View Layout based on Context

First Map & Bind Window Context to View Context, then define Layout

REASONis dynamicallyenabled, whenFRESH_FLAG = ‘X’at runtime

Page 24: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 24

WindowView ControllerMAIN-View

View Controller

Start Plug

Web Dynpro Plugs and Navigation

Confirmation View

Create Action

OUT

IN

IN

Update Workitem

Page 25: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 25

Define an Action to navigate to next View

Plugs are called by Actionsand enable navigation routes

Page 26: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 26

Action - Program

• Read current field values from Context• Prepare Workitem Container• Complete Workitem• Navigate to next View

0001Refers tothe firstoption ofthe userdecision

Page 27: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 27

SWU3- Start Verification Workflow and get Workitem Number-- Open Inbox-- Select new Workitem-- Get Workitem Number

Test from Transaction SWU3 and SE80

Clicking on the “Approved” button completed the Workitem of the Verification Workflowvia the Web Dynpro for ABAP application

Workitem numberof the user decisionstep “VerificationWorkflow” (SWU3)

SE80

Page 28: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 28

Workflow Log for this Test

The Workflow Log shows the user whocompleted the workitem and the Result asassigned in the ACTION-Program.

The Workitem Container shows the data,which was passed from the Web Dynpro,when the function was called to completethe Workitem.

Page 29: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 29

Adjust Workflow for Custom “User Decision” Step

TS98000130 was copied from TS00008267

00010002

Page 30: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 30

Custom Business Object Type ZDECISION

Page 31: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 31

WD Workitem may only be launched from UWL

Executing the WI from the SAP GUI transaction SBWP would justcall the User Decision, but not the Web Dynpro for ABAP application

Selecting one of the User Decision optionswould complete this workitem

To prevent this from happening, put a break in this method-callDefine the subtype ZDECISION of the Business Object Type DECISIONDo not define this as a system wide delegationRedefine the Method PROCESSExample on previous slideWhen this Workitem is now executed from the SAP GUI,then the user gets the error messageand the Workitem keeps the status “STARTED”

Page 32: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 32

Web Dynpro for ABAP - Advantages

ABAP programmers will be able to learn Web Dynpro for ABAPrelatively fast, after an initial training and some tutorials.

The Web Dynpro program is based on standard ABAP, you can useany Table / Field / Data Type, Function, or Object Method.

Good documentation about “Web Dynpro for ABAP” on SAP SDN

Web based Front-End for SAP Portal Users

Integrated in Portal UWL via SAP-Web-Dynpro-ABAP-Launcher

Existing Workflow Steps can be transformed into Web Pages

New Workflows can be designed with Web Pages in mind,for example Form-Based Workflows:

Initial-Request and Workflow Approval Steps will use the same formwith different buttons (“Submit / Cancel” or “Approve / Reject”)Fields can be dynamically enabledAfter Approval, a Workflow Background Step calling a providedBAPI can create or change SAP data.

Page 33: Workflow Web Dynpro UWLs

SAP AG 2007, Kosog / WD4A & UWL / 33

Copyright 2007 SAP AG. All Rights Reserved

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may bechanged without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, System i, System i5, System p,System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC aretrademarks or registered trademarks of IBM Corporation.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.

MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registeredtrademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies.Data contained in this document serves informational purposes only. National product specifications may vary.

The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted in any form or for any purpose without the express priorwritten permission of SAP AG.

This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This document contains only intended strategies, developments,and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business, product strategy, and/or development. Please note that thisdocument is subject to change and may be changed by SAP at any time without notice.

SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics, links, or other itemscontained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability,fitness for a particular purpose, or non-infringement.

SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. Thislimitation shall not apply in cases of intent or gross negligence.

The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained inthese materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages.