Plug-in: Human Resources Integration

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 SapHRPlugIn component of the ERP Connector Solution Starter for Microsoft Office Project Server 2007 can create, modify, activate, and deactivate resources on Project Server. The plug-in uses XML request files exported by using custom modules on the mySAP™ ERP Human Capital Management (HCM) system.

The ERP Connector detects an XML request file and processes it by using the SapHRPlugIn component (in the ErpConnector.SapHRPlugIn.dll assembly). The SapHRPlugIn component:

  • Creates resources in the Project Server enterprise resource pool and related logon accounts.

  • If resources already exist, updates them with the most recent data.

  • Marks resources as deactivated, if the XML request file does not include them.

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 Resources

For information about configuration settings of the SapHRPlugIn component, see Configuring the ERP Connector.

Exporting the XML Request File from mySAP ERP

You must implement some code in the proprietary ABAP™ programming language or in ECMAScript (JScript, JavaScript) or Microsoft Visual J# 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.

The mySAP ERP HCM system defines one action, which is the command to export the XML file. A user starts the mySAP ERP function builder (by using transaction SE37), types the name of the ABAP function, and executes the function. The administrator for mySAP ERP can define a command or button within other transactions to run the export function more easily.

The export service in mySAP ERP HCM creates an XML file that includes the following information:

  • Employee name

  • Employee ID (a unique ID for resource identification)

  • E-mail address (optional)

  • Standard rate, based on cost center or activity type (optional)

  • Overtime rate, based on cost center or activity type (optional)

  • Currency type

  • Date of birth

  • Sequence number in mySAP ERP HCM

  • Dates for resource availability

  • Date resource data was last changed, and name of who changed it

If mySAP ERP HCM does not provide the optional values, you can define default values in the SapHRPlugIn.config file. The ERP Connector can also export additional data in the XML file to update organization structure and map resources for RBS data in Project Server. The additional organization data includes the following:

  • Organization unit ID for the RBS

  • Short name and long name of the organization unit

  • Type of organization

  • Organization level

  • Parent organization ID

Resource mapping data in the XML file includes the following:

  • Employee ID

  • Organization unit ID

  • Manager flag (MgrOfOrgUnit)

XML Request Syntax

An XML request file for the SapHRPlugIn component has the following syntax:

<Request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="SapHrPlugIn.xsd">
   <ProcessHRDataSAP>
      <HumanResources>
         <Resources>
            <FIRSTNAME/>
            <LAST_NAME/>
            <PERNO/>
            <EMAIL/>
            <AMOUNT_MONTH/>
            <AMOUNT_HOUR/>
            <WAERS/>
            <OVERTIME_RATE/>
            <BIRTHDATE/>
            <INFOTYPE/>
            <OBJECT_ID/>
            <TO_DATE/>
            <FROM_DATE/>
            <SEQNO/>
            <CH_ON/>
            <CHANGED_BY/>
         </Resources>
         <!-- Additional resources -->
      </HumanResources>
      <OrganisationStructure>
         <OrganisationUnit>
            <ORGUNIT/>
            <ORG_SHORT/>
            <ORG_LONG/>
            <OTYPE/>
            <PARENT/>
            <LEVEL/>
         </OrganisationUnit>
         <!-- Additional organization units -->
      </OrganisationStructure>
      <ResourceMapping>
         <Mapping>
            <PERNO/>
            <ORG_UNIT/>
            <LEAD_POS/>
         </Mapping>
         <!-- Additional resource mappings -->
      </ResourceMapping>
   </ProcessHRDataSAP>
</Request>

Request Parameters

Table 1 describes the parameters for each of the three sections of the ProcessHRDataSAP method: HumanResources, OrganisationStructure, and ResourceMapping. If the tag occurrence includes 0, it is an optional parameter. An occurrence of n means unbounded.

Table 1. Parameters for the three sections of ProcessHRDataSAP

Tag

Description

Type / format

Occurrence

(HumanResources section)

HumanResources

Parent element for Resources. Contains a list of human resources from mySAP ERP HCM.

1

Resources

Contains details for one resource.

0 - n

PERNO

Unique ID of the resource from mySAP ERP.

Text

1

LAST_NAME

Last name of the resource.

Text

1

FIRSTNAME

First name of the resource.

Text

1

EMAIL

E-mail address of the resource.

Text

0 - 1

OVERTIME_RATE

Cost of the resource per hour when working overtime. The value should be a number with a decimal point, for example 80.00.

Text

0 - 1

AMOUNT_MONTH

Cost of the resource per month. The value should be a number with a decimal point, for example 9600.00.

Text

0 - 1

AMOUNT_HOUR

Cost of the resource per hour. The value should be a number with a decimal point, for example 60.00.

Text

0 - 1

WAERS

Currency in which the resource is paid; for example, USD (U.S. dollar), EUR (euro), or yen.

Text

0 - 1

BIRTHDATE

Resource's date of birth.

Date: YYYYMMDD

0 - 1

INFOTYPE

Type of information, for use by mySAP ERP.

Text

0 - 1

OBJECT_ID

Object ID for the resource.

Text

0 - 1

TO_DATE

Termination date of the resource.

Date: YYYYMMDD  

0 - 1

FROM_DATE

Hire date of the resource.

Date: YYYYMMDD

0 - 1

SEQNO

mySAP ERP HCR sequence number for the resource.

Text

0 - 1

CH_ON

Date when the resource data was last modified.

Date: YYYYMMDD

0 - 1

CHANGED_BY

User who modified the resource data.

Text

0 - 1

(OrganisationStructure section)

OrganisationStructure

Parent element for the organization structure. Contains the organization structure data reported from mySAP ERP HCM.

1

OrganisationUnit

Contains details about an organization unit for human resources.

Text

0 - n

ORGUNIT

Unique ID of the organization unit from mySAP ERP.

Text

1

ORG_SHORT

Short name of the organization unit.

Text

0 - 1

ORG_LONG

Long name of the organization unit.

Text

1

OTYPE

Type of the organization unit.

Text

0 - 1

PARENT

ID of the parent organization unit.

Text

0 - 1

LEVEL

Level of the organization unit.

Text

0 - 1

(ResourceMapping section)

ResourceMapping

Parent element for a collection of Mapping elements. Contains mappings between human resources and the organization structure.

1

Mapping

Contains the mapping between a resource and an organization unit.

Text

0 - n

PERNO

Unique ID of the resource from mySAP ERP.

Text

1

ORG_UNIT

Unique ID of the organization unit to which the resource belongs.

Text

1

LEAD_POS

Flag that indicates whether the resource is a manager. If not empty, the flag is set to true.

Text

1

Enterprise Custom Field Mappings

Table 2 shows the relationships between mySAP ERP HCM input data and properties in the Project Server Interface (PSI) ResourceDataSet and enterprise custom fields for updates to Project Server.

Table 2. Mappings of input data to properties in the ResourceDataSet

Tag

ResourceDataSet property

The fields under Resources and Mapping are for mapping resources.

(Resources element)

FIRSTNAME

ResourceDataSet.ResourcesRow.RES_NAME, ResourceDataSet.ResourcesRow.WRES_ACCOUNT

LAST_NAME

ResourceDataSet.ResourcesRow.RES_NAME, ResourceDataSet.ResourcesRow.WRES_ACCOUNT

PERNO

Resource enterprise custom field: SAP Resource ID

EMAIL

ResourceDataSet.ResourcesRow.WRES_EMAIL

AMOUNT_HOUR

ResourceDataSet.ResourceRatesRow.RES_STD_RATE

OVERTIME_RATE

ResourceDataSet.ResourceRatesRow.RES_OVT_RATE

(Mapping element)

LEAD_POS

Resource enterprise custom field: SAP Manager Flag

ORG_UNIT

Resource enterprise custom field: SAP Organisation Unit ID is mapped to the SAP Organisation Units lookup table.

The fields under OrganisationUnit are for mapping the SAP Organisation Units lookup table with the SAP Organisation Unit ID enterprise custom field.

(OrganisationUnit element)

ORGUNIT

Lookup table value for SAP Organisation Units

ORG_LONG

Lookup table description for SAP Organisation Units

Processing a Request

The SapHRPlugIn creates a Resources container before processing the data provided by the request. The local Resources container is set as the synchronization master to override any resource properties received from Project Server. The master synchronization mode and the subordinate (slave) synchronization mode are set to master only, so resources received from the server are removed.

However, the plug-in does not actually remove resources; it only disables them. If configuration settings in the SapHRPlugIn.config file do not permit the plug-in to deactivate resources, then it performs no action on the resources.

Processing starts with iteration over all Resources elements to retrieve all resource properties in the XML request. For each Resources element, SapHRPlugIn adds a new resource entity to the Resources container.

The plug-in then iterates over the OrganisationUnit elements and fills the SAP Organization Units lookup table with values. Finally, the plug-in iterates over the Mapping elements to assign the SAP Organisation Units custom field to each created resource and also to retrieve the status of the manager flag of each resource.

After the SapHRPlugIn processes all Resources, OrganisationUnit, and Mapping elements in the request, the plug-in synchronizes the Resources container with Project Server. Synchronization creates new resources and updates existing resources on the server. Updates include changing resource properties, disabling resources, and enabling resources.

Committing Resources

At the start of synchronization, the Resources container retrieves all resources available on Project Server, and then determines which resources must be updated and which resources must be created. The Resources container next populates the delta DataSet from the resource data, and then commits the delta DataSet to Project Server. Committing resources means creating and updating on Project Server all resources from the local Resources container.

See Also

Concepts

ERP Connector Architecture

Configuring the ERP Connector

Core Components of the ERP Connector

Plug-in: Finance Integration on a Project and WBS Level

Plug-in: Finance Integration with Work Actuals