Upload
others
View
24
Download
0
Embed Size (px)
Citation preview
MIKE STOKO[ASUG INSTALLATION MEMBER MEMBER SINCE: 2003
BOB GAUTHIER[ASUG ASSOCIATE MEMBER MEMBER SINCE:1998
CHRISTINA CRONE[ASUG INSTALLATION MEMBER MEMBER SINCE: 1999
]Use Web Dynpro for ABAP, Workflow and the UWL to Revolutionize
Decision Processing Jon CocksSAP NetWeaver DevelopmentBoeing Service CompanyNovember, 2009
[
Real Experience. Real Advantage.
Disclaimer The information in this presentation is confidential and proprietary to SAP and may not be
disclosed without the permission of SAP. This presentation is not subject to your license agreement or any other service or subscription agreement with SAP. SAP has no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation and SAP's strategy and possible future developments, products and or platforms directions and functionality are all subject to change and may be changed by SAP at any time for any reason without notice. The information on this document is not a commitment, promise or legal obligation to deliver any material, code or functionality. 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. This document is for informational purposes and may not be incorporated into a contract. SAP assumes no responsibility for errors or omissions in this document, except if such damages were caused by SAP intentionally or grossly negligent.
All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
[
Real Experience. Real Advantage.
Agenda Introduction Key Learning Points Background
The Decision Challenge Challenges with SAP Workflow Senior Decision buy-in
The Solution Building a Web Dynpro for ABAP solution integrated with the
UWL and Workflow/Webflow engine Building a Robust Web Dynpro for ABAP Application
[
Real Experience. Real Advantage.
Agenda5. Integrating the Webflow/Workflow engine Decision Options On Action Event Handling Configure workflow task to launch WD4A Application
6. Customizing the Universal Worklist Initial Configuration Customizing the XML
7. Block Users from using the SAP GUI Inbox8. Manage the pop-up window the UWL launches Configuring an EXIT_PLUG Fire the EXIT_PLUG
[
Real Experience. Real Advantage.
Key Learning Points Identify Pain Points for using standard SAP GUI based workflow Building a robust Web Dynpro for ABAP application Integration with the Webflow/Workflow engine Customizing the Universal Worklist XML container Block users from using the SAP GUI workflow inbox Manage the pop-up window that the UWL launches for the Web Dynpro for
ABAP
This presentation assumes some knowledge of Workflow, the Universal Worklist (UWL), and Web Dynpro for ABAP (WD4A).
[
Real Experience. Real Advantage.
Background – the Boeing Service Company Infrastructure Support Services Facilities-related services for sophisticated
secure facilities Facility systems engineering and analysis SAP ERP implementation and
sustainment SAP Services Partner Design and build of operation centers /
facilities Information Services and Network Operations Mobile satellite broadband communications
and managed network services Message handling systems Design, integration, support
Launch and Range Support Launch and range operations, payload
processing System integration and upgrade, test &
evaluation
BBSN StrykerComm-on-move
Information Services
Spacelift Range Systems FCS Support
Range and Technical Services
CROSS
Infrastructure Support Services
[
Real Experience. Real Advantage.
Agenda Introduction Key Learning Points Background
The Decision Challenge Challenges with SAP Workflow Senior Decision buy-in
The Solution Building a Web Dynpro for ABAP solution integrated with the
UWL and Workflow/Webflow engine Building a Robust Web Dynpro for ABAP Application
[
Real Experience. Real Advantage.
Decision Making Challenge Successful Decision making
requires: Clarity of key details Access to all the relevant data to make a
decision Access in a timely manner Intuitive design and interface
The SAP Workflow (and Webflow) engine make it possible, but… SAP GUI formatting Business Objects contain values, not
descriptions Senior decision makers aren’t familiar
with the SAP GUI and don’t log in on a regular basis
Misinformation – ex: no extended price
[
Real Experience. Real Advantage.
More Challenges The Portal’s Universal
Worklist (UWL) is a portal based technology that brings all user work items from a number of systems to a central point of access
Although presented in a web browser, the UWL, suffers from the same challenges
Most decision tasks are overly simplistic (approve or reject) No “reason for rejection” Limited ability to include
alternatives other than the standard “Forward” options
[
Real Experience. Real Advantage.
Senior Decision-Maker Buy-In “What are all these buttons?” “It’s too confusing…” “Why didn’t it give me all the
information I needed to make that decision?”
“What do you mean I have to navigate to the transaction itself? What do you mean I needed to “drill-down”? What is ME52N?”
“Why can’t you just give me all the information I need to make a decision on one single screen?”
[
Real Experience. Real Advantage.
Agenda Introduction Key Learning Points Background
The Decision Challenge Challenges with SAP Workflow Senior Decision buy-in
The Solution Building a Web Dynpro for ABAP solution integrated with the
UWL and Workflow/Webflow engine Building a Robust Web Dynpro for ABAP Application
[
Real Experience. Real Advantage.
Web Dynpro for ABAP Decision Window
Use the Universal Worklist to launch a Web Dynpro for ABAP application decision screen that includes all the information you need to enable decision maker.
[
Real Experience. Real Advantage.
Displaying All the Requested Information for the Decision Maker
Add additional information beyond what is contained in the Business Object GL Account / Cost Center Information Extended Price Related Requisitions (by cost center and plant)
Display text and icons to represent information in place of codes and data Meaningful Decision buttons along with drop-down for Reason for Rejection
[
Real Experience. Real Advantage.
Benefits Fully integrated with the SAP workflow / webflow engine
The Workflow step actually launches the Web Dynpro for ABAP application Using the SAP supplied BAPIs for workflow you can update the workflow
container with the decision and set the workflow step to completed. Integration with the Enterprise Portal’s Universal Worklist enables decision
makers to execute decisions without needing to log in to the SAP GUI No limitation to the information that can be presented to the decision maker
The only limits are creativity in UI design and performance considerations Complete control over the design of the User Interface allowing you to
present the information in an intuitive way Use graphics, icons and other techniques to display information Use the header sections of the groupings to display key information Use tooltips and other techniques to ensure Accessibility concerns are addressed
(i.e. 508 and/or 504 compliance) Can be built today – no need to wait for 7.20 or Business Suite 7.
This solution was built on the following platform: ECC 6.0 SPS 10 (mySAP ERP 2005) EP 7.0 SPS 10 (Enterprise Portal 7.0)
[
Real Experience. Real Advantage.
Agenda Introduction Key Learning Points Background
The Decision Challenge Challenges with SAP Workflow Senior Decision buy-in
The Solution Building a Web Dynpro for ABAP solution integrated with the
UWL and Workflow/Webflow engine Building a Robust Web Dynpro for ABAP Application
[
Real Experience. Real Advantage.
Building the Web Dynpro for ABAP Application
Start a new WD4A application / define START plug
Insert a new Startup Plug called “Start” on the Window component
Create a new Web Dynprofor ABAP application
[
Real Experience. Real Advantage.
Building the Web Dynpro for ABAP Application
Create Application and Set START plug
Create a new “Application”
Use the “Start” plug you already defined as the
“Plug Name” for this new application
[
Real Experience. Real Advantage.
Building the Web Dynpro for ABAP Application
Define Inbound Parameters Define inbound parameters for the newly created application
TIP: Remove the default value for WI_ID when you
deploy to production
Make sure you add the WI_ID as a parameter
on the Window HANDLESTART
event handler
[
Real Experience. Real Advantage.
Building the Web Dynpro for ABAP Application
Set the component controller context and build your context nodes
Set up the component controller context for the Window.
Build your component controller context.
The component controller is shared across all views and windows.
Consider these “global” variables and manage them accordingly.
[
Real Experience. Real Advantage.
HANDLESTART Event Handling
Data Declarations / Obtain the context nodes
Data DeclarationsObtain the Context nodes
TIP: Before you start processing the workflow item, check that WI_ID is not initial. This will help avoid
unexpected results.
[
Real Experience. Real Advantage.
HANDLESTART Event Handling
Obtain the key data from the controller context
Read the work item container.
Obtain the Requisition Number and Line Item number and store in component controller context.
[
Real Experience. Real Advantage.
HANDLESTART Event Handling Reserve the workitem Check work item status and
reserve the work item for processing.
If the work item is already in process, identify the user (wi_aagent) and name of the person (wi_aa_name) who has the work item in process.
[
Real Experience. Real Advantage.
HANDLESTART Event Handling
Check for the following conditions before you allow the user to reserve the workitem: The workitem is in a READY status (ready to be processed)
The workitem could be reserved by someone else; or The workitem may be reserved by the current user (i.e. accidentally opening the work
item in multiple pop-up windows) The underlying business object is not currently locked (ex: the user could be
currently editing the Purchase Requisition). If the workitem cannot be reserved, present an appropriate message to the
processor
Consider adding a button to allow the user to “unlock” the work item – but only if sy-uname = wi_aagent.
Reserve the work item
[
Real Experience. Real Advantage.
Building the Web Dynpro for ABAP Application
The default setting is “framework controlled”. According to SAP HELP this means that “the view data is kept until the calling component is exited.”However, in practical experience, especially working with WD4A applications in a clustered production environment when users “navigate away” from a WD4A application you can occasionally get memory errors. This appears to be caused by inconsistent clean-up of component controller data stored in memory. Consider switching the Lifetime attribute to “when visible”.
View: Setting the Lifetime attribute of your Views
Recommendation: Switch to using “when visible”. View data is then cleaned up when the browser is closed (or navigated away from).
[
Real Experience. Real Advantage.
Building the Web Dynpro for ABAP Application
Be sure to add appropriate code to “clean-up” your component controller context when a user closes the browser window or navigates away from the Web Dynpro application within the portal. This is most effectively done on the WDDOEXIT Method of the Component Controller itself.
Handling Component Controller Context Clean-up
Recommendation: Be sure the check the “REASON” the application has been exited. ‘U’ = Browser unload; ‘T’ = Session Timeout; ‘ ‘ = Terminate app using Exit plug
[
Real Experience. Real Advantage.
Building the Web Dynpro for ABAP Application
Sample code for cleaning up the component controller context
Handling Component Controller Context Clean-up
Be sure to replace the workitem, if the user hasn’t actually processed the workitem.
[
Real Experience. Real Advantage.
Building the Web Dynpro for ABAP Application
Consider using View specific context to manage dynamic labeling. Allows the flexibility of dynamic labels with the need to build completely dynamic UI elements (allows the developer to continue to use the “Layout” tab of the View designer to graphically build the user interface).
View Processing: Adding local context to the controller
Add any “local” context elements needed to handle data on the View.
[
Real Experience. Real Advantage.
Agenda5. Integrating the Webflow/Workflow engine Decision Options On Action Event Handling Configure workflow task to launch WD4A Application
6. Customizing the Universal Worklist Initial Configuration Customizing the XML
7. Block Users from using the SAP GUI Inbox8. Manage the pop-up window the UWL launches Configuring an EXIT_PLUG Fire the EXIT_PLUG
[
Real Experience. Real Advantage.
Integrating the Webflow/Workflow Engine
Decision Options in the workflow taskStandard “User Decision” workflow step.
Customize the Decision Options as appropriate. Keep in mind how the workflow engine interprets each decision option as a numeric value. Ex: Approve = ‘0001’.
[
Real Experience. Real Advantage.
Integrating the Webflow/Workflow Engine
Pass the appropriate decision code for each on action event Approve Button = ‘0001’ Reject Button = ‘0002’
On Action Event Handler: Approve Button
On Reject, check to make sure the user has selected an appropriate “Reason for Rejection” from the drop-down box.
The “Reason for Rejection” can also be passed to the workflow container as a line in the l_contcontainer.
[
Real Experience. Real Advantage.
Integrating the Webflow/Workflow Engine
Now that we have added the code for our Web Dynpro application to interact with a workflow container, we need to configure the system so that it will launch the Web Dynpro application from the Universal Worklist (UWL).
Launching the WD4A from the Universal Worklist
[
Real Experience. Real Advantage.
Integrating the Webflow/Workflow Engine
Use the transaction SWFVISU to configure the workflow engine to launch the Web Dynpro for ABAP. This will automatically generate standard XML code to launch the Web Dynpro for ABAP application from the Universal Worklist. The transaction SWFVISU is used to map the specific workflow tasks (TS) to the UWL. This is only a temporary setting since we will be customizing the XML.
Configure workflow task to launch WD4A Application
[
Real Experience. Real Advantage.
Agenda5. Integrating the Webflow/Workflow engine Decision Options On Action Event Handling Configure workflow task to launch WD4A Application
6. Customizing the Universal Worklist Initial Configuration Customizing the XML
7. Block Users from using the SAP GUI Inbox8. Manage the pop-up window the UWL launches Configuring an EXIT_PLUG Fire the EXIT_PLUG
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Menu path: System Administration -> System Configuration -> Universal Worklist & Workflow -> Universal Worklist - Administration
Register Item Types for All Systems
Since you have configured the system to launch the Web Dynprofor ABAP using SWFVISU, you must register the item types to generate the XML.
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Always clear the cache after registering item types. Tip: Make it a habit to clear both the cache and the expired items
Clear the CacheMenu path: System Administration -> System Configuration -> Universal
Worklist & Workflow -> Universal Worklist - Administration
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Note: It may take several attempts at refreshing the cache; and/or refreshing your browser cache and browser history to see the new button
Launch Web Dynpro for ABAP
You should now see a button appear allowing you to launch the Web Dynpro from the Universal Worklist
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Select the uwl.workflow.IDES_CORE and confirm that your workflow Task appears and the XML is configured to launch the Web Dynpro for ABAP
Obtaining the XMLMenu path: System Administration -> System Configuration -> Universal
Worklist & Workflow -> Universal Worklist - AdministrationNote: IDES_CORE will be whatever your System Alias has been set up as by the portal administrator.
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Select the uwl.workflow.IDES_CORE Scroll down to the bottom of the page and click the Download Configuration button
Download the XML file
Use an appropriate XML editor to edit the contents of the XML configuration downloaded
Examples: Frontpage Adobe Go-Live Ultra Edit Etc.
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Delete all entries in the XML file except for the entry for your custom Task.
Save the file as uwl.webflow.custom.IDES_CORE.xml
Customizing the XMLTip: you should only have a single pair of <ItemType> and </ItemType> tags contained within the parent element <ItemTypes>
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Change the defaultAction and Action name “launchWebDynpro” to read “ProcessRequisition” This will change the text of the button from “Launch WebDynpro”
to “ProcessRequisition” Adjust the variables controlling the pop-up window.
Adjust the default size and position of the window Adjust whether or not users see menubars, toolbars, etc.
Customizing the XML
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Uploading your Customized XML configurationNote: Do not include the system id in the Configuration name. When you select IDES_CORE from the Adapt to System option it will concatenate the System id to the name of the XML file.
Note: Always select the “High Priority” checkbox on your custom XML configurations. This will ensure that no configuration on the back end will over-ride your customized XML configuration.
[
Real Experience. Real Advantage.
Customizing the Universal Worklist Double-check that your
configuration is set with a “High” priority.
Confirm that your customized XML is uploaded correctly.
Verify your customized XML configuration
[
Real Experience. Real Advantage.
Customizing the Universal Worklist
Now that you have customized the XML for the workflow task and set the priority to “high” you can reverse the configuration in SWFVISU. Your XML is a higher priority and will always over-ride any configuration generated by SWFVISU settings.
Verify XML configuration is working and Reverse SWFVISU settings
Note: Don’t forget to clear the cache after verifying that your customized XML configuration has been successfully uploaded.
[
Real Experience. Real Advantage.
Some Minor Loop Holes Remain This work has generated a unique and powerful application allowing
users to make better decisions. However, there are still some loop holes that we need to address
A decision maker can still access the workflow item in their SAP GUI Inbox and execute the decision in the inbox. The SAP GUI Inbox will not launch the Web Dynpro application
A decision maker may reject a request and not supply a reason for rejection Or the decision maker could accidentally “Technically complete” the
workflow step without actually making a decision
The Universal Worklist launches the Web Dynpro for ABAP Application in its own pop-up browser window. The Web Dynpro for ABAP toolset does not allow you to automatically
close the browser window when the user clicks on the Approve or Reject buttons.
[
Real Experience. Real Advantage.
Agenda5. Integrating the Webflow/Workflow engine Decision Options On Action Event Handling Configure workflow task to launch WD4A Application
6. Customizing the Universal Worklist Initial Configuration Customizing the XML
7. Block Users from using the SAP GUI Inbox8. Manage the pop-up window the UWL launches Configuring an EXIT_PLUG Fire the EXIT_PLUG
[
Real Experience. Real Advantage.
Block Users from Using the SAP GUI Inbox
Redefine the Method PROCESS and code your own implementation
Defining a subtype of the Business Object DECISION
Note: Do not make it a system wide delegation
Note: The Method PROCESS is now ready for your own implementation.
[
Real Experience. Real Advantage.
Block Users from Using the SAP GUI Inbox
Using the Workflow Macros to end processing (ex: EXIT_CANCELLED) will result in the work item being reserved. This may not be desirable in a
scenario where the workflow is routed to a group of approvers.
Instead display an appropriate message to the user and then execute the function SAP_WAPI_PUT_BACK_WORKITEM by calling the function SWW_WI_BACK.
Code your PROCESS method
[
Real Experience. Real Advantage.
Block Users from Using the SAP GUI Inbox
Edit your Workflow definition and change your generic user Decision to use the ZDECISION Object Type instead of the default DECISION object Type.
Adjust your Decision Task to use the new ZDECISION
[
Real Experience. Real Advantage.
Agenda5. Integrating the Webflow/Workflow engine Decision Options On Action Event Handling Configure workflow task to launch WD4A Application
6. Customizing the Universal Worklist Initial Configuration Customizing the XML
7. Block Users from using the SAP GUI Inbox8. Manage the pop-up window the UWL launches Configuring an EXIT_PLUG Fire the EXIT_PLUG
[
Real Experience. Real Advantage.
Manage the Pop-up Window the UWL Launches
Configure an EXIT plug on the Window of the Web Dynpro Application Be sure to set the plug type as “EXIT” Check the “Interface” check-box
Configure an EXIT plug
[
Real Experience. Real Advantage.
Manage the Pop-up Window the UWL Launches
Create a simple html file that calls a javascript to close the current window when the file loads
Upload the html file as an Imported MIME Object to your Web Dynpro application
The html page is now a callable static web page that can be “fired” by a plug within your Web Dynpro application
Create the closewin.html file
[
Real Experience. Real Advantage.
Manage the Pop-up Window the UWL Launches
On the Action Event Handlers for both the Approve and Reject Buttons add the code displayed on the left
Note that you must provide both the Close_Window and URL parameters
Make certain that you have finished processing all other code before you execute the EXIT_PLUG
On Action Event Handler: Approve and Reject
Note: This code may not work for all patch levels of the Enterprise Portal. This was tested and implemented with EP 7.0 sps 10.
[
Real Experience. Real Advantage.
Manage the Pop-up Window the UWL Launches
Now, when a decision maker selects either the Approve or Reject button, the system will process the request, update the workflow, record the reason for rejection and then close the pop-up window.
This method worked on Enterprise Portal 7.0 sps 10, using IE 6.0. A common error message is: “The Triggering of an Exit Plug Using a
Specified URL Is Not Supported in Enterprise Portal” Check your Support Package Stack level as well as SDN and OSS
You may encounter problems with browser restrictions (depending upon the version of IE you are running), and or challenges with the exact code that works for you.
Check SDN (www.sdn.sap.com) frequently (search for key word “EXIT_PLUG”). There are many blogs and forum messages dealing with this topic – many of which offer different approaches to solving this challenge
If you have already implemented either SPS 14 or NetWeaver EHP1 you can take advantage of a new paramater on the EXIT_PLUG for Close Window.
Results
[
Real Experience. Real Advantage.
Key Take Aways Identified Pain Points for using standard SAP GUI based workflow Built a robust Web Dynpro for ABAP application Integrated with the Webflow/Workflow engine Customized the Universal Worklist XML container Blocked users from using the SAP GUI workflow inbox Managed the pop-up window that the UWL launches for the Web Dynpro for
ABAP
[
Real Experience. Real Advantage.
Further Information SAP Public Web:
SAP Developer Network (SDN): www.sdn.sap.comWorkitems, UWL and Web Dynpro for ABAP by Thomas KosogUsing Exit Plug in Web Dynpro for ABAP by Shabbir AslamHow to close parent window in Webdynpro applications? By Mohammed Anzy
ContributorsJon Cocks, SAP NetWeaver Developer, Boeing Service [email protected] Semerjian, SAP NetWeaver Developer, Boeing Service Company
Recommended BooksPractical Workflow for SAP - 2nd Edition by Ginger Gatling (SAP PRESS -ISBN 978-1-59229-285-1) Proceeds go to Doctor’s Without Borders
[
Real Experience. Real Advantage.
ASUG and SAP: Partners in Education
Be sure to check out more informaiton on ASUG Special Interest Groups (SIGs):
Recommended groups Workflow and Business Process Management Business Integration, Technology and Infrastructure (BITI)
[
Real Experience. Real Advantage.
Questions?
57
Thank You!
[
Real Experience. Real Advantage.
ASUG and SAP: Partners in Education
ASUG, Americas’ SAP Users’ Group, is the world’s largest, customer-run community of SAP professionals and partners, with more than 50,000 individual members and 1,750 companies represented. ASUG delivers the highest value to member companies, allowing them to maximize their SAP investments.
Some highlighted benefits include: Access to a year-round community for SAP customers and partners Diverse mix of educational topics and events through a variety of formats Exclusive opportunity to influence SAP future product direction Unparalleled networking opportunities with a dynamic professional network Unprecedented partnership with SAP Access to ASUG Special Interest Groups and Chapters