Beruflich Dokumente
Kultur Dokumente
Copyright
Copyright 2013 SAP AG. All rights reserved.
SAP Library document classification: PUBLIC
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.
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, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered trademarks of Microsoft
Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, z10,
z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Architecture, Power Systems, POWER7, POWER6+, POWER6,
POWER, PowerHA, pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP, RETAIN, DB2
Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, Informix, and Smarter Planet are trademarks
or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the United States and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered trademarks of Adobe Systems
Incorporated in the United States and other countries.
Oracle and Java are registered trademarks of Oracle and its affiliates.
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.
, XML, XHTML, and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium,
Massachusetts Institute of Technology.
HTML
Apple, App Store, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi-Touch, Objective-C, Retina, Safari, Siri, and Xcode
are trademarks or registered trademarks of Apple Inc.
IOS is a registered trademark of Cisco Systems Inc.
RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry Torch, BlackBerry Storm,
BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App World are trademarks or registered trademarks of
Research in Motion Limited.
Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps, Google Mobile Ads, Google Mobile
Updater, Google Mobile, Google Store, Google Sync, Google Updater, Google Voice, Google Mail, Gmail, YouTube,
Dalvik and Android are trademarks or registered trademarks of Google Inc.
INTERMEC is a registered trademark of Intermec Technologies Corporation.
Wi-Fi is a registered trademark of Wi-Fi Alliance.
Bluetooth is a registered trademark of Bluetooth SIG Inc.
Motorola is a registered trademark of Motorola Trademark Holdings LLC.
Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, 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 other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence,
Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services
mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc. Sybase is an
SAP company.
Crossgate, m@gic EDDY, B2B 360, and B2B 360 Services are registered trademarks of Crossgate AG in Germany and
other countries. Crossgate is an SAP company.
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.
Table of Contents
Task Gateway Service ..................................................................................................................... 4
Configuring the Task Gateway Service ....................................................................................... 4
Customizing Task Gateway ......................................................................................................... 8
Task Gateway Collections ......................................................................................................... 10
Task Collection ....................................................................................................................... 11
Task Definition Collection ....................................................................................................... 12
Context Collection .................................................................................................................. 12
Filter Option Collection ........................................................................................................... 15
Substitution Collection ............................................................................................................ 16
Potential Owners Collection ................................................................................................... 18
Possible Agents Collection ..................................................................................................... 19
Attachments Collection ........................................................................................................... 20
Comments Collection ............................................................................................................. 21
Description Collection ............................................................................................................. 22
Processing Logs Collection .................................................................................................... 22
Task Definition Data Collection .............................................................................................. 23
Execution Link Collection ....................................................................................................... 23
Task Gateway User Exits ........................................................................................................... 24
User Exits for Scenario Count Items ...................................................................................... 26
2. Connecting the service to the backend system where you want to have the Gateway
information displayed:
o
The service uses the Multi-origin composition (MOC) component. For more information, see the
Multiple Origin Composition section.
To create a system alias:
1. On the SAP NetWeaver Gateway system, open transaction SPRO.
2. Choose SAP Reference IMG.
3. Select SAP Customizing Implementation Guide SAP NetWeaver Gateway
OData Channel Configuration Connection Settings SAP NetWeaver Gateway
to SAP System.
4. Open the Manage SAP System Aliases activity. The Change View Manage SAP
System Aliases: Overview page is displayed.
5. Choose New Entries.
6. In the Manage SAP System Aliases table, enter the following:
o Under SAP System Alias, enter the new system alias. For example,
GWQ_800_BEP.
o
Under RFC Destination, enter the trusted RFC destination to the SAP system.
NOTE
If you have a SAP NetWeaver BPM system, set WS Provider System as the
RFC Destination.
Under Software Version, press F4 and select the relevant data provider
(software version), for example, /IWPGW/BWF or/IWPGW/BPM (for a BPM
server).
7. Choose Save.
8. To create additional system aliases for other providers like BPM repeat steps 5 to 7.
Gateway
6. In the System Alias field, press F4 and select the system alias you created in the
procedure above.
7. Press Enter. The Add Service table is populated.
8. From the Technical Service Name column, double-click /IWPGW/TASKPROCESSING.
The Add Service page is displayed.
9. Copy the name that appears in the Technical Model Name field, you will need it to
assign the software version to the service.
10. In the Package field, enter the package to which you want to assign the service.
11. Choose the checkmark. The Activate and Maintain Services page is displayed.
12. Under the ICF Nodes section, make sure the ODATA node status is set to Active.
13. Under the System Aliases section, make sure the system alias we activated is
displayed.
To assign the software version to the service:
1. On the SAP NetWeaver Gateway system, open transaction SPRO.
2. Choose SAP Reference IMG.
3. Select SAP Customizing Implementation Guide SAP NetWeaver
OData Channel Development with IW_BEP Registration.
Gateway
4. Open the Assign Data Provider to Data Model activity. The Change View Assign
Data Provider to Data Model: Overview page is displayed.
5. Choose New Entries.
6. In the Assign Data Provider to Data Model table, enter the following:
o
Under Model Identifier, enter the technical name you obtained in the previous
step (To activate the service) followed by _0001_BE. For example, <model
identifier name>_0001_BE.
o
o
Under Type, select (Adaptation) Data Provider from the drop-down list.
Under Software Version, press F4 and select the relevant software version for
example /IWPGW/BPM or /IWPGW/BWF.
o
o
o
(Copy).
Task Collection
Context Collection
Substitution Collection
Attachments Collection
Comments Collection
Description Collection
10
Task Collection
This collection represents the user's tasks exposed by the respective providers (for example,
Business Workflow (BWF) and BPM). When navigating to the Task collection, users receive their
inbox tasks and their completed tasks.
Properties Table
Property Name
Description
Key field.
SAP__Origin
Contains the system alias of the task's source.
Key field.
InstanceID
Contains the task instance ID. (For example, work item ID from BWF.)
TaskDefinitionID
TaskDefinitionName
The name of the Task ID. (Maintained by customization on the PGW AddOn. It can also retrieved using the TaskDefinitionData association.)
TaskTitle
The item's subject. (It can be changed using a BAdI in the PGW Add-On)
Priority
The technical name of the item's priority. For the possible values of this
property and the display name, use the FilterOptionCollection.
Status
The technical name of the item's status. For the possible values of this
property and the display name, use the FilterOptionCollection.
CreatedOn
CreatedBy
Full name of the user who created the item (source system user).
Processor
StartDeadLine
CompletionDeadLine
ExpiryDate
The time and date when the item expires. (For BPM items only.)
IsEscalated
HasComments
HasAttachments
HasPotentialOwners
ContextServiceURL
For more information, see the Context Collection section.
11
Description
Key field.
SAP__Origin
Contains the task's source system alias.
TaskDefinitionID
TaskName
Category
ProviderID
The Task provider ID. (Can be BWF for the Business Workflow.)
Context Collection
This collection enables you to add Business Context data to the Generic Workflow Task Object.
This helps the user to make better decisions by reading related Business data.
The Task Gateway service enables to link additional Gateway service which will return the
business context of a collection or a single entry.
At runtime, the consumer application retrieves the business data context using the link supplied.
Implementation
The business context is retrieved from an additional Gateway service. For the context service to
work properly, a predefined collection must be implemented in the new context service.
To create the context service metadata provider class (MPC):
1. In your SAP NetWeaver Gateway system, open transaction SE24. The Class Builder:
Initial Screen is displayed.
2. Note: Make sure the IW_BEP is installed in this system.
3. In the Object type field, enter the name of the new MPC class.
4. Choose Create.
5. In the Object type dialog box, select the Class radio button and choose the checkmark.
6. In the Create Class dialog box, enter a description and choose Save. The Create Object
Directory Entry page is displayed.
7. In the Package field, assign a valid package and choose the checkmark. The Class
Builder: Change Class page is displayed.
8. Select the Properties tab.
12
ENDMETHOD.
12. Activate your class. Your metadata class is created.
To create the context service data provider class (MPC):
1. In your SAP NetWeaver Gateway system, open transaction SE24. The Class Builder:
Initial Screen is displayed.
2. Note: Make sure the IW_BEP is installed in this system.
3. In the Object type field, enter the name of the new DPC class.
4. Choose Create.
5. In the Object type dialog box, select the Class radio button and choose the checkmark.
6. In the Create Class dialog box, enter a description and choose Save. The Create Object
Directory Entry page is displayed.
7. In the Package field, assign a valid package and choose the checkmark. The Class
Builder: Change Class page is displayed.
8. Select the Properties tab.
9. Derive your class from super class /IWPGW/CL_TGW_CONTEXT_RT_ABS and choose
Save.
10. Select the Methods tab.
11. Redefine and implement the ENTITYSET_CONTEXT and the ENTITY_CONTEXT
methods, to retrieve the business context data on runtime either to get a context entity
set or a context entity respectively.
12. Activate your class. Your metadata class is created.
13
Description
Example
Task Type
Task ID.
TS00008267
System Alias
ERP
Technical
Service
Name
ZCONTEXT_PURCHASE_ORDER
Version
For example:
1. Navigate to the Task Gateway service.
http://ldcigiq.wdf.sap.corp:50015/sap/opu/odata/IWPGW/TASKPROCESSING/?$format=
xml
2. Navigate to the ContextCollection. You must use a filter on the TaskDefinitionID to get
the context according to the task type.
http://ldcigiq.wdf.sap.corp:50015/sap/opu/odata/IWPGW/TASKPROCESSING/ContextCo
llection?$filter=TaskDefinitionID eq 'TS00008267'. The Context service link is displayed.
3. Use the link and navigate to the context service query.
http://ldcigiq.wdf.sap.corp:50015/sap/opu/odata/sap/
zcontext_purchase_order;v=1/ContextCollection?$filter=TaskDefinitionID eq
'TS00008267'
4. On the Query collection level, the business context retrieved is implemented by the
customer. (The client application can merge this data with the Workflow Task data.)
5. Navigate to the specific entity to see the specific business data context.
http://ldcigiq.wdf.sap.corp:50015/sap/opu/odata/sap/
zcontext_purchase_order;v=1/ContextCollection('000000065629')
14
15
Substitution Collection
This is an addressable collection. It reflects all the current user's substitutions, that is, users that
are authorized to execute tasks on behalf or instead of the current user. The Substitution entity
contains the following properties:
Properties Table
Property
Name
Description
User
BeginDate
EndDate
FullName
IsActive
Mode
In BPM, there are substitution modes for Receiver and Replacer. In BWF, all
substitutes are Receivers.
GET To retrieve the Substitution collection, perform a GET operation on the relevant
URL.
To obtain the URL:
1. On the SAP NetWeaver Gateway system, go to transaction SPRO and choose
SAP Reference IMG.
2. Navigate to SAP NetWeaver > Gateway > OData Channel > Administration >
General Settings Activate and Maintain Services.
3. Select the Task Gateway service.
4. Choose Call Browser.
5. Navigate to SubstitutionCollection.
16
>atom:content type="application/xml">
>m:properties
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices
/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices
">
>d:User>FISHMANROY>/d:User>
>d:FullName>Roy FISHMAN>/d:FullName>
>d:IsActive>true>/d:IsActive>
>d:BeginDate>2012-05-08T00:00:00>/d:BeginDate>
>d:EndDate>9999-12-31T00:00:00>/d:EndDate>
>d:Mode>RECEIVE_TASKS>/d:Mode>
>/m:properties>
>/atom:content>
>/atom:entry>
PUT To update the status of the substitution (activate or deactivate), perform a PUT
operation on the relevant URL.
To obtain the URL:
1. On the SAP NetWeaver Gateway system, go to transaction SPRO and choose
SAP Reference IMG.
2. Navigate to SAP NetWeaver > Gateway > OData Channel > Administration >
General Settings > Activate and Maintain Services.
3. Select the Task Gateway service.
4. Choose Call Browser.
5. Navigate to SubstitutionCollection.
6. Navigate to the collection on the specific user ID
SubstitutionCollection(User=>user>,BeginDate=>BeginDate>,EndDate=>
EndDate>).
Fill the request body as follows:
>atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
>atom:content type="application/xml">
>m:properties
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices
/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices
">
>d:User>FISHMANROY>/d:User>
>d:FullName>Roy FISHMAN>/d:FullName>
>d:IsActive>true>/d:IsActive>
>d:BeginDate>2012-05-08T00:00:00>/d:BeginDate>
>d:EndDate>9999-12-31T00:00:00>/d:EndDate>
>d:Mode>RECEIVE_TASKS>/d:Mode>
>/m:properties>
>/atom:content>
>/atom:entry>
To activate the substitution, set the IsActive field to true.
To deactivate the substitution, set the IsActive field to false.
17
Description
Key field.
SAP__Origin
Contains the task's source system alias.
Key field.
InstanceID
Contains the task instance ID. (For example, work item ID from BWF.)
Key field.
Owner
The user who owns the item. (Source system user.)
Type
18
Description
Key field.
SAP__Origin
Contains the task's source system alias.
Key field.
InstanceID
Contains the task instance ID. (For example, work item ID from BWF.)
Key field.
UserName
The user who is authorized to receive the item. (Source system user.)
FullName
19
Attachments Collection
This collection retrieves the task's attachment data.
You can navigate to this collection from the Task collection using:
TaskCollection(SAP__Origin='ERP',InstanceID='<instance_id>')/Attachments
Each entry contains a media link to retrieve the attachment content.
This collection supports create and delete using media links. For more information, see the
Adding and Deleting Attachments using the Task Gateway Service section below.
Properties Table
Property Name
Description
Key field.
SAP__Origin
Contains the task's source system alias.
Key field.
InstanceID
Contains the task instance ID. (For example, work item ID from BWF.)
Key field.
ID
Attachment's GUID ID.
FileName
CreatedAt
CreatedBy
mime_type
20
8. Execute a POST request on the obtained URL with the attachment content as the
request body and the following request header parameters:
o
Comments Collection
This collection retrieves the task's comments. Unlike attachments, the comments are always
simple text.
You can navigate to this collection from the Task collection using:
TaskCollection(SAP__Origin='ERP',InstanceID='<instance_id>')/Comments
Properties Table
Property Name
Description
Key field.
SAP__Origin
Contains the task's source system alias.
Key field.
InstanceID
Contains the task instance ID. (For example, work item ID from BWF.)
Key field.
ID
The comment's GUID ID.
CreatedAt
CreatedBy
Text
21
Description Collection
This collection contains the task's description text. Unlike the Task Title, the description contains
a long text which contains a description of the task for the user.
You can navigate to this collection from the Task collection using:
TaskCollection(SAP__Origin='ERP',InstanceID='<instance_id>')/Description
Properties Table
Property Name
Description
Key field.
SAP__Origin
Contains the task's source system alias.
Key field.
InstanceID
Contains the task instance ID. (For example, work item ID from BWF.)
Description
Description
Key field.
SAP__Origin
Contains the task's source system alias.
Key field.
InstanceID
Contains the task instance ID. (For example, work item ID from BWF.)
Key field.
OrderID
Describes the order of the log action.
Timestamp
ActionName
PerformedB
Displays the user that performed the action (source system user).
Comments
TaskStatus
22
Description
SAP__Origin
Key field.
Contains the task's source system alias.
InstanceID
Key field.
Contains the task instance ID (for example, work item ID from BWF).
OrderID
Key field.
Describes the order of the log action.
Timestamp
ActionName
PerformedB
Comments
TaskStatus
Description
SAP__Origin
Key field.
Contains the task's source system alias.
InstanceID
Key field.
Contains the task instance ID. (For example, work item ID from BWF.)
GUI_Link
Contains the link for executing the work item via WebGUI. The link is relative,
this means you must add the protocol, host, and port before the link to execute
it.
23
When executing a GET action on the Task Collection feed (which retrieves all the current
user's tasks). This changes the task title for all inbox tasks.
When executing a GET action on a Task Collection entry (which retrieves a specific task).
This changes the task title for a specific task.
When executing a GET action on the Description Collection. This changes the task
description.
When executing a GET action on the User Info Collection. This allows you to fetch user
details from the desired user storage.
To implement you code in the user exits, you must create a BAdI that enables new functionality at
the chosen entry point.
To create a new BAdI:
1. In your SAP system, open transaction SE19. The BAdI builder initial screen for
Implementations page is displayed.
2. In the Create implementation area, select the New BAdI radio button.
3. In the Enhancement Spot field, enter the following:
o
To change the task title for all items when executing a query operation on the
Task Collection (Query BAdI), enter /IWPGW/ES_TGW_TASK_QUERY.
To change the task title or task description for a specific item when executing a
Read operation on the Task Collection or Task Description Collection (Read
BAdI), enter /IWPGW/BADI_TGW_TASK_DATA.
To change the user details that are returned by the service, enter
/IWPGW/ES_TGW_USER_DETAIL.
24
For the Query BAdI: The import parameters are the task provider ID and the table
containing all task header details. The output parameter is a table containing the task
IDs and the corresponding task IDs after modification.
For the READ BAdI: The import parameters are the task provider's ID and the task
header details.
For the User Info BAdI: There are two methods in the BAdI interface, one retrieves
user textual details, and the other retrieves the users image. Both methods receive
an instance ID, navigation path, URL parameters, and a reference to the current
provider faade implementation. The output parameter for the first method is the user
details structure and, for the second one, a media resource structure.
The BAdI needs to find the user according to the import parameters and then retrieve
the users details/image.
26. Choose Save and then Activate. The Inactive Objects page is displayed.
27. Select all objects and choose the checkmark.
25
26