Show TOC Start of Content Area

Background documentation FunctionModuleActionHandler  Locate the document in its SAP Library structure

Purpose

You can use FunctionModuleActionHandler to handle execution of items for which a workflow is executed through a given function module.

Provider specific Information

FunctionModuleActionHandler  supports WebFlowConnector provider. Items must belong to the WebFlowConnector.

Supported Actions

Action name can be anything.

Properties

FunctionModuleActionHandler  expects the following properties:

      FunctionModule (mandatory)

A Function Module to execute the workflow.

      DeleteItem (optional)

This is a flag, indicating that the item should be removed from the cache after executing the function module. The values are true and false. Default is true.

All other properties are passed to the function module as input parameters.

Input Special Properties

If there are input properties that have to be set in the table (structure), it can be done the following way:

<Property name="UWL_TABLE_IN1" value=table name>, so the first special property name is UWL_TABLE_IN# where # is the number of the table affected in input. Then corresponding table parameters will have property names UWL_TABLE_IN1_ROW#_PARAMETER#:

<Property name="UWL_TABLE_IN1_ROW1_PARAMETER1" value="parameter 1">

<Property name="UWL_TABLE_IN1_ROW1_PARAMETER2" value="some other parameter for the table UWL_TABLE_IN1"> ...

And the third corresponding property is UWL_TABLE_IN#_PARAMETER#_VALUE:

<Property name="UWL_TABLE_IN1_ROW1_PARAMETER1_VALUE" value="parameter 1 value">

Configuration for FunctionModuleActionHandler is done in a custom XML for an item type, for which a workflow executed through a given function module is defined.

Output Special Properties

When a function module from the backend system is executed, the RETURN_CODE and the table MESSAGE_LINES is used for displaying the result. If the function module does not have a standard structure (RETURN_CODE as an export parameter and a table MESSAGE_LINES), you can define your own UWL_RETURN_CODE, which is different from the backend system RETURN_CODE. If the UWL_RETURN_CODE does not return the value 0 (success), the return error message will be queried by calling export parameter UWL_RETURN_MESSAGE. In case there is no message in the export parameter, the message can be retrieved from the UWL_RETURN_TABLE and UWL_RETURN_TABLE_PARAMETER (see example below). Finally if no message can be retrieved from the UWL_RETURN_TABLE, the system displays a general UWL error message.

Example

Following is the definition of an item type for which a workflow with two terminating events (approved and rejected) is defined.  The sample task TS91100019 is defined as a vacation approval form of type FORMABSENCand it is executed through a function module SAP_WAPI_CREATE_EVENT:

<ItemType name="uwl.task.approval.webflow.TS91100019" connector="WebFlowConnector"

defaultView="WorkItemsApprovalView">

 <ItemTypeCriteria connector="WebFlowConnector" externalType="TS91100019"/>

  <Actions>

   <Action name="approve" groupAction="yes" handler="FunctionModuleActionHandler">

    <Properties>

     <Property name="FunctionModule" value="SAP_WAPI_CREATE_EVENT"/>

     <Property name="OBJECT_TYPE" value="FORMABSENC"/>

     <Property name="EVENT" value="approved"/>

     <Property name="OBJECT_KEY" value="${item.externalObjectId}"/>

     <Property name="COMMIT_WORK" value="X"/>

     <!-- special return parameters -->

     <Property name="UWL_RETURN_CODE" value="RET_MESS"/>

     <!-- special input parameters -->

     <Property name="UWL_TABLE_IN1" value="INPUT_CONTAINER"/>

     <Property name="UWL_TABLE_IN1_PARAMETER1" value="ReleaseCode"/>

     <Property name="UWL_TABLE_IN1_PARAMETER1_VALUE" value="EX"/>

    </Properties>

    <Descriptions default="Approve"/>

   </Action>

   <Action name="reject" groupAction="yes" handler="FunctionModuleActionHandler">

    <Properties>

     <Property name="FunctionModule" value="SAP_WAPI_CREATE_EVENT"/>

     <Property name="OBJECT_TYPE" value="FORMABSENC"/>

     <Property name="EVENT" value="rejected"/>

     <Property name="OBJECT_KEY" value="${item.externalObjectId}"/>

     <Property name="COMMIT_WORK" value="X"/>

     <Property name="UWL_RETURN_CODE" value="RET_MESS"/>

     <Property name="UWL_TABLE_IN1" value="INPUT_CONTAINER"/>

     <Property name="UWL_TABLE_IN1_PARAMETER1" value="ReleaseCode"/>

     <Property name="UWL_TABLE_IN1_PARAMETER1_VALUE" value="EX"/>

    </Properties>

    <Descriptions default="Reject"/>

   </Action>

  </Actions>

</ItemType>

 

End of Content Area