Plug-in: Finance Integration on a Project and WBS Level
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
The SapCOPlugIn component of the ERP Connector Solution Starter for Microsoft Office Project Server 2007 can create projects and tasks on Project Server 2007. The plug-in uses XML request files exported from custom modules on the mySAP™ ERP Financials CO and PS subsystems. Data from internal orders in the CO subsystem is used for projects and work breakdown structure data from the PS subsystem is used for tasks.
The ERP Connector on Project Server detects an XML request file and processes it by using the SapCOPlugIn component (in the ErpConnector.SapCOPlugIn.dll assembly). The SapCOPlugIn can use internal order data to create projects without tasks and can also use internal order and WBS data from mySAP ERP to create projects that include tasks or to update projects with new tasks.
Note |
---|
Because the Project Server Interface (PSI) can process a maximum of 1000 rows of data at a time, the implementation of SapCOPlugIn in the ERP Connector Solution Starter cannot handle requests that have more than 1000 WBS_ELEMENT_DATA elements. |
This topic contains the following sections:
Exporting the XML Request File from mySAP ERP
XML Request Syntax
Request Parameters
Enterprise Custom Field Mappings
Processing a Request
Committing Projects and Tasks
For information about configuration settings for the SapCOPlugIn component, see Configuring the ERP Connector. To complete the financial integration with round-trip data, you can send timesheet data from projects created by SapCOPlugIn back to mySAP ERP Financials by using the SapFIPlugIn component. For more information, see Plug-in: Finance Integration with Work Actuals. For developer documentation of the classes, methods, properties, and events of the ERP Connector, see the ERPConnectorComponents.chm file in the Project 2007 SDK download. For class diagrams, see the class diagram.cd files in each project of the ERP Connector 2007 solution in Microsoft Visual Studio 2005.
Exporting the XML Request File from mySAP ERP
You must implement some code in the proprietary ABAP™ programming language or in ECMAScript (JScript, JavaScript) to export the XML file with human resources data from mySAP ERP. The ERP Connector Solution Starter in the Project 2007 SDK download provides sample ABAP code for exporting the XML file. To install the code and create the export command, see Installing the Components for mySAP ERP.
Project without tasks. To create a project without tasks, you must create at least one controlling internal order in mySAP ERP Financials. A user starts the mySAP ERP function builder (by using transaction SE37), opens the appropriate ABAP function, enters the ID of the CO subsystem order, and executes the function. The function exports the internal order data in an XML file.
The export service in mySAP ERP Human Capital Management (HCM) saves an XML file that includes the following information:
Project ID (valid mySAP ERP Financials CO subsystem accounting ID)
Project name (short text of mySAP ERP Financials CO subsystem accounting ID)
Project start date (DATE_WORK_BEGINS field)
Project manager (name of the person responsible for the project)
Plant (can be used in a project text field)
Project with tasks. To create a project with tasks, you must create at least one controlling internal order in mySAP ERP. A user starts the mySAP ERP function builder (by using transaction SE37), opens the appropriate ABAP function, enters the project definition ID (PSPID) of the PS project, and executes the function. The function exports the WBS elements and the related CO internal orders in an XML file.
mySAP ERP exports the following fields in the XML file:
Project ID (valid mySAP ERP project definition ID)
Project name (short text of the project definition)
Project start (start date of the project definition)
Project manager (name of the responsible person in the project definition)
Plant (can be used in a project text field)
WBS IDs (tasks or assignments)
WBS names
WBS start date and finish date
WBS assignments from the CO internal orders
WBS hierarchy data, including the Project ID, WBS ID, and IDs of the parent, child, and sibling tasks
XML Request Syntax
The syntax of an XML request file for the SapCOPlugIn component is different for projects without tasks and projects with tasks.
Syntax for Projects without Tasks
<Request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SapCOPlugIn.xsd">
<ProjectCreateSAP>
<AutoPublish>1</AutoPublish>
<CO_INTERNAL_ORDER_DATA>
<ORDER_ITEM>
<ORDER/>
<ORDER_NAME/>
<PLANT/>
<WBS_ELEMENT_EXT/>
<PERSON_RESP/>
<DATE_WORK_BEGINS/>
</ORDER_ITEM>
</CO_INTERNAL_ORDER_DATA>
<PROJECT_DEFINITION_DATA>
<PROJECT_DEFINITION/>
<DESCRIPTION/>
<START/>
<RESPONSIBLE_NO/>
<PLANT/>
</PROJECT_DEFINITION_DATA>
</ProjectCreateSAP>
</Request>
Syntax for Projects with Tasks
<Request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SapCOPlugIn.xsd">
<ProjectCreateSAP>
<AutoPublish>1</AutoPublish>
<CO_INTERNAL_ORDER_DATA>
<ORDER_ITEM>
<ORDER/>
<ORDER_NAME/>
<PLANT/>
<WBS_ELEMENT_EXT/>
<PERSON_RESP/>
<DATE_WORK_BEGINS/>
</ORDER_ITEM>
<!-- Additional order items -->
</CO_INTERNAL_ORDER_DATA>
<PROJECT_DEFINITION_DATA>
<PROJECT_DEFINITION/>
<DESCRIPTION/>
<START/>
<RESPONSIBLE_NO/>
<PLANT/>
<WBS_ELEMENT_LIST>
<WBS_ELEMENT_DATA>
<WBS_ELEMENT/>
<DESCRIPTION/>
<WBS_BASIC_START_DATE/>
<WBS_BASIC_FINISH_DATE/>
</WBS_ELEMENT_DATA>
<!-- Additional WBS elements -->
</WBS_ELEMENT_LIST>
<WBS_HIERARCHY_DATA>
<WBS_HIERARCHY>
<PROJECT_DEFINITION/>
<WBS_ELEMENT/>
<UP/>
<DOWN/>
<LEFT/>
<RIGHT/>
</WBS_HIERARCHY>
<!-- Additional hierarchy data -->
</WBS_HIERARCHY_DATA>
</PROJECT_DEFINITION_DATA>
</ProjectCreateSAP>
</Request>
Request Parameters
Table 1 describes the parameters for a ProjectCreateSAP request. If the tag occurrence includes 0, it is an optional parameter. An occurrence of n means unbounded.
Table 1. Parameters for a ProjectCreateSAP request
Tag |
Description |
Type / format |
Occurrence |
---|---|---|---|
AutoPublish |
Specifies whether the project should be automatically published after it is created. Use 1 for true; 0 for false. The default is 0. |
0 or 1 |
0 - 1 |
|
(CO_INTERNAL_ORDER_DATA section) |
|
|
CO_INTERNAL_ORDER_DATA |
Summary tag for one or more CO internal orders. |
|
0 - 1 |
ORDER_ITEM |
Contains details of one CO internal order. |
|
1 - n |
ORDER |
Unique ID of a CO internal order. |
Text |
1 |
ORDER_NAME |
Name of the order item. |
Text |
0 - 1 |
PLANT |
Plant to which the order item is assigned. |
Text |
0 - 1 |
WBS_ELEMENT_EXT |
WBS element that is assigned to the order item. |
Numeric |
0 - 1 |
PERSON_RESP |
Name of the person responsible for the project (the project manager). |
Text |
0 - 1 |
DATE_WORK_BEGINS |
Date on which work begins for the order item. |
Date: YYYYMMDD |
0 - 1 |
|
(PROJECT_DEFINITION_DATA section) |
|
|
PROJECT_DEFINITION_DATA |
Parent element for the project definition. Contains the project details and optionally contains the WBS hierarchy of the project. |
|
0 - 1 |
PROJECT_DEFINITION |
Unique ID for the project, in mySAP ERP. |
Text |
0 - 1 |
DESCRIPTION |
Description of the project. |
Text |
0 - 1 |
START |
Planned project start date. |
Date: YYYYMMDD |
0 - 1 |
RESPONSIBLE_NO |
ID of the person responsible for the project (the project manager). |
Numeric |
0 - 1 |
PLANT |
Plant to which the project is assigned. |
Text |
0 - 1 |
|
(WBS_ELEMENT_LIST section) |
|
|
WBS_ELEMENT_LIST |
Parent element for WBS elements. Contains the definition of WBS elements of the project. |
|
0 - 1 |
WBS_ELEMENT_DATA |
Details of one WBS element of a project. |
|
1 - n |
WBS_ELEMENT |
Unique ID of the WBS element. |
Text |
1 |
DESCRIPTION |
Description (name) of the WBS element. |
Text |
0 - 1 |
WBS_BASIC_START_DATE |
Planned start date for the WBS element. |
Date: YYYYMMDD |
0 - 1 |
WBS_BASIC_FINISH_DATE |
Planned finish date for the WBS element. |
Date: YYYYMMDD |
0 - 1 |
|
(WBS_HIERARCHY_DATA section) |
|
|
WBS_HIERARCHY_DATA |
Parent element for WBS hierarchy data. Contains hierarchy information of WBS elements in the project. |
|
0 - 1 |
WBS_HIERARCHY |
Hierarchy details of one WBS element in a project. |
|
1 - n |
PROJECT_DEFINITION |
Unique mySAP ERP project ID to which the WBS hierarchy mapping belongs. |
Text |
1 |
WBS_ELEMENT |
Unique mySAP ERP WBS ID to which the hierarchy mapping belongs. |
Text |
1 |
UP |
ID of the parent WBS element. |
Text |
0 - 1 |
DOWN |
ID of the first child WBS element. |
Text |
0 - 1 |
LEFT |
ID of the previous WBS element on the same level, under the same parent. |
Text |
0 - 1 |
RIGHT |
ID of the next WBS element on the same level, under the same parent. |
Text |
0 - 1 |
Enterprise Custom Field Mappings
Table 2 shows the relationships between mySAP ERP input data and properties in the PSI ProjectDataSet and enterprise custom fields for updates to Project Server.
Table 2. Mappings of request data
Tag |
Description |
---|---|
|
The fields in the PROJECT_DEFINITION_DATA section are for mapping projects. |
|
(PROJECT_DEFINITION_DATA section) |
PROJECT_DEFINITION |
Project enterprise custom field: SAP Project ID |
DESCRIPTION |
|
START |
|
RESPONSIBLE_NO |
Project enterprise custom field: SAP Responsible No |
PLANT |
Project enterprise custom field: SAP Plant ID |
|
The fields in the ORDER_ITEM and WBS_ELEMENT_DATA sections are for mapping tasks. |
|
(ORDER_ITEM section) |
ORDER |
Task enterprise custom field: SAP Order ID |
WBS_ELEMENT_EXT |
Task enterprise custom field: SAP WBS Element ID |
|
(WBS_ELEMENT_DATA section) |
WBS_ELEMENT |
Task enterprise custom field: SAP WBS Element ID |
DESCRIPTION |
Processing a Request
The SapCOPlugIn component first checks whether a WBS element list exists in an XML request that has the ProjectCreateSAP element. If the request does not contain a WBS element list, then SapCOPlugIn handles the request as a mySAP ERP Financials CO project request; otherwise, the request is from mySAP ERP Financials PS.
The plug-in creates a Projects container to store the Project and Task objects. The local Projects container is set as the synchronization master to override any project and task properties received from Project Server. However, the local (master) synchronization mode is set to remove any server (subordinate or slave) entities. Therefore, SapCOPlugIn drops projects that exist on the server during synchronization.
The remote (slave) synchronization mode is set to merge any local (master) and server (slave) entities. SapCOPlugIn adds new projects and tasks from the local container and does not touch projects and tasks that already exist on Project Server.
For a request from mySAP ERP Financials CO, the plug-in reads project and summary task properties from the ORDER_ITEM elements. SapCOPlugIn uses the first available valid property. After the plug-in processes all order items, it creates a project with no tasks, using the properties from the ORDER_ITEM elements.
For a request from mySAP ERP Financials PS, the plug-in reads project properties from the PROJECT_DEFINITION_DATA element, not from the ORDER_ITEM elements. SapCOPlugIn parses the order item elements to retrieve order IDs for WBS elements. The plug-in converts WBS_ELEMENT elements to new project tasks and links them according to data in the WBS_HIERARCHY elements.
After SapCOPlugIn completely processes the request, it starts synchronization of the Projects container. The plug-in checks whether the project already exists on Project Server and uploads new projects and tasks to the server.
Committing Projects and Tasks
At the start of synchronization, the Projects container retrieves a list of projects from Project Server, and then creates a list of project entities. The base container logic uses the synchronization settings and the list of entities to remove projects that exist on Project Server.
The Projects container then creates project and task table rows in the delta DataSet for remaining project and task entities. Because one XML request can contain only one project, the Projects container can contain either one project (if that project does not exist on the server) or no projects (if that project exists on the server). The Projects container then commits the DataSet to Project Server to create the project and tasks or to update the existing project with new tasks.
If a new project is from a mySAP ERP Financials CO request, then SapCOPlugIn checks out the project again after synchronization, adds relevant properties from the mySAP information to the project summary task by using a new delta DataSet, commits the changes to the server, and then checks the project back in.
If the XML request contains the AutoPublish element with a value greater than zero, then SapCOPlugIn calls the QueuePublish method in the Project Web service.
SapCOPlugIn accepts a valid XML request if the Projects container is not empty after synchronization. In that case, the request file contains new project or task data that is not in Project Server. If the Projects container contains no entities after synchronization, the plug-in rejects the request file. Either there is no project or task data in the request, or the data already exists in Project Server.
See Also
Concepts
Core Components of the ERP Connector