Creating Dynamic Attributes for SWF_USER_ATTR

Objective

After completing this lesson, you will be able to create dynamic attributes for SWF_USER_ATTR

Dynamic Attributes for SWF_USER_ATTR

Here’s a useful way to spruce up your approvals that involves no coding. It applies not just to approvals but to any type of workflow task.

Prerequisite: Your users are already using the My Inbox SAP Fiori app to access their approvals. They are not alone, because its usage is rocketing up, thanks to the spectacular simplification and beautification of the user interface coupled with the ease of implementation for your IT department.

Vanilla My Inbox

This is what a typical approval looks like.

The Open button at the bottom of the screen will open the item to be approved in a separate browser tab, but let’s face it - if a little more detail could be shown with the description then the approval could be done instantly in many cases. You can configure your workflow in such a way, that the approval appears like this:

My Inbox Embellished with Context Details

You (and the decision-maker) see at a glance the context of the approval—for example, the leave duration, start of leave, and type of leave, so they can approve right away. In addition, they still have the option to open the underlying approval item if they want to.

Configuration

This brief tutorial uses standard delivered workflow WS30000015 (Formabsence) without modification so that you can repeat the steps yourself, even if you haven’t yet created a workflow.

Run transaction SWF_USER_ATTR_DEF(cross client) or SWF_USER_ATTR_CUST (client dependent) (or report RSWD_MAINTAIN_USER_ATTR using transaction SA38 or SE38) and press Enter to skip the first screen to arrive at this:

Configuring the List of Attributes to Display with Transaction SWF_USER_ATTR_CUST

Now, add the approval context that your users would like to view. In the screenshot above, you can see how I have added entries for the attributes that I want displayed in a list.

The entries are as follows:

Task

Either the task or the workflow ID.

Step

Technical step number if you added a workflow instead of a task. This is particularly useful when one workflow uses a task in several different ways, for example, for several different roles. For example, someone performing a technical approval can see a different list from someone approving from the business perspective.

Active

Active or not. This is useful for testing. As you can see, the hours attribute is deactivated.

Scenario

You are setting this up for My Inbox, so select WF_INBOX_DC using value help (F4).

Name

A technical identifier for this attribute. I chose to add the project name, followed by a numerical number to control the order of the list of attributes displayed to the user (undocumented feature – behaves this way in this release).

Description

The name of the attribute as it should appear in My Inbox. Translation is not possible.

Expression

The value to display. Use the context-sensitive help (F4) to select the field. You can use container elements, attributes of container elements, system variables, or operations on one of these using the _WFSYST element.

You can test an entry to see how they will appear based on an existing work item. And you can generate the values for existing work items, which is not just useful for testing but also for instantly improving a productive system where work items may be several days old.

Retroactively Publishing the List to My Inbox Users

Since no coding is involved you can improve your installation immediately. Go to it, and send a screenshot of your results to your trainer to earn virtual round of applause from the My Inbox and Business Workflow developers.

A Useful Blog

Here is a useful blog that shows how specific attribute names can be used to show your own attributes in the work item header: https://community.sap.com/t5/technology-blogs-by-sap/sap-fiori-my-inbox-2-0-sp02-features/ba-p/13228953

The attribute names are:

  • CustomTaskTitle

  • CustomNumberValue

  • CustomNumberUnitValue

  • CustomObjectAttributeValue

If you want to show them in the left-hand summary use parameter showAdditionalAttributes=true  in the My Inbox target mapping (or launchpad URL when testing).