Академический Документы
Профессиональный Документы
Культура Документы
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 be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, 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, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. 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 registered trademarks 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. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
Contents 1 Introduction................................................................................................................ 5 1.1 Target Audience ................................................................................................ 5 1.2 Duet Approval Workflow Template Overview ..................................................... 5 1.2.1 1.3.1 1.3.2 1.3.3 2 How an Approval Workflow Application Works in Duet ........................... 6 Prerequisites .......................................................................................... 7 Terms ..................................................................................................... 8 SAP Notes.............................................................................................. 8 1.3 Creating Your Approval Workflow Application .................................................... 7
Configuring the SAP System for Your Workflow Application ...................................... 9 2.1 Scheduling Core Workflow Reports for Use in Duet ......................................... 13 2.1.1 2.1.2 Defining an OSP Filter.......................................................................... 13 Scheduling Reports .............................................................................. 15
2.2 Maintaining Status Mapping ............................................................................. 16 2.3 Workflow Application Handlers......................................................................... 17 2.3.1 2.3.2 2.3.3 2.3.4 Customizing Custom Handlers ............................................................. 18 Customizing the Default Custom Handler for Use in Application-specific Custom Handler .................................................... 21 Using the Default Custom Handler Together with your Application-specific Custom Handler .................................................... 22 Configuring the Body and Subject of your Emails and Tasks................ 22
2.4 Workflow Default RFC and Application Custom Handler RFC.......................... 29 2.5 Creating Client Proxy Objects for Groupware Objects...................................... 29 2.5.1 2.6.1 2.6.2 2.6.3 2.6.4 3 ABAP Client Proxies............................................................................. 29 Defining an RFC Destination for the Action Item and Email Proxy ........ 30 Assigning an RFC Destination to a Logical Port for the Action Item and Email Proxy ................................................................ 32 Configuring Communication Destinations for Role Management .......... 32 Assigning an RFC Destination to a Logical Port for Role Management ................................................................................ 33 2.6 Configuring Logical Ports and Remote Destinations ........................................ 30
Installing the Duet Approval Workflow Configuration Tool........................................ 34 3.1 Overview of the Duet Approval Workflow Configuration Tool ........................... 34 3.2 Gathering Information for Your Approval Workflow Application ........................ 36 3.3 Post-Installation Procedures ............................................................................ 36 3.4 Creating a New Duet Approval Workflow Configuration Template.................... 37
Customizing the Duet Approval Workflow Template ................................................ 37 4.1 Modifying the Default Model............................................................................. 38 4.2 Editing the Model Data Source Entity............................................................... 40 4.3 Editing the Workflow Item: Mail and Task Entity............................................... 43 4.4 Editing the Action Pane Entity .......................................................................... 44 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 Editing the Object Identification Region ................................................ 45 Editing the You Can Also Region ......................................................... 46 Editing the Links List Region ................................................................ 48 Editing the History Region .................................................................... 49 Editing the Details Region .................................................................... 49
Generating the Files for Your Approval Workflow Application .................................. 49 5.1 Generating the Application Files ...................................................................... 50 5.1.1 5.1.2 5.1.3 Configuring the Application Package and Deployment ......................... 51 Translating your Workflow Application .................................................. 52 Deploying Your Application .................................................................. 53
6 7
Removing a Workflow Application ........................................................................... 54 Uninstalling the Duet Approval Workflow Configuration Template ........................... 54
1 Introduction
This document describes how to create an Approval Workflow application using the Duet Approval Workflow template. In addition, it describes the Duet Approval Workflow Configuration tool with which you modify the Duet Approval Workflow template. Using the Duet Approval Workflow template, developers, modelers, and system integrators can create and package Duet Approval Workflow applications for use in Microsoft Office Outlook.
Customizing the connectivity code between an SAP system and the Duet application. Modeling the Approval Workflow application using the Duet Approval Workflow Configuration tool. Supporting deployment processes of SAP packages and configuration of systems and Duet environment.
A business process enabled as an approval workflow application in Duet is initiated by a request. One or more approvers can approve or reject the request, reassign it to someone else, designate someone else in place of an approver for a period, or reserve a request for a later response. In addition, approvers have access to relevant information in Microsoft Office Outlook to help them make an informed decision. The Duet Approval Workflow template supports all types of approver relationships, as defined in the SAP system. The following are the common types of approver relationships: Types Single approver Parallel approvers Description There is only one approver for a request. This is a simple and common workflow. There is an 'AND' relationship between several approvers. Requires all approvers of a particular step to approve a request for the flow to be complete. A rejection by any of the approvers stops and completes this step in the process. For example, both John and Jane must approve a leave request. Multiple approvers There is an 'OR' relationship between several approvers. Requires only one of the approvers to approve or reject the request to complete the task. For example, John, Jane or Bob can approve a leave request. Combined A combination of the types of approver relationships is possible in the template. One of the steps can consist of a single approver while other steps consist of multiple or parallel approvers.
Travel Request: An Example of an Approval Workflow Application Lances receives a request in his Inbox and opens the trip request from John. He decides to approve the request and adds some comments. The approval process is triggered in the SAP Business Workflow application running in an SAP system, and John receives a mail notifying him of the approval.
1.3.1 Prerequisites
After planning the approval workflow application, make provisions for its requirements. However, the requirements of the Duet Approval Workflow template also determine your applications requirements. For your Duet approval workflow application, make sure that you have satisfied the following minimum requirements: Microsoft Windows 2003 Server SP2 Microsoft Office Outlook 2003, or a later version ANT 1.7 Microsoft Visual Studio 2005 (C# development mode) Duet 1.5 SP1 An SAP system using the SAP Business Workflow engine.
1.3.2 Terms
To use the Duet Approval Workflow template, you must familiarize yourself with the following terms: Term Entity Definition A building block in the model that represents one or more activities. Specifies the business logic that describes the use of the entities. Specifies a specific process with defined steps to accomplish a business goal. Provides the logic for making approval decisions in the Duet environment, and then in the SAP system. Captures the runtime instance of a workflow triggered by an application in the SAP system. Later, it broadcasts this instance to Duet, enabling the user to make a decision within the Duet environment.
5. From Workflow Pattern Customization choose Execute on Workflow Pattern Customization. The following parameters are displayed: Parameter Explanation Roles Roles must be predefined in your approval workflow application. You use the same roles as the roles in the workflow application in the SAP system. Double-click Roles under the Dialog Structure. The Change View screen opens, and you can see the roles for workflow applications.
Application Your workflow application must have the same identifier as the workflow Identifier application in the SAP system. This identifier is unique for the specific workflow application. For example, the workflow application Expense Approval Management: Trip Expense has the identifier EXAMTE. The default application ID in the Duet Approval Workflow template is WOMA. Double-click Applications under the Dialog Structure, to see the identifiers for all workflow applications in the SAP system.
10
Workflow
In the Workflow pane, view or enter the following: Application ID: View the application ID. Workflow ID: View and enter the Workflow ID from the template. Custom Handler Flag: Choose Outbound or Inbound. Counter: Specifies the sequence in which the custom handlers will be called at runtime. Version: Workflow template version. Custom Handler API: The Duet Approval Workflow template comes with the default custom handlers: Inbound custom handler: S_OSP_WF_PAT_DEFAULT_CH_IB Outbound custom handler: S_OSP_WF_PAT_DEFAULT_CH_OB For your workflow application, you must enter application-specific handlers to be invoked in the SAP system.
Tasks
You view and enter the following details of each Task in your Workflow application in the Tasks screen: Sub-Workflow ID: View or enter the name for a nested workflow which is part of a Workflow. Where there is no nested workflow in a Workflow, then enter the Workflow ID. Workflow Task ID: View or enter the task ID from the workflow template. Workflow Step ID: View or enter the step ID from the workflow template. This is called a step or node ID which uniquely identifies the step in a Workflow. Note: You can get the step ID from the Workflow Builder in the SAP system. On the left hand side of the Workflow Builder, there is a section called Navigation Area which displays all the steps of a workflow, including the step IDs.
11
Groupware Object Type: Specifies the groupware object type to be created for the specific task. The following groupware objects are supported in the Duet Approval Workflow template: Task Mail Recipient Role Type The groupware object can be sent to people with different roles. This field is a placeholder for storing bound-item details for various roles. Sub-Workflow Type: Specifies the type of Sub-workflow associated with a workflow. Task Agent Role ID: Specifies the name of the role for the agent assigned to the Workflow dialog task. Every Workflow dialog task has an Agent assigned to it. The role of the agent can be that of an Initiator, Approver, Reviewer, or Administrator. Groupware Bounditem Type: Specifies the client bound item type associated with the Workflow task for a given recipient role. The default bound item types in the Duet Approval Workflow template are: urn:sap:office:mySAP:Workflow.ApproverTask urn:sap:office:mySAP:Workflow.ApproverMail
12
Action
The Duet Approval Workflow template comes with a set of default actions based on the default application ID, WOMA. The default actions are set as active. Depending on your requirements, you can copy these actions to your Workflow application and set them as active. Doing so allows you to define the client behavior as you require. To copy the default actions: 1. Choose Copy Actions from Workflow Management. 2. Select the application and double-click Actions in the Dialog Structure pane.
3. Make sure the Active checkbox is selected for all the actions.
13
5. Double-click Filter Basic Data, and select the OSP_DELTA filter type.
6. Double-click Filter settings and under the TASK parameter enter the Workflow Task ID to use in the Duet Workflow application. To add more than one entry, specify a new index value.
7. Repeat steps 1-6 to define the same settings for OSP_FULL filter type.
14
15
The following are the R/3 reports to be scheduled: Schedule the NetWeaver Report (or run the report when required) Report Name: RSWNSEL Variant 1: Scenario : OSP Filter : OSP_DELTA Variant 2: Scenario : OSP Filter : OSP_FULL Note: The recommended frequencies for the two variants are: Variant 1 : Every 15 minutes Variant 2 : Once a day Schedule the Duet Workflow Report (or run the report when required) Report Name: S_OSP_WF_ITEM_SELECTION Note: This report should run after the successful execution of the NetWeaver report RSWNSEL. Recommended frequency Every 15 minutes Schedule the Duet Workflow BKT Cleanup Report (or run the report when required) Report Name: S_OSP_WF_PAT_DB_CLEANUP_REPORT Input Parameters: Minimum age (in days): 90 (example figure) Note: The frequency for running this report depends on the volume of requests to be handled.
16
1. From Maintain Status Mapping in the Duet Implementation Guide, choose Map Object under Dialog Structure. The screen lists all the scenarios and their corresponding Map IDs and Map Codes as follows: Column Scenario Description Displays the scenario for which the corresponding information is shown. Displays the Map ID for the scenario. Displays the Map code for the scenario. Displays the description text for the map code.
2. Click New Entries to add another scenario to the list, and enter the details. 3. Select an application from the list and choose Map Info. The screen displays all the mappings that have been defined for the selected application. 4. To define another mapping, click New Entries and enter the applicable scenario name, map ID, and map code. 5. Click Save.
17
18
9. In the Function Group field, specify the function group you want to use. Note: You cannot use the default function groups. 10. In the Short Text field, enter the descriptive text for the function module, and then choose Save. Note: The function module must be of type RFC.
11. Choose the Import tab. 12. Enter the desired parameter name and its associated data type. Note: You can edit the Parameter Name; however, the Associated Data Type displayed must remain unchanged. The following table shows a list of the default interface for the inbound handler. Parameter Name IV_WORKITEM_ID IV_DECISION_KEY IV_USER_ID IV_OPERATION_ID IV_WORKITEM_STATUS IV_WRT_CONT_FLAG IV_LANGUAGE IT_WF_CONTAINER_TAB IT_APPL_CONTAINER_TAB EV_ERROR_FLAG ET_RETURN Parameter Type IMPORT IMPORT IMPORT IMPORT IMPORT IMPORT IMPORT IMPORT IMPORT EXPORT EXPORT Associated Data Type SWN_APPKEY SWR_DECIKEY SYUNAME S_OSP_DT_WI_OPERATION_ID SWW_WISTAT S_OSP_DT_FLAG SPRAS SOSP_TT_WF_CONTAINER SOSP_TT_APPL_CONTAINER S_OSP_DT_FLAG BAPIRETTAB
The following table shows a list of the default interface for the outbound handler: Parameter Name IT_WORKITEM_DETAIL EV_ERROR_FLAG ET_WORKITEM_DETAIL ET_RETURN Parameter Type IMPORT EXPORT EXPORT EXPORT Associated Data Type SOSP_TT_WF_RUNTIME_INFO S_OSP_DT_FLAG SOSP_TT_WF_RUNTIME_INFO BAPIRETTAB
19
13. Choose the Export tab. 14. Enter the desired parameter name and its associated data type. Note: You can edit the Parameter Name; however, the Associated Data Type displayed must remain unchanged. 15. Choose the Source Code tab to enter your code for the application. The following are the default Workflow APIs grouped according to the function of the service. Default Function Groups S_OSP_WF_BKT_PERFM_CRUD Description Maintains all the new and updated work items. Use this API to update the status, recipient ID, and more. Contains the default Workflow services. These APIs are used at runtime to execute both Inbound and Outbound processes. You can use these default services in your applications. This group also contains the default Inbound and Outbound Custom Handlers in Workflow. S_OSP_WF_PAT_DEFAULT_CH_IB The default inbound custom handler that comes with the Workflow Framework. Use this default API in your application for the inbound decision making process. You can use it independently or in conjunction with other application-specific custom handler APIs in the inbound cycle. S_OSP_WF_PAT_DEFAULT_CH_OB The Default Outbound Custom Handler delivered by Workflow framework. You can use the default API for the outbound process of creating and updating Outlook bound items. Use it independently or in conjunction with other application-specific custom handler APIs in the outbound cycle. S_OSP_WF_DEFAULTCH_EMAIL _ITEM Used in CRUD (Create, Update, Delete, and Unbind) operations on an EMAIL groupware object. It is used for creating both Bound and Unbound Emails. The Subject and Body of the Email can be specified as inputs.
S_OSP_WF_PATTERN_DEFLT_CH
20
S_OSP_WF_DEFAULTCH_ACTION _ITEM
Used in CRUD operations on a Task Groupware object. You can use it to create both Bound and Unbound Tasks. You can specify the Subject and Body for a task as inputs.
S_OSP_WF_PAT_DEFLT_BLD _ERRNOTF
S_OSP_WF_GET_WI_RUNTIME_INFO
Used for composing the content and body for an email with links, attachments, and more. Used to provide runtime information for a work item. For example, work item container element, work item status, work item step ID, and work item task ID, etc.
You can use the APIs as follows: Customize the default outbound/inbound custom handler for use in your application-specific custom handler. Use the default outbound/inbound custom handler together with your applicationspecific custom handler.
2.3.2 Customizing the Default Custom Handler for Use in Application-specific Custom Handler
You must specify the groupware information for CLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table before passing the information to the default custom handler. This enables the creation of the email subject and body. The default custom handler creates the email subject and body using the details present in SUBJ_BODY_TAB, EMAIL_DETAILS, and TASK_DETAILS under CLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table. For the groupware bound and unbound Email/Tasks, provide the details for EMAIL_DETAILS and TASK_DETAILS under CLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table. You can add extra information to the client using name value pairs. Add the name value pairs to the XPROP_LIST table under CLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table. Later, pass the IT_WORKITEM_DETAIL table to the default custom handler which takes care of sending the information to the client through the following APIs: S_OSP_WF_DEFAULTCH_ACTION_ITEM S_OSP_WF_DEFAULTCH_EMAIL_ITEM If your application does not include additional information in the XPROP_LIST table, the default XPROP is used. To update transitions status, your application must use the following function, S_OSP_WF_BKT_PERFM_CRUD.
21
2.3.3 Using the Default Custom Handler Together with your Application-specific Custom Handler
To use your application-specific outbound handler with the default outbound handler, first call the application-specific handler before calling the default handler. Then, repeat the steps described in the Customizing the Default Custom Handler for Use in Application-specific Custom Handler section.
2.3.4 Configuring the Body and Subject of your Emails and Tasks
Emails and tasks generated automatically by the workflow have a standard default text. Note: Text for the body of task items must be written in RTF (Rich Text Format) only.
22
FUNCTION z_test_invoice_ch_text. *"---------------------------------------------------------------------*"*"Local Interface: *" IMPORTING *" VALUE(IS_INVOICE_TABLE) TYPE ZINVOICE_TABLE OPTIONAL *" VALUE(IT_INVOICE_DETAIL) TYPE ZTTINVOICE_DETAIL OPTIONAL *" EXPORTING *" VALUE(EV_INVOICE_BODY) TYPE STRING *"---------------------------------------------------------------------DATA: ls_header lv_changed lv_invoice_text lv_invoice_text1 lv_invoice_text2 lv_invoice_text3 ls_new_header ls_invoice_detail ls_read_line lt_read_line value TYPE string. TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE thead, string, string, string, string, string, thead, zinvoice_details, tline, tline OCCURS 0, "#EC NEEDED "#EC NEEDED
"#EC NEEDED
CALL FUNCTION 'READ_TEXT' EXPORTING id = 'ST' language = 'E' name = object = 'TEXT' IMPORTING header = ls_header TABLES lines = lt_read_line. *----Dynamic variable for the invoice----* PERFORM: text_setvalue USING '&vendorname&' vendor_name , text_setvalue USING '&invoicedate&' invoice_date , text_setvalue USING '&invoicenumber&' invoice_number."... is_invoice_tableis_invoice_tableis_invoice_table-
CALL FUNCTION 'TEXT_SYMBOL_REPLACE' EXPORTING endline = 99999 header = ls_header init = ' ' option_dialog = ' ' program = ' ' replace_program = 'X' replace_standard = ' ' replace_system = ' ' replace_text = 'X' startline = 1 IMPORTING changed = lv_changed
23
= ls_new_header = lt_read_line.
LOOP AT lt_read_line INTO ls_read_line. CONCATENATE lv_invoice_text1 ls_read_linetdline INTO lv_invoice_text1. ENDLOOP.
************************ ********************************************** *************************************** LOOP AT it_invoice_detail INTO ls_invoice_detail. CALL FUNCTION 'READ_TEXT' EXPORTING id = 'ST' language = 'E' name = object = 'TEXT' IMPORTING header = ls_header TABLES lines = lt_read_line.
ls_invoice_detaills_invoice_detaills_invoice_detaills_invoice_detail-
CALL FUNCTION 'TEXT_SYMBOL_REPLACE' EXPORTING endline = 99999 header = ls_header init = ' ' option_dialog = ' ' program = ' ' replace_program = 'X' replace_standard = ' ' replace_system = ' ' replace_text = 'X' startline = 1 IMPORTING changed = lv_changed newheader = ls_new_header TABLES lines = lt_read_line. LOOP AT lt_read_line INTO ls_read_line.
24
CONCATENATE lv_invoice_text2 ls_read_linetdline INTO lv_invoice_text2. ENDLOOP. ENDLOOP. REPLACE ALL OCCURRENCES OF '<(><<)>' IN lv_invoice_text2 WITH '<'. ************************************************************************ *****************************************************
ENDFUNCTION. *----------------------------------------------------------------------* ***INCLUDE LZTEST_WF_CH_OBF01 . *----------------------------------------------------------------------* *&---------------------------------------------------------------------* *& Form TEXT_SETVALUE *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_0072 text * -->P_VALUE text *----------------------------------------------------------------------* FORM TEXT_SETVALUE USING P_name P_VALUE.
CALL FUNCTION 'TEXT_SYMBOL_SETVALUE' EXPORTING name = p_name value = P_VALUE value_length = 0 replace_symbols = ' '.
ENDFORM.
" TEXT_SETVALUE
d) In the first CALL FUNCTION 'READ_TEXT' section, enter the value of import parameter Name with the name of the standard text program you created for the subject line, for example Z_subjectline_text. e) In the second CALL FUNCTION 'READ_TEXT' section, enter the value of import parameter Name with the name of the standard text program you created for the body. f) In the PERFORM: text_setvalue section, set the value for the dynamic variables you entered in the program text. 4. Save the function.
25
5. Activate the function. 6. Create an RFC function. a) Enter transaction SE37. b) Build a new Custom Item Handler function. c) Copy the code below and then paste it in the Source Code tab.
FUNCTION Z_TEST_INVOICE_CH_OB_API. *"---------------------------------------------------------------------*"*"Local Interface: *" IMPORTING *" VALUE(IT_WORKITEM_DETAIL) TYPE SOSP_TT_WF_RUNTIME_INFO OPTIONAL *" EXPORTING *" VALUE(EV_ERROR_FLAG) TYPE S_OSP_DT_FLAG *" VALUE(ET_WORKITEM_DETAIL) TYPE SOSP_TT_WF_RUNTIME_INFO *" VALUE(ET_RETURN) TYPE BAPIRETTAB *"---------------------------------------------------------------------DATA: *---------------Local Variables lv_invoice_body lv_subject_body *---------------Local tables lt_invoice_table lt_invoice_detail , lt_invoice_xprops lt_client_gpw_info lt_subj_body_tab *--------------Local Structures ls_invoice_xprops ls_workitem_detail ls_client_gpw_info ls_invoice_table ls_invoice_detail ls_subj_body_tab CONSTANTS: gc_subject_info ve invoice of vendor'. *----Just for Check---* SELECT * FROM zinvoice_details INTO TABLE lt_invoice_detail WHERE invo ice_number = '556700023'. LOOP AT it_workitem_detail INTO ls_workitem_detail. LOOP AT lt_invoice_table INTO ls_invoice_table.
TYPE zinvoice_table OCCURS 100, TYPE zinvoice_details OCCURS 100 TYPE sosp_tt_xprop, TYPE sosp_tt_client_gpw_info, TYPE sosp_tt_subj_body_tab,
CALL FUNCTION 'Z_TEST_INVOICE_CH_TEXT' here u put the fm name of the text body/subject EXPORTING is_invoice_table = ls_invoice_table it_invoice_detail = lt_invoice_detail IMPORTING ev_invoice_body = lv_invoice_body.
26
*-----Filling of xprops CLEAR ls_invoice_xprops. CLEAR lt_invoice_xprops[]. ls_invoice_xprops-name = 'DocumentType'. ls_invoice_xprops-value = ls_invoice_table-document_type. APPEND ls_invoice_xprops TO lt_invoice_xprops. ls_invoice_xprops-name = 'VendorName'. ls_invoice_xprops-value = ls_invoice_table-vendor_name. APPEND ls_invoice_xprops TO lt_invoice_xprops. ls_invoice_xprops-name = 'InvoiceNumber'. ls_invoice_xprops-value = ls_invoice_table-invoice_number. APPEND ls_invoice_xprops TO lt_invoice_xprops. ls_invoice_xprops-name = 'InvoiceDate'. ls_invoice_xprops-value = ls_invoice_table-invoice_date. APPEND ls_invoice_xprops TO lt_invoice_xprops. * * ** ls_invoice_xprops-name = 'GrossAmount'. ls_invoice_xprops-value = ls_invoice_table-gross_amount. APPEND ls_invoice_xprops TO lt_invoice_xprops.
*---Prepare the exporting table CLEAR lv_subject_body. CONCATENATE gc_subject_info ls_invoice_tablevendor_name INTO lv_subject_body SEPARATED BY ' '. lt_client_gpw_info = ls_workitem_detail-client_gpw_info. LOOP AT lt_client_gpw_info INTO ls_client_gpw_info WHERE recp_role_id = 'APPROVER' AND gpw_object_sub_type = 'BND'. *-----------------------------------------------------------------------------------------* ******************************************EMAIL************************* ******************** *------------------------------------------------------------------------------------------*
IF ls_client_gpw_info-gpw_object_type = 'EMAIL'. *Fill the application-specific xprops ls_client_gpw_info-email_detailsxprop_list = lt_invoice_xprops. *Fill the email type ls_subj_body_tab-email_type ='BND'. *Fill the subject text information ls_subj_body_tab-subject = lv_subject_body.
27
*Fill the body text information ls_subj_body_tab-body-text_body = lv_invoice_body. *Fill the subject text information APPEND ls_subj_body_tab TO lt_subj_body_tab. ls_client_gpw_info-email_detailssubj_body_tab = lt_subj_body_tab.
ELSEIF ls_client_gpw_info-gpw_object_type = 'TASK'. *Fill the application-specific xprops ls_client_gpw_info-task_detailsxprop_list = lt_invoice_xprops. *Fill the subject text information ls_subj_body_tab-subject = lv_subject_body. *Fill the body text information ls_client_gpw_info-task_details-body-value = lv_invoice_body. *Fill the subject text information ls_client_gpw_info-task_details-subjectvalue = ls_subj_body_tab-subject. ENDIF. MODIFY lt_client_gpw_info FROM ls_client_gpw_info. ENDLOOP. ***Set Client info to Workflow Pattern structure ls_workitem_detail-client_gpw_info = lt_client_gpw_info. APPEND ls_workitem_detail TO et_workitem_detail.
ENDLOOP. ENDLOOP.
ENDFUNCTION.
d) In the Just for Check section, under SELECT * FROM, build a table containing all the details of the dynamic variables you want to display. e) In the Just for Check section, under CALL FUNCTION, enter the name of the function you created in step 3. 7. Save the function. 8. Activate the function.
28
29
2.6.1 Defining an RFC Destination for the Action Item and Email Proxy
You must define and configure an RFC destination to enable connectivity between the specific SAP system and the Duet environment. To define and configure an RFC destination in an SAP system: 1. Log on to the SAP system you have configured for use with Duet. 2. From the system command line, enter the transaction SM59. 3. Click Create, and enter the following: Field RFC Destination Value to enter CONNECT TO J2EE. Note that the destination name is case sensitive. G (HTTP Connection to Ext. Server) 1 RFC destination from ERP to Duet.
4. Select the Technical Settings tab, and enter the following: Field Target Host Values Enter the IP address of the Item Handler Web host service. Note that this is the host for Duet. For example: 127.0.0.1 Service No. Path Prefix Enter the port number of the Item Handler Web service host. For example: 50000. Enter the following for: Action Item: /ActionItem/ActionItemConfig?wsdl&mode= sap_wsdl&style=document Email: /Email/EmailConfig?wsdl&mode=sap_wsdl&style= document Calendar Item: /CalendarEvent/CalendarEventConfig?wsdl&style =document
30
5. Select the Logon/Security tab and select No Logon. 6. Select the Send SAP Logon Ticket checkbox. Note: The username and password must be those of a user in the Active Directory Service (ADS).
31
2.6.2 Assigning an RFC Destination to a Logical Port for the Action Item and Email Proxy
You must assign an RFC destination to the logical port. This process exposes proxy classes in the specific ERP environment. To assign an RFC destination to the logical port: 1. Log on to the SAP system you have configured for Duet. The SAP Easy Access window opens. 2. Enter the transaction LPCONFIG in the command line of the SAP Easy Access window. 3. Enter the Proxy class: Action Item : CO_OSPWACTION_ITEM_VI_DOCUMENT Email : CO_OSPWEMAIL_VI_DOCUMENT Calendar: CO_OSPWCALENDAR_EVENT_VI_DOCUM 4. Enter a logical port name. This can be any alphanumeric string, without spaces. For example, Duet_LP. 5. Select the Default Port checkbox. 6. Click Create and enter the description. For example, OSP logical port 7. Select the Call Parameters tab. 8. In the HTTP Destination field, enter the name of the RFC destination you created. You defined this RFC destination. For example, CONNECT TO J2EE. 9. Save the logical port. 10. Activate the logical port.
32
4. Select the Technical settings tab, and enter the following: Field Target Host Values Enter the IP address of the Item Handler Web host service. Note that this is the host for Duet. For example: 127.0.0.1 Service No. Path Prefix Enter the port number of the Item Handler Web service host. For example: 50000. Enter the path: /RMWrapper/Config1?style=document
5. Choose the Logon/Security tab and select No Logon. 6. Select the SAP Logon Ticket checkbox. 7. Save the RFC destination service.
6. Click Create, and enter the description. For example, OSP logical port 7. Select the Call Parameters tab. 8. In the HTTP Destination field, enter the name of the RFC destination you created. For example, CONNECT TO ROLE. 9. Save the logical port and activate it.
33
34
From Microsoft Visual Studio, you use tool to do the following without writing code: Modify and configure the attributes and properties of the Duet Approval Workflow template. Generate and package all the files for the modeled application. In addition, it enables business experts, analysts, and programmers to define tasks and task flows, and to add controls to create a model for a Workflow application. A Workflow application created in this manner can be used for tasks such as, approvals, rejections, substitutions, reservations, and assignment designation. To use the Duet Approval Workflow Configuration tool: 1. Open Microsoft Visual Studio, and click Create Project. 2. From the New Project dialog box, click Duet under Visual C# in the Project Types pane, and select Duet Workflow Project from the Templates pane.
3. Enter a name for the project and specify the location for the projects folder. The model in the default Workflow Template is displayed. From Microsoft Visual Studio, you modify the default Duet Approval Workflow template using the following: Menu bar Contains the menu entries to use for all modeling tasks. Some menu entries are not available. Toolbars Solution Explorer Presents relevant toolbars for modeling. Displays all the files for the model and the project.
35
Toolbox
Contains the entities for building a model. It contains the following: Links List region, Details Region (OIDBuilding block), and History Region.
Modeling Area
This is the working area where you build your model, and edit the properties of the entities of that constitute it. In addition, you can view the text files and the various XML files created for the model. The model area displays the main objects for the Duet Approval Workflow application: model data source, link to approval objects, and approval objects with their action panes.
Contains the configuration data for the selected entity in the model. It is available only when you select or drag an entity into the appropriate receptacle entity. Opens as a window in which you edit and configure the content for the selected and active entity. Press <Ctrl> and the plus (+) key of the keyboard to enlarge and display more details of a portion of the model. To display less details, press <Ctrl> and minus (-) of the keyboard.
36
37
In order to customize the Duet Approval Workflow template, you must be defined as a Duet user. To define a Duet user: 1. Log on to the specific SAP system. 2. In the system command line enter the transaction SU01 and then press Enter. 3. In the User field, enter the user name. 4. Click Display (or press F7). The Display User page is displayed.
5. Select the Logon data tab. 6. From the User Type drop-down list, select Dialog. 7. Save your changes.
38
Represents the SAP system you want to configure for your workflow application. It contains a list of parameters based on the default workflow application identified as WOMA, in the SAP system. This entity is connected directly to the Workflow Item: Mail and Task, denoting a relationship between the two entities. Note: You cannot delete the Model Data Source entity, but you can edit its contents.
Represents the default mailing features and the activities to automate for the workflow application. Note: You cannot delete the Workflow Item: Mail and Task entity. In addition, it cannot include other entities except the Action and the Duet Action Pane regions. Action Entity: The Actions entity contains the toolbar definition. You can edit the toolbar definition by adding or removing toolbar items. Duet Action Pane Entity: The Duet Action Pane entity represents the Duet Action Pane that will be invoked for the workflow application in Microsoft Office Outlook. Note that the Duet Action Pane is the only entity to which you can add regions.
Note: Alternatively, you can open the model by selecting the file, WorkflowDsl.dml in the Solution Explorer pane.
39
The Toolbox pane in Microsoft Visual Studio contains the regions available for use in the Duet Approval Workflow template. The following are the available regions in the toolbox: Link List Details History To add a region to the Duet Action Pane entity: 1. From Toolbox > Regions, select the desired region. 2. Drag it while selected and drop it into the Duet Action Pane entity. The Properties pane displays the properties of the selected region in the model.
40
To change the name of a parameter: 1. From the modeling area, double-click the Model Data Source entity. The Edit SAP System Content dialog box is displayed. 2. From the Parameters List, select the desired parameter. 3. In the Parameter Details pane, select the current name and replace it with the new one. To add a parameter: 1. From the modeling area, double-click the Model Data Source entity. The Edit SAP System Content dialog box is displayed. 2. Click Add New. A new row appears. 3. In the Default Label field, enter the name of the parameter you want to add. The parameter name cannot be more than fifty characters. Note: Changing the default label after the label had been used in the different entities, opens a window with all the locations where the change needs to be applied. 4. In the Parameter Name in SAP System field, enter the name of the parameter as it appears in the SAP system. The parameter name must not contain any spaces. 5. In the Default Value field, enter a value for the parameter. The value you specify is the default value for the parameter. 6. Click Map Values to Labels. In the window displayed, enter the value for the source and the target. Click Add and OK to map a value to a label.
41
7. Use this option to define a mapping relationship between numeric codes in the SAP system and text values presented in the application. 8. From the Parameter type drop-down list box, select the desired parameter type. 9. In the Parameter Description field, enter the descriptive text for the parameter. This information will help others using the template to quickly identify the parameter in the SAP system. 10. From the Synchronization drop-down list box, select the desired behavior for synchronization. This defines the source of the data to use when updating the value. The synchronization options are: Override Outlook Values from SAP System Uses data from the XML from the SAP system. This data is not related to the value of the parameter in Microsoft Office Outlook. Uses the data from Microsoft Office Outlook and not from the XML from the SAP System. Use this option where the value depends on the users actions. SAP System representation UI representation Use only the data from the XML from the SAP system. Use only the data from Microsoft Office Outlook.
42
To change the label for an action: 1. From the Workflow Item: Mail and Task entity, double-click the Action entity. The Edit Action dialog box is displayed. 2. From the Actions List, select the desired action name. 3. In the Action Details pane, select the current name and replace it with the new one. Note: The name you specify is the one that will appear in the toolbar for the Workflow application in Microsoft Office Outlook. 4. Click OK.
43
To enable an action as an activity in the Workflow application: 1. From the Workflow Item: Mail and Task entity, double-click the Action entity. The Edit Action dialog box is displayed. 2. From the Actions List, select the desired action name. 3. From the Action Details pane, select the Enable Action checkbox. When you enable an action, the activity and functionality associated with that action are available in the application at runtime. This activity should also exist in the SAP system. When an action is not enabled, it is not available in the application, and it does not appear in the toolbar or in the menus for the application at runtime. To include an image for a toolbar entry at runtime: 1. From the Workflow Item: Mail and Task entity, double-click the Action entity. The Edit Action dialog box is displayed. 2. Select the desired action from the Actions List. 3. In the Icon field, specify the filename for the image.
44
Some of these regions represent activities in the Workflow application such as, Approve, Reject, Help, Show Action Pane, Reassign, Reservation, and Substitution. Note: You cannot delete the Action Pane entity, however, you can add regions to it, and edit their properties.
To change the label: 1. From the Duet Action Pane entity, double-click the OID region. The Edit Object Identifier (OID) dialog box is displayed. 2. From the Parameters List, select the desired name. 3. In the Parameter Details pane, select the current name and replace it with the new one.
45
To add parameters from the Model Data Source entity: 1. From the Duet Action Pane entity, double-click the OID region. The Edit Object Identifier (OID) dialog box is displayed 2. From Model Data Source, click Add. The Select Parameter from Model Data Source window is displayed. 3. Select the parameters you want to add. 4. Click OK. To delete an existing parameter: 1. From the Duet Action Pane entity, double-click the OID region. The Edit Object Identifier (OID) dialog box is displayed. 2. Select the parameter from the list and click Delete. To change the order of the parameters in the list: 1. From the Duet Action Pane entity, double-click the OID region. The Edit Object Identifier (OID) dialog box is displayed. 2. Select the parameter you want to move, and click the Up or Down arrows.
46
To change the name of a parameter: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. From the Links List, select the desired name. 3. In the Label field, select the current name and replace it with the new one. To change the URL address: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. From the Links List, select the desired label and its corresponding URL address. 3. In the Label field, change the URL address. To add one or more URL addresses and labels: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. Click Add New. A row appears in the Links List pane. 3. Edit the desired URL address and labels as follows: Label: Enter the text for the link. Tooltip: Enter the tool tip information. URL: Enter the URL address including the http:\\ prefix. 4. If you want to modify the URL address, click Set URL Parameters. a) Enter the new URL address. b) Define the variables you wish to add to the URL. The Define URL Parameters dialog box opens with the specified URL address. c) Click Add New to specify the value. 5. To add a single value, select Static. To specify a parameter from the SAP system, select Dynamic. A static parameter is single value and does not change. The value for a dynamic parameter changes according to the value of the parameter from the SAP system. The value you specify is displayed as part of the URL address. 6. If you select Static, enter a name for the value you want to add and specify the value. If you selected Dynamic, from the SAP System Parameter drop-down list box, enter a name for the value and select the parameter from the SAP system. 7. Click Preview to test the address and the changes you have made. 8. Click OK to save the changes.
47
48
6. If you select Static, enter a name for the value you want to add and specify the value. If you selected Dynamic, from the SAP System Parameter drop-down list box, enter a name for the value and select the parameter from the SAP system. 7. Click Preview to test the address and the changes you have made. 8. Click OK to save the changes.
49
2. Click Done or click Details to see detailed information of the processes. You can find the generated files and the log files of the process in the project folder you specified. In the Generated Target subfolder you will find a single file with the extension *.sca, this is the Duet approval workflow application you created and it is ready to be deployed.
50
51
You can change the following properties for each package: Property SDM host Description Specifies the name or the IP address of the Software Deployment Manager (SDM) host. You use the SDM to deploy the *.sca application file. For example, http://localhost. SDM Port Compatibility Version Specifies the SDM tool port number. The default is 50018. Specifies the version of the Duet approval workflow application. The recommended format to use is: 1000.<Duet version>.<J2EE version>.<Duet service pack>.<Patch version> For example: 1000.150.700.1.0 Display Name Prefix Conforms the first part of the application display name. The suffix will be created based on the application ID. For example, xapps/osp/<wfimpl>/client/enterpriseapp/WFAPP Jar Name Displays the name of the resources jar. For example, sap.com~xapps~osp~<wfimpl>~client~resources ~java~assembly" Displays the name of the software provider. For example: sap.com.
Provider Name
3. Click on the value you want to change for a property and make your changes.
52
2. Deliver the files to the translators. Important: You must instruct translators to save the translated files using the following format: <fileName>_<locale>.properties. For example, YouCanAlsoRegion_de.properties, YouCanAlsoRegion_fr.properties Note: Translation entries overwrite existing entries. 3. Add the properties files with the translated content to the SCA file generated for the client of your Workflow application. 4. Deploy the specific SCA file in the Duet environment.
This is the Workflow Service Bundle component. It is responsible for getting approval workflow applications Web service calls and sending them to the workflow component in the SAP system. This is the workflow client side runtime component responsible for processing workflow requests from the client.
OSPWORKFLOWCOMMON01_0.sca
To deploy your approval workflow application: In the Solution Explorer pane, right-click on your project for the approval workflow application and select Deploy Duet Application. Alternatively, from the toolbar select Debug and click Deploy Duet Application.
53
54