5.2 Using the Schema Metadata File

The driver includes three default Metadata files: HRMD_A03.meta, HRMD_A05.meta, and HRMD_A07.meta. These files contain the SAP metaschema definitions of the HRMD_A03, HRMD_A05, and HRMD_A07 IDoc types, where

  • HRMD_A03 IDoc type is the standard HR Master Data IDoc for version 4.5B of SAP R/3

  • HRMD_A05 IDoc type is the standard HR Master Data IDoc for version 4.6C

  • HRMD_A07 IDoc type, which is the standard HR Master Data IDoc for version 6.0.

These files are provided for two distinct purposes:

  • The driver uses a metadata file to generate an Application Schema Map policy via the Refresh Application Schema option in iManager.

  • If a Character Set Encoding value is specified in the configuration, the driver opens the metadata file to determine if the encoding value specified is valid.

The following sections provide information to help you use the Metadata files:

5.2.1 Creating a New Schema Metadata File

A schema map must exist for the IDoc type that the driver consumes, if the Master HR IDoc configuration parameter specifies the type or if the driver selects a default type based on the version of the SAP Application server. Because the driver provides only three maps, you might need to create a new map for the IDoc type needed by the driver.

You can simply copy the HRMD_A07.meta file to a new file, such as HRMD_A08.meta. This is acceptable as long as you do not need to publish newer infotypes not found in the HRMD_A08 version. It is unlikely that newer infotypes are needed.

To publish newer infotypes other than the ones included in HRMD_A07.meta file, Identity Manager provides an XML driver configuration file that converts a SAP HR schema xml file into an HRMD file that the driver can consume. To create an HRMD file,

  1. Export HRMD_A* schema from the SAP HR database.

    1. Login to SAP and go to transaction WE60, select BASIC TYPE option.

    2. Type HRMD* in the text field.

    3. Select the version you want to use (for example, HRMD_A07).

    4. Click Documentation > XML schema to display the schema in XML format.

    5. Click XML > Download to save the schema.

  2. Create a Delimited Text driver by using the SAP-HRMD driver configuration file (SAP-HRMD.xml) in Designer. For information about importing a driver configuration file, see Importing a Driver Configuration File in the NetIQ Designer for Identity Manager Administration Guide.

    The SAP-HRMD driver configuration file is present in the SAPHRUtils subdirectory of the driver shim installation directory. It is located in C:\Novell\NDS\DirXMLUtilities\sap\SAPutils on Windows and /opt/novell/eDirectory/lib/dirxml/rules/saphr on Linux.

  3. In the driver configuration (Delimited Text driver), specify the location of the schema file in the Metadata File Directory field. This is the file you exported in Step 1.

    The Delimited Text driver converts the schema file into a Metamap file that SAP HR driver can consume. It stores the file in the SAPUtils subdirectory of the driver shim installation directory as HRMD_A*.meta.TEST. Rename this file to HRMD_A*.meta.

5.2.2 Reducing the Size of the Schema Metadata File

The size of the metaschema definitions can create problems for your driver configuration. The schema refresh can take a long time to process, especially because a copy of the map is generated for each object type you choose to synchronize. Additionally, the size of the schema in the driver configuration can be extremely large and cumbersome to navigate. For these reasons, it is acceptable to reduce the number of infotypes in the metadata files.

You can edit the appropriate metadata file and remove all infotypes that are not used for your implementation. Simply search for the infotypes to remove (for examples, Infotype 0008 values can be found by searching for P0008) and deleting the SEGMENT: line and subsequent infotype field lines from the file. You should modify a copy of the original file. For most integrations, only 20-30 percent of the infotypes are actually used.

IMPORTANT:You must be careful that you do not remove infotypes that are useful for policies or other object types being synchronized. Two infotypes of this nature are Infotype 1000 (for Descriptions of non-person objects) and Infotype 1001 (Relationships between objects.) These are both used in the default driver configuration.

You must also avoid removing fields from infotypes that are used in your integration. Field removal is extremely hard to detect if a mistake is made or if you want to return to an earlier version.

5.2.3 Extending the Schema Metadata File

There are many situations where an IDoc is extended with custom infotypes or infotype fields. Because the schema map is based on standard SAP IDoc types, you must manually create these types of metadata extensions. There are several areas of concern:

  • If the infotype is an extension to the IDoc (for example, Infotype Z0001), you must ensure that the infotype header fields are present in a standard format. These standard fields start with the field PERNR and extend through field RESE2 in data infotypes. If these fields are not present or contain no data, many of the driver features such as future-dating and history-dating do not work.

  • The format of new infotypes is similar to the standard infotypes. The first field should be <5 character infotype>:PERNR:0:8. When parsing an actual IDoc, the physical offset for the PERNR field is 63 (when starting from position 0.)

You can also create schema extensions directly to the Mapping Rule without the need to update the metadata file. If you choose this option, which is often easier, remember the physical offset mentioned above when determining where your data fields of interest begin. The format for a direct mapping is described in Attribute Mapping from the SAP HR Database to the Identity Vault. Selecting field names is up to you, because the driver does not use them for processing, but they should be limited to 5 characters for consistency.