Interface for SAP HCM personnel data
Every source system of the type “Nova HR Stage” has a staging area of its own in the Nova database. An export from SAP HCM fills it with the personnel data; the HR sync of the source system reads from it, see HR integration. If several SAP HCM sources run, each has its own staging area: personnel numbers apply per source, and a file for one source changes nothing in another.
How the export comes about in SAP HCM – as a report, a query or with an interface tool – is defined in the implementation project. Nova defines the format.
Ways into the staging area
| Way | Meant for |
|---|---|
| “Upload personnel data” in the source system | uploading by hand, for example at the introduction or for a correction |
POST /api/source-systems/<id>/stage-import | the regular, automated delivery, for example after a nightly export |
| direct pull from SAP HCM planned | Nova reads the infotypes from SAP itself, without an export file |
Every way checks the file first. The dry run shows what would change in the staging area and changes nothing. Only then does Nova take over the file. No identity changes at that point: “Personen simulieren”, “Personen importieren” and the job “Import HR users”, which read the staging area, do that.
Uploading in Nova
Administrators open the source system under “Systems” → “Source Systems” and choose “Upload personnel data”.
- Choose the file or drag it in, and say whether it contains “all persons” or “changes only”, see below.
- Nova runs the dry run straight away. It shows how many persons are new, change, stay the same or would be removed – or the errors of the file with row or entry, personnel number, column and reason.
- “Take over” writes the file into the staging area. The button is only available after a dry run without errors of the same file in the same mode.
Then continue with “Personen simulieren” or “Personen importieren”. The source system names the last upload under “Sync”. Next to “Upload personnel data” sits “Pull from SAP HCM”, marked as planned and without a function yet.
File format
A file holds one row (CSV) or one entry (JSON) per person. Example as CSV · Example as JSON
Columns
- Column names are infotype and field as SAP HCM names them:
P, the four-digit number of the infotype, a hyphen and the field name, for exampleP0002-VORNA. Letters, digits, hyphen and underscore are allowed, at most 63 characters. Custom fields carry the number of their infotype, for exampleP9001-ZZ_KOSTL. A file has at most 500 different columns; a column that appears several times counts once. P0000-PERNRis required: the personnel number, exactly one per person, without a validity period. Letters, digits, dot, hyphen and underscore are allowed, at most 64 characters.00001001and1001count as the same person; every delivery writes a personnel number the same way, with the same leading zeros.- All further columns are free. Which column flows into which field of the identity is defined by the field mapping; without a mapping of your own, these columns apply:
| Column | Field of the identity |
|---|---|
P0000-PERNR | personnel number |
P0000-STAT2 | employment status: 3 counts as active, and so does a missing column |
P0000-SYHR_A_P0000_AF_HIREDATE | hire date |
P0000-SYHR_A_P0000_AF_FIREDATE | leave date |
P0001-TEXT_P0001_ORGEH | department |
P0001-PLANS | position, called “Plant” in the field mapping |
P0001-TEXT_P0001_STELL | job description |
P0001-SYHR_A_P0001_AF_PL_CITY | location |
P0001-SYHR_A_P0001_AF_PL_BUILD | building |
P0001-SYHR_A_P0001_AF_PL_FLOOR | floor |
P0001-SYHR_A_P0001_AF_PL_ROOM1 | room |
P0001-SYHR_A_P0001_AF_P_IS_MGR | manager (X) |
P0002-VORNA | first name |
P0002-NACHN | last name |
P0002-TEXT_P0002_ANRED | salutation |
P0002-TEXT_P0002_TITEL | academic title |
P0002-VORS | name prefix |
P0105-SYHR_A_P0105_AF_EMAIL | e-mail address – through it, Nova links a person to an existing identity at the first import |
P0105-SYHR_A_P0105_AF_TEL_NR | phone |
P0105-SYHR_A_P0105_AF_CELL | mobile phone |
P0105-SYHR_A_P0105_AF_SYSUNAME | logon UID |
A date is written as MM/DD/YYYY, as the SAP export delivers it, or as YYYY-MM-DD; 12/31/9999 counts as no date.
Values and validity periods
- A value without a period is always valid.
- A value with a period is written as
[YYYYMMDD-YYYYMMDD]value; start and end are included,99991231means open-ended. Example:[20240101-99991231]IT Development. - If an attribute has several periods, every value carries its period, and the periods do not overlap. In CSV, the column appears several times in the header for this, one period per cell; empty cells do not count. In JSON, the value is a list.
- A value that starts with
[must carry a valid period. - Nova takes over empty values: at the import, an empty value clears the field of the identity it is mapped to. The source is authoritative.
- Nova removes spaces at the start and the end, also after the period. A value has at most 1,000 characters.
Which value applies is decided when Nova reads the data: the one valid on that day, otherwise the next future one – see HR integration, section “Dates and future changes”.
CSV
- Encoding UTF-8, with or without BOM; in Excel “CSV UTF-8”.
- Delimiter semicolon, comma or tab; Nova uses the one of the header row.
- The first row names the columns, every further row is a person. Values containing the delimiter, quotes or a line break are enclosed in double quotes; a quote within the value is doubled.
- Nova skips empty rows and empty columns at the end of the header row.
P0000-PERNR;P0002-VORNA;P0002-NACHN;P0105-SYHR_A_P0105_AF_EMAIL;P0000-STAT2;P0001-PLANS;P0001-PLANS
00001001;Max;Mustermann;max.mustermann@example.com;3;[20200101-20261231]50000042;[20270101-99991231]50000043
00001002;Erika;Musterfrau;erika.musterfrau@example.com;3;[20180601-99991231]50000010;JSON
- Encoding UTF-8. The file is an object with the list
persons– Nova leaves further keys aside – or the list itself. - Every person is an object of column name and value. Values are text, whole numbers,
nullfor empty or a list of these for several periods. Nova takes whole numbers over as text; personnel numbers belong in quotes, otherwise leading zeros are lost.
{
"persons": [
{
"P0000-PERNR": "00001001",
"P0002-VORNA": "Max",
"P0002-NACHN": "Mustermann",
"P0105-SYHR_A_P0105_AF_EMAIL": "max.mustermann@example.com",
"P0000-STAT2": "3",
"P0001-PLANS": ["[20200101-20261231]50000042", "[20270101-99991231]50000043"]
}
]
}Complete stock or changes only
- Complete stock (
mode=full, default): the file holds all persons of the source. Whoever it no longer holds, Nova removes from the staging area. - Changes only (
mode=delta): the file holds new and changed persons; all others stay as they are.
In both cases, every person of the file replaces their previous entry, and Nova does not accept a file without persons. Whoever is missing from the staging area counts as no longer in the source at the next sync; by default, the import does not change their identity. Nova recognises leavers by the employment status, see HR integration.
Errors
Nova checks the whole file before it writes anything. If it contains an error, Nova takes over nothing, not even the rows without errors: half a complete stock would otherwise look as if all other persons had left the source.
Every error says where it is – the row of the CSV file (the header is row 1) or the entry of the JSON list (counted from 1) –, the personnel number and the column, plus the reason as text and as a fixed code:
| Code | Meaning |
|---|---|
file_encoding | the file is not UTF-8 encoded |
file_empty, no_persons | the file is empty or holds no person |
csv_invalid, json_invalid, json_shape | the file is no readable CSV or JSON of the form described |
column_invalid | a column name does not follow the pattern infotype and field |
columns_too_many | the file has more than 500 different columns |
key_column_missing, key_repeated_column | the column P0000-PERNR is missing or appears several times in the header |
row_width | a row has more or fewer values than the header has columns |
row_not_object, value_type, column_repeated | a JSON entry is no object, a value has another type, a key appears twice in the entry |
pernr_missing, pernr_invalid, pernr_duplicate, key_repeated | the personnel number is missing, invalid, appears twice or is more than one value |
period_invalid, period_order | a validity period is written wrongly or ends before it begins |
period_missing, period_overlap | several values of one attribute without a period or with overlapping periods |
value_too_long | a value is longer than 1,000 characters |
The response names the first 200 errors and counts all of them. A file may be at most 50 MB.
Automated through the API
POST /api/source-systems/<id>/stage-import takes the file as the field file of a form (multipart/form-data) or directly as the body of the request with Content-Type: text/csv or application/json. The interface belongs to the administration and requires a signed-in identity with administrator rights.
| Parameter | Values |
|---|---|
dry_run | true (default): check only. false: take over |
mode | full (default) or delta, see above |
format | csv or json; only needed when neither the file name nor the Content-Type names the format |
The parameters go into the address (?dry_run=false&mode=delta) or into form fields. Without dry_run=false, Nova takes over nothing.
The response is JSON:
| Field | Content |
|---|---|
ok | true when the file has no errors |
dry_run, applied | whether it was a dry run and whether Nova took the file over |
rows, persons | rows or entries read, and valid persons |
counts | new, changed, unchanged, removed – persons who are new, change, stay the same or drop out |
changes | the personnel numbers for new, changed and removed, up to 50 each |
errors, error_count | the errors with row, pernr, column, code and message, and their number |
Nova answers a file without errors with status 200. If it contains errors, the dry run answers with 200 and ok: false as well, the takeover with 422, writing nothing. Nova refuses a file that is too large with 413, and a body sent as application/x-www-form-urlencoded with 415 – which is what curl --data-binary sends without a Content-Type of its own.
GET /api/source-systems/<id>/stage says how many persons the staging area holds (persons), when a person in it was last written as new or changed (updated_at) and what the last upload delivered (last_import, with its time and the numbers from counts).
Log
Nova records every takeover in the audit log, with format, mode, file name and the numbers from counts. A refused takeover appears there too, with the number of errors and their first codes – so an automation that fails repeatedly stands out. Nova does not log dry runs.
Deleting the source system also deletes its staging area.