Show TOC

Creating Custom ViewsLocate this document in the navigation structure

Use

You can create custom views for specific tasks. For example, you want a specific view for the approval of invoices.

You can also create specific views for user decision. User decision is a type of step in a workflow. Normally this step gives the user a few options, and the user selects one of the options. User decision options are available only in the item preview or the item detail windows. You can customize the user decision to have the choices appear as check boxes in the columns. Additionally, a user can make multiple choices at the same time and execute all the decisions with one click. For more information see Using the Universal Worklist .

When a work item is executed, UWL needs to know how to launch the work item. The required configuration step of registering the work item types enable UWL to detect how the work item should be launched. You can customize this launch by creating an iView for a specific task.

Note

You could also write a Web Dynpro to execute a work item. Some configurations for launching work item types require programming expertise.

Process

In order to add custom views you do need to have some knowledge of the backend workflow. You will want to work with the workflow administrator on the addition of custom views.

  1. The first thing you need to know is the exact step from the workflow where the customized view is required. Workflows are divided into tasks. Each task is one step in the workflow that must be executed. The task links to SAP functionality. The tasks are stored on the database with TS########. A task is always represented with the letters TS and a number. The number is unique to the task. You must know the exact task number that will link to the custom view.

  2. Each task links to specific SAP functionality. Normally this link is done via a business object type. For example, in a workflow about invoices, the object type will be invoice. In a workflow about materials the object type will be material. For each object type we store attributes, or characteristics about the object type. Attributes of an invoice could be dollar amount, G/L account, company code. Attributes of a material could be material type, net weight, material description. These attributes are the options for customized columns in the UWL view.

  3. Once the research regarding the task and attributes is completed, create your XML file (see example below) and upload the XML file into the Portal. To do this follow the menu path Start of the navigation path System Administration Next navigation step  System configuration Next navigation step  Universal Worklist and Workflow Next navigation step  Universal Worklist Administration End of the navigation path.

  4. Under Universal Worklist Content Configuration , select Click to administer item types and view definitions .

  5. Choose Upload New Configuration . From here you can upload the XML configuration.

  6. Enter a name for your new configuration. The name should be sufficiently descriptive for someone to know what the XML file contains.

  7. Enter the system that should use the XML configuration you are uploading.

    For more information, see UWL Content Configuration .

  8. Once the upload has completed, you will receive a successful message. If you do not receive a successful message, you will have an error message providing you with the syntax error in the XML file. Fix your XML file and upload again.

    Note

    Syntax errors should be verified against the DTD before uploading.

  9. After configuration changes, SAP recommends clearing the persistent cache on the Cache Administration Page . On this page, choose Clear Cache .

Example

First you must know which step you want to be customized. You will need to get with the workflow administrator to help determine the task for which you need the customized view.

To find the task go into the workflow using transaction code SWDD . WS74500036 can be an example.

Double-click on Approve Notification of Absence , you see task TS74507936. This is the task number where we want to customize the view in UWL. To create a custom worklist for TS74507936, you will need to enter TS74507936 in the XML configuration.

If you drill into TS74507936 you will see the definition of the task. You can see this task is based on object type FORMABSENC. The attributes from the object type are where we get possible columns for the custom view.

You will need to work with the workflow developer to decide which attributes you want to use in the customized view.

You need to answer the questions:

  • What additional columns should appear

  • What additional data should be there at the bottom portion of the screen

For this example use the attributes DEPARTMENT, FIRSTDAYOFABSENCE, and LASTDAYOFABSENCE.

For the XML file there are two major components.

  1. The Item Type is where we define the specific task we want to link to, we define the business object type the task is tied to, and we define the attributes we want to use in our view.

  2. In the View we define the view name, the columns, the look and feel for the view, and the actions the user can take on the view.

Important components of the Item Type definition include:

  • Identifying the exact TS number.

  • Linking the item type to a custom view (defaultview="myApprovalView").

  • Linking the attributes to a workflow object type (ABAP_BOR) and to the exact object type (FORMABSENC).

  • Identifying each attributes. The attributes DEPARTMENT, LASTDAYOFABSENCE, FIRSTDAYOFABSENCE, COSTCENTER will show up in the bottom portion of the UWL window at runtime.

When you define the view there are several important elements:

  • The view name ( myApprovalView ) should be linked back to the default view given in the Item Type definition.

  • The column order includes your custom columns. These must be the same name as the attributes in the Item Type definition.

  • Selection mode SINGLESELECT gives you a radio button so user can move the focus to one work item at a time.

  • To make new work items appear in bold, enter emphasizedItems="new".

  • The description of the view is the view name the user will select in the inbox.

Actions define exactly what action a user can take in a view. Common actions include the ability to personalize the item and refresh. If the work item is to launch an SAP transaction code, you will see the handler is SAPTransactionLauncher.

For details on other launch handlers see Task Launch Customization .

The following is a complete example of XML for configuring TS74507936. Notice that the task number, view name, and attributes link the Item Type and the View.

            <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE UWLConfiguration PUBLIC '-//SAP//UWL1.0//EN' 'uwl_configuration.dtd' [
  ]>
<UWLConfiguration version="1.0">
 <ItemTypes>
     <ItemType name="uwl.task.webflow.TS74507936" connector="WebFlowConnector" defaultView="myApprovalView"         defaultAction="viewDetail" executionMode="pessimistic">
      <CustomAttributes>
        <CustomAttributeSource id="ABAP_BOR" objectIdHolder="externalObjectId" objectType="FORMABSENC" cacheValidity="final">
          <Attribute name="DEPARTMENT" type="string" displayName="Department"/>
          <Attribute name="LASTDAYOFABSENCE" type="date" displayName="Last day of absence"/>
          <Attribute name="FIRSTDAYOFABSENCE" type="date" displayName="First day of absence"/>
          <Attribute name="COSTCENTER" type="string" displayName="Cost Center"/>
      <ItemTypeCriteria externalType="TS74507936" connector="WebFlowConnector"/>
        </CustomAttributeSource>
      </CustomAttributes>
    </ItemType>
   </ItemTypes>
 
<Views>
    <View name="myApprovalView" width="98%" supportedItemTypes="uwl.task.webflow.TS74507936" 
   columnOrder="attachmentCount, detailIcon, subject, createdDate, Department, FIRSTDAYOFABSENCE, LASTDAYOFABSENCE" 
       sortby="createdDate" visibleRowCount="10" headerVisible="yes" 
       selectionMode="SINGLESELECT" 
      tableDesign="STANDARD" 
      tableNavigationFooterVisible="yes" emphasizedItems="new" 
      displayOnlyDefinedAttributes="no">
      <Descriptions default="Vacation Requests to Approve">
        <ShortDescriptions>
          <Description Language="en" Description="Vacation Requests to Approve"/>
        </ShortDescriptions>
      </Descriptions>
      <DisplayAttributes>
        <DisplayAttribute name="Department" type="date" width="" sortable="yes" format="medium">
          <Descriptions default="Department">
            <ShortDescriptions>
              <Description Language="en" Description="Department"/>
            </ShortDescriptions>
          </Descriptions>
        </DisplayAttribute><DisplayAttribute name="FIRSTDAYOFABSENCE" type="date" width="" sortable="yes" format="medium">
          <Descriptions default="Vacation begins on">
            <ShortDescriptions>
              <Description Language="en" Description="Vacation begins on"/>
            </ShortDescriptions>
          </Descriptions>
        </DisplayAttribute>

        <DisplayAttribute name="LASTDAYOFABSENCE" type="date" width="" sortable="yes" format="medium">
          <Descriptions default="Vacation Ends On">
            <ShortDescriptions>
              <Description Language="en" Description="Vacation Ends On"/>
            </ShortDescriptions>
          </Descriptions>
        </DisplayAttribute>
      </DisplayAttributes>
      <Actions>
        <Action reference="refresh" />
     <Action reference="removeFromNavigation" />
        <Action reference="addToNavigation" />
        <Action reference="personalize" />
      <Action name="launchSAPAction" handler="SAPTransactionLauncher">
        </Action>
      </Actions>
    </View>
  </Views>
</UWLConfiguration>