Performing Further Settings

Objective

After completing this lesson, you will be able to perform further settings

Customization of Custom Actions and Task Type Display Name for BWF

Customization of tasks in My Inbox

Business workflow tasks can be customized in the following ways.

My Inbox workitem with customized buttons
Customizing task decision options

The decision options for a business workflow task can be customized as follows:

  • Add or hide a decision option.

  • Change the label of a decision option.

  • Define the nature of a decision option (positive or negative).

  • Make comments mandatory for a decision option.

Follow the steps below in the back-end system where you maintain your workflow template for customizing the Task Decisions options. Create a decision with decision options:

Decision options
  1. In Customizing for ABAP Platform, choose Gateway Service Enablement ContentWorkflow SettingsMaintain Task Names and Decision Options .

    The image shows the screenshot of Adding Step Name
  2. Fill in the Step Name table as described below and save your entries:

    • Workflow ID: Enter the ID of your workflow template.

    • Step ID: Enter the task step from your workflow template.

      The Workflow ID and Step ID can be copied from the Workflow Builder (SWDD).

    • Icon MIME Repository Path: Leave this field blank.

      The image shows the screenshot of Settings in the Activity
  3. Select the entry in the Step Name table and choose Decision Keys in the navigation panel. Add and define your decision options in the Decision Keys table as described below and save your entries. The following are further explanations:

    • Key: Enter the decision key.

      Decision keys are numeric and sequential and correspond to the position of decision options in the Workflow Builder. Enter the first decision option with key 1, the second decision option with key 2, and so on.

    • Icon Mime Repository Path: Leave this field blank.

    • Decision Text: Define the label of the decision option.

      This name is displayed on the application screen as a button label. The proposed length of the decision text is maximum 14 characters. Decision texts longer than 14 characters will not fit to the device screen.

    • Comment On: If you want to make it mandatory for the user to add a comment when executing a decision, select this checkbox.

    • Nature: Here you have the following options:

      • Select POSITIVE  for the approve type decision option.

        The decision option is displayed either as a green pushbutton or in a grey pop-up (depending on the space available) on the detail screen of the application.

      • Select NEGATIVE  for the reject type decision option.

        The decision option is displayed either as a red pushbutton or in a gray popover (depending on the space available) on the detail screen of the application.

      • Leave the Multiple Decision Options field empty.

        The decision options are displayed either as gray pushbuttons or in a gray popover (depending on the space available) on the detail screen of the application.

Customizing task display name

Follow the steps below in the back-end system where you maintain your workflow template for customizing the task decisions options:

  1. In Customizing for ABAP Platform, choose Gateway Service EnablementContentWorkflow SettingsMaintain Task Names and Decision Options.

  2. Fill in the Step Name  table as described below and save your entries.

    In addition to the Workflow ID and Step ID, a Step Description can be entered. This step description would be displayed as the Task Definition Name when the end user tries to filter the task based on task type.

To Enable Selected Workflows to Be Visible in My Inbox

You can activate or deactivate the task filter so that only the tasks configured in the IMG activities MAINTAIN TASK NAMES AND DECISION OPTIONS or  WORKFLOW PATTERN CUSTOMIZATION are displayed in My Inbox. By default, the filter is deactivated.

When the task filter is set to Active:

  • Sending Notifications: Only notifications of items that were configured using the Maintain Task Names and Decision Options IMG activity or the Workflow Pattern Customization IMG activity are sent.

  • The SAP Gateway Workflow service only receives items that were configured using the Maintain Task Names and Decision Options IMG activity or the Workflow Pattern Customization IMG activity.

When the task filter is not set to Active:

  • All notifications are sent.

  • All items are read.

To activate the filter, follow these steps:

Steps

  1. In Customizing for ABAP Platform, choose Gateway Service Enablement ContentWorkflow SettingsEnable Task Filter.

  2. On executing the activity, a pop-up is displayed with buttons to Activate and Cancel.

  3. Press the Activate button.

Multiple Origin Composition

The image shows Multiple Origin Composition — CFO Calls the Service

Data from several back ends can be retrieved by adding ;mo to the service root URI. The response now contains a new key field: SAP__ORIGIN. This is necessary to distinguish the results from all the connected back-end systems.

For example, the customer has connected several ERP systems to SAP Gateway. The customer number is used as a key field of the OData service. A problem would occur if there were identical customer numbers in the different SAP back-end systems.

Note

Routing will also be performed. That means a user will only retrieve data from those back-end systems to which they have access, based on the routing. Nevertheless, the user has to have appropriate authorizations in the back end to retrieve the data.

Multiple Origin Composition Manager — EMEA and APJ Call the Service

The image shows Multiple Origin Composition Manager — EMEA and APJ Call the Service

Since the manager’s role has been assigned to both system aliases, ERP_EMEA and ERP_APJ, the manager will retrieve results with the new key field SAP__ORIGIN where SAP__Origin will have the value ERP_EMEA as well as ERP_APJ.

Multiple Origin Composition — Employee EMEA Calls the Service

The image shows Multiple Origin Composition — Employee EMEA Calls the Service

Since the employee EMEA’s role has only been assigned to alias ERP_EMEA, the employee will only retrieve results with the new key field SAP__ORIGIN where SAP__Origin will have the name ERP_EMEA.

Fault Tolerance in Taskprocessing

Error Tolerance

You can flag Read Feed Requests of a Service in Multiple Origin Composition (MOC) mode to make the service error-tolerant.

If a feed of a service is called in MOC mode, the service composes the data from all back-end systems assigned to it. More precisely, all system aliases assigned for the current user and service are identified. Then the back-end system of each of these system aliases is called, reading the data from each system. Finally, the results of each back-end system are composed into one feed that is returned to the client.

To call a service in MOC mode, segment parameter mo is added to the service name of the request URL. For example: /sap/opu/odata/IWPGW/TASKPROCESSING;mo;v=2/TaskCollection.

Error Behavior

The default error behavior is not error-tolerant. If the data retrieval from any of the back-end systems causes an error, the READ feed request returns that error. If a service is marked to be error-tolerant, this behavior changes:

  • An error is returned only if the data retrieval from all back-end systems causes an error. Otherwise, if only some of the back-end systems cause an error, a feed is returned to the client.

  • The data retrieved successfully from some of the back-end systems is composed into that feed.

  • The data missing from those back-end systems that caused an error can be requested again. For that, an OData skiptoken is added to that feed.

For example: Source Code<link rel="next" href=" TaskCollection?$skiptoken=MISSING_DATA_FROM__1_2" />

An IMG activity to customize the error tolerance is available:

  1. In the SAP Gateway system, open the SAP Reference IMG in transaction SPRO  and navigate to ABAP PlatformSAP GatewayOData ChannelCompositionSet Error Tolerance for OData Services for MOC.

  2. Create an entry for the Taskprocessing service.

How to Create a Workflow

In this demonstration, the trainer will demonstrate the steps of the following exercise. So, for the steps and data of this demonstration, refer to the Create a Workflow exercise.

Create a Workflow

Business Scenario

As workflow expert, you are required to use the new workflow in SAP S/4HANA. In this exercise, you will create a first workflow.

Note

To perform this exercise, it is required that you have completed exercise Add Three Tiles to the SAP Fiori Launchpad.

Note

In this exercise, when a value or an object name includes ##, replace ## with the number that your instructor assigned to you.

Task 1: Insert a User-Decision

Steps

  1. If not already there, log on to the SAP S/4HANA system.

    Until further note, this could be: S4D.

    1. Open the SAP Logon.

    2. Double-click on the S4D entry with the key in the icon.

    3. If one or two pop-ups display, confirm them.

  2. To test the My Inbox app, create an new workflow with a user decision. Note down the Workflow number and Step ID. Use the following data:

    Use the following data for the user decision:

    FieldValue
    TitleApprove or Reject
    Agents –> Expression&_WF_INITIATOR&
    Decision Options
    Decision Texts

    Approve

    Reject

    Details tab
    Advance with dialog<un-flag>
    Name
    AbbreviationDecision##
    Description## Exercise create a workflow

    Workflow number: __________________________________________

    Step ID: ____________________________________________________

    1. In the system start transaction SWDD (Workflow Builder).

    2. Double-click the Undefined-Step icon of the flow and choose User Decision.

    3. Enter the data from the table above.

      Data for User Decision texts,
    4. Go to the Details tab and deactivate the Advance with dialog flag.

    5. Choose Back to go back to the graphic.

    6. Save the workflow.

    7. As Abbreviation, enter Decision##. As Description, enter ## Exercise create a workflow. Choose Confirm (Enter) to close the pop-up.

    8. In the next pop-up, choose Local Object.

    9. Press the Magic Wand icon to create a runtime version.

    10. Note the Workflow number and Step ID into the 2 lines at the step.

      For example, WS99700001 and 000004:Workflow number and Step ID into the 2 lines

Task 2: Start the Workflow

Steps

  1. Start the Workflow.

    1. If the workflow image is still open, press the Test icon. Otherwise, start transaction SWUS and type in your workflow number.

    2. Press the Execute icon.

      Test Workflow screen

Task 3: Check the My Inbox App

Steps

  1. Check the My Inbox app.

    1. Go to the SAP Fiori Launchpad. If not already logged in, log on to the system.

      The required steps are described in the exercise Add Three Tiles to the SAP Fiori Launchpad.

    2. If not still open, start the SAP Fiori launchpad from the User menu: SAP FioriSAP Fiori Launchpad.

      Note, that the SAP Fiori launchpad starts in Internet Explorer.

    3. If the SAP Fiori Launchpad was already open, you have to refresh it. Choose Refresh of the browser.

    4. Click on the My Inbox tile.

      the SAP Fiori Launchpad, My Inbox Tile in Workflow
    5. In the dark lower area, you can see the newly created Approve and Reject buttons.

      My InboxCreated test workitem in My Inbox application

  2. Configure the buttons. Use the following data:

    KeyIcon MimeDecision TextCommentNature
    1 APProve POSITIVE
    2 REject<flag>NEGATIVE
    1. Go to the back-end system (S4D).

    2. Start transaction SPRO.

    3. Choose SAP Reference-IMG.

    4. Go to ABAP PlatformSAP Gateway Service EnablementContentWorkflow SettingsMaintain Task Names and Decision Options.

      Maintain Task Names and Decision Options
    5. Select New Entries and enter the Workflow and Step ID from Task 1. Also enter a Step Description.

      Workflow and Step ID
    6. Press Enter on your keyboard.

    7. Select the entries and double-click on Decision Keys.

    8. Choose New Entries. Enter the button descriptions as given in the table above.

      Note

      The "typos" APProve and REject are on purpose.
      button descriptions for new entries
    9. Choose Save.

    10. If a transport request displays, assign a transport request or create a new one.

  3. Test your settings.

    1. Go back to your SAP Fiori launchpad.

    2. Refresh it.

    3. Re-open the My Inbox app.

      You should see the colored buttons with the "typos".My Inbox with workitem and coloured buttons with typos