5.2 Using the Schema Metadata File

The driver includes two default Metadata files: HRMD_A03.meta and HRMD_A05.meta. These files contain the SAP metaschema definitions of the HRMD_A03 IDoc type, which is the standard HR Master Data IDoc for version 4.5B of SAP R/3; and the HRMD_A05 IDoc type, which is the standard HR Master Data IDoc for version 4.6C.

These files are provided for two distinct purposes:

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, whether the Master HR IDoc configuration parameter specifies the type or the driver selects a default type based on the version of the SAP Application server. Because only two maps are provided with the driver, you might need to create a new map for the IDoc type needed by the driver. There are two options for doing this:

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

  • You can execute the metamap.exe Schema Map Generation Utility. See Section 5.2.4, Using the Schema Map Generation Utility for more information.

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 should also not remove 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 Section 1.6.3, 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.

5.2.4 Using the Schema Map Generation Utility

The driver comes packaged with various schema maps of the HRMD_A IDoc file. These maps are generated using a Win32 executable schema map generation utility program called metamap.exe.

The schema map generation utility is installed in the Novell\NDS\DirXMLUtilities\sap\SAPutils directory on the Metadirectory server or Remote Loader server. It contains the following files:

  • Metamap.exe

  • SAPRFC.INI

  • HRMD_A03.meta and HRMD_A05.meta

  • Logon.txt

  • Readme.txt

The metamap.exe utility generates a schema file by using the SAP RFCSDK and then parses the default schema file into a schema map. The schema map file is named after the IDoc type specified and contains a .meta filename extension (for example, HRMD_A03.meta).

The metamap.exe utility is available as a Win32 program only and requires SAP GUI to be installed on the workstation. Only IDocs defined by SAP can be mapped with this utility. Custom IDocs can only be mapped manually by using the base .meta file.

The saprfc.ini file must be in the same directory as the metamap.exe utility. The file includes the following parameters:

DEST=BIN_METAMAP
TYPE=A
ASHOST=hostname
SYSNR=00
RFC_TRACE=0

You should only modify the ASHOST and SYSNR parameters. ASHOST must contain the DNS name or IP address of the SAP host. SYSNR must contain the system number of the SAP server.

The logon.txt file must also be in the same directory as the metamap.exe utility. The file contains the following lines that you should modify as noted:

  • BIN_METAMAP: Do not change this line.

  • clientnumber: Replace with the client number on the SAP server.

  • username: Replace with the user name on the SAP server.

  • userpassword: Replace with the user password on the SAP server.