# Email Payslips as PDF to Employees Program

> A custom program that, after the payroll period is closed, turns each employee's standard remuneration statement (payslip) into a personal PDF and sends it to the email address in infotype 0105. The send result is logged per employee, and resending for the same period is controlled.

- Type: Program, Custom development, Form
- Module: HCM
- Estimated effort: M (5–8 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/email-payslip-as-pdf-program/


## Why is the standard not enough?

PC00_M99_CEDT produces the remuneration statement as one print list for all employees; it does not create a separate PDF per employee or send it by email. Companies without a self-service portal print and hand out payslips or split and send them by hand, which takes time and risks sending a payslip to the wrong person.

### Closest standard alternatives

- PC00_M99_CEDT: Produces the remuneration statement as a bulk print list; no PDF per employee and no email.
- PE51: Designs the remuneration statement form; does not send it.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| HRPY_RGDIR | Employees with a valid payroll result in the period | Read | - | ECC + S/4 |
| PA0105 | Employee's email address (subtype 0010) | Read | PA0105-PERNR = HRPY_RGDIR-PERNR AND PA0105-SUBTY = '0010' | ECC + S/4 |
| PA0001 | Name and payroll area | Read | PA0001-PERNR = HRPY_RGDIR-PERNR | ECC + S/4 |
| PA0002 | Payslip language | Read | PA0002-PERNR = HRPY_RGDIR-PERNR | ECC + S/4 |
| T549Q | Payroll period start and end dates | Read | T549Q-PABRJ = LEFT(HRPY_RGDIR-FPPER, 4) AND T549Q-PABRP = RIGHT(HRPY_RGDIR-FPPER, 2) | ECC + S/4 |

## BAPIs and functions used

- CONVERT_ABAPSPOOLJOB_2_PDF: Converts the employee's payslip output to PDF
- SO_DOCUMENT_SEND_API1: Sends the PDF as an email attachment

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_ABKRS | Payroll area | Range / multiple | PA0001-ABKRS | Yes |
| P_PERIOD | Payroll period (YYYYPP) | Single value | HRPY_RGDIR-FPPER | Yes |
| S_PERNR | Personnel number | Range / multiple | PA0001-PERNR | No |
| P_FORM | Remuneration statement form | Single value | - | Yes |
| P_OFFCY | Include off-cycle results | Checkbox | - | No |
| P_RESEND | Resend to employees already sent | Checkbox | - | No |
| P_TEST | Test mode (create PDFs, do not send) | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Pers. no. | HRPY_RGDIR-PERNR |
| Name | PA0001-ENAME |
| Payroll period | HRPY_RGDIR-FPPER |
| Result seq. no. | HRPY_RGDIR-SEQNR |
| Email | PA0105-USRID_LONG |
| PDF pages | Calculated: Number of pages of the converted spool request |
| Status | Calculated: Sent, test, no email, already sent or error |
| Message | Calculated: Message from the conversion or send function |

## How does the program work?

1. For the selected payroll area and period, employees with a valid payroll result are found in HRPY_RGDIR; period dates come from T549Q. Off-cycle results can be included optionally.
2. For each employee the valid email address in PA0105 subtype 0010 is read; without an address the employee is flagged 'no email' and skipped. The language comes from PA0002-SPRSL.
3. The standard remuneration statement program runs in the background for the single employee with the selected form; the output is written to a spool request.
4. The spool request is converted to PDF with CONVERT_ABAPSPOOLJOB_2_PDF; the file name contains the period and personnel number.
5. The PDF is sent as an attachment to the employee's email address with SO_DOCUMENT_SEND_API1. The send result (sent, no email, error) is logged per employee; employees already sent for the same period are skipped unless 'resend' is selected.

## Authorization objects

- P_ORGIN: Read authorization for infotypes 0001, 0002 and 0105
- P_PCLX: Authorization to read the payroll results cluster
- S_OC_SEND: Authorization to send external email through SAPconnect

## Frequently asked questions

### Can the PDFs be password-protected?

The standard ABAP PDF conversion does not encrypt. If Adobe Document Services or an email gateway with encryption is available in the landscape it can be used; the option is assessed for the system landscape during installation.

### Does the remuneration statement form change?

No. The program uses the company's existing remuneration statement form (PE51 or HR Forms) as it is; it only splits the output per employee and sends it.

### How do I track whether an email was delivered?

The program logs the send result for each employee; the status in the SAPconnect queue can be monitored in SOST. For emails that failed, the program can be run again with the resend option.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=hcm-payslip-pdf-email
