# Mass Absence and Attendance Upload Program

> A custom program that posts absence (infotype 2001) and attendance (infotype 2002) records coming from time clocks, shift planning tools or Excel into SAP in bulk before time evaluation. It checks the absence type, overlaps and quota sufficiency, and runs in test mode first.

- Type: Program, Custom development, Mass upload
- Module: HCM
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-absence-and-attendance-upload-program/


## Why is the standard not enough?

PA30 and PA61 enter absences and attendances per employee; PA71 fast entry works on screen. The CATS transfer only moves data recorded in time sheets and does not cover the file layout of every external device or shift tool. Keying hundreds of records manually at month-end delays time evaluation and payroll.

### Closest standard alternatives

- PA61: Maintains time data per employee; does not post in bulk from a file.
- PA30: Enters infotypes 2001 and 2002 for one employee.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| PA2001 | Absence records: absence type, date, time, duration | Write | - | ECC + S/4 |
| PA2002 | Attendance records: attendance type, date, time, duration | Write | - | ECC + S/4 |
| PA2006 | Remaining entitlement for the quota check | Read | PA2006-PERNR = PA2001-PERNR | ECC + S/4 |
| T554S | Validity of absence and attendance types | Read | T554S-SUBTY = PA2001-AWART | ECC + S/4 |
| PA0001 | Check of the active assignment on the record date | Read | PA0001-PERNR = PA2001-PERNR | ECC + S/4 |

## BAPIs and functions used

- BAPI_EMPLOYEE_ENQUEUE: Locks the employee before posting
- BAPI_ABSENCE_CREATE: Creates the infotype 2001 absence record
- HR_INFOTYPE_OPERATION: Creates the infotype 2002 attendance record
- BAPI_EMPLOYEE_DEQUEUE: Releases the lock after posting

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | - | Yes |
| P_TEST | Test mode (check without posting) | Checkbox | - | No |
| P_QUOTA | Check quota sufficiency | Checkbox | - | No |
| P_SKIPOV | Skip overlapping records (do not replace) | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Record type | 2001 = absence, 2002 = attendance | No |
| Pers. no. | PA2001-PERNR | Yes |
| Abs./att. type | PA2001-AWART | Yes |
| Start date | PA2001-BEGDA | Yes |
| End date | PA2001-ENDDA | Yes |
| Start time | PA2002-BEGUZ | No |
| End time | PA2002-ENDUZ | No |
| Hours | PA2002-STDAZ | No |

## Result list columns

| Column | Source |
|---|---|
| Row | Calculated: Row number in the file |
| Pers. no. | PA2001-PERNR |
| Abs./att. type | PA2001-AWART |
| Status | Calculated: From the checks and posting: posted, test OK or error |
| Message | Calculated: Check error or BAPI return message |

## How does the program work?

1. The file (XLSX or CSV) is read; each row holds the record type (2001 absence or 2002 attendance), employee, absence/attendance type, date and an optional time range.
2. Checks: is the employee active on the record date (PA0001), is the absence/attendance type defined for the employee's personnel subarea grouping (T554S), is there an overlapping record on the same date (PA2001/PA2002).
3. With "Quota check" selected, for absence types that deduct a quota, it is checked whether the remaining entitlement in PA2006 (ANZHL − KVERB) covers the requested duration.
4. The employee is locked with BAPI_EMPLOYEE_ENQUEUE; absences are created with BAPI_ABSENCE_CREATE, attendances with HR_INFOTYPE_OPERATION; the lock is released with BAPI_EMPLOYEE_DEQUEUE. In test mode nothing is posted; only the check and simulation results are shown.
5. Results are listed per row; failed rows are downloaded as a separate file. After a successful upload, time evaluation (PT60) can be run for the employees concerned.

## Authorization objects

- P_ORGIN: Write authorization for personnel data, infotypes 2001 and 2002
- P_PERNR: Check that prevents users from posting to their own personnel number

## Frequently asked questions

### Which external systems are supported?

The template is a fixed-column XLSX or CSV. The file layout of another device or shift tool is mapped to the template with a mapping layer during installation; each new layout adds a small effort.

### What happens if there is an overlapping absence?

By default, the overlapping row is skipped and listed with a message. Optionally, an option to delimit or replace the existing record according to the collision class can be added.

### Does time evaluation run automatically after the upload?

Not by default; PT60 is run separately for the employees in the result list. If needed, the program can schedule time evaluation as a background job for those employees at the end.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=hcm-absence-attendance-upload
