Email Payslips as PDF to Employees Program
Short answer: 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.
- Estimated effort
- M · 5–8 working days
- System
- ECC and S/4HANA
- Tables
- 5
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
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.
Who uses it? Payroll teams and HR departments that want to stop distributing printed payslips.
Closest standard alternatives
- PC00_M99_CEDT Remuneration Statement (International). Produces the remuneration statement as a bulk print list; no PDF per employee and no email.
- PE51 HR Form Editor. Designs the remuneration statement form; does not send it.
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| HRPY_RGDIRDirectory for Payroll Results | Employees with a valid payroll result in the period | Read | ECC + S/4 |
| PA0105HR Master Record: Infotype 0105 (Communications) | Employee's email address (subtype 0010) | Read | ECC + S/4 |
| PA0001HR Master Record: Infotype 0001 (Organizational Assignment) | Name and payroll area | Read | ECC + S/4 |
| PA0002HR Master Record: Infotype 0002 (Personal Data) | Payslip language | Read | ECC + S/4 |
| T549QPayroll Periods | Payroll period start and end dates | Read | ECC + S/4 |
BAPIs and functions used
- CONVERT_ABAPSPOOLJOB_2_PDFConvert ABAP Spool Request to PDF. Converts the employee's payslip output to PDF
- SO_DOCUMENT_SEND_API1SAPoffice: Send Document with Attachments. Sends the PDF as an email attachment
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_ABKRS | Payroll area | Range / multiple | PA0001-ABKRS | Yes | TM |
| P_PERIOD | Payroll period (YYYYPP) | Single value | HRPY_RGDIR-FPPER | Yes | 202611 |
| S_PERNR | Personnel number | Range / multiple | PA0001-PERNR | No | 00001024 |
| P_FORM | Remuneration statement form | Single value | — | Yes | TR01 |
| 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 | X |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Pers. no. | HRPY_RGDIR-PERNR |
| 2 | Name | PA0001-ENAME |
| 3 | Payroll period | HRPY_RGDIR-FPPER |
| 4 | Result seq. no. | HRPY_RGDIR-SEQNR |
| 5 | PA0105-USRID_LONG | |
| 6 | PDF pages | Calculated Number of pages of the converted spool request |
| 7 | Status | Calculated Sent, test, no email, already sent or error |
| 8 | Message | Calculated Message from the conversion or send function |
Sample result list
| Pers. no. | Name | Payroll period | Result seq. no. | PDF pages | Status | Message | |
|---|---|---|---|---|---|---|---|
| 00001024 | Deniz Aksoy | 202611 | 00042 | [email protected] | 1 | Sent | Bordro_202611_00001024.pdf sent |
| 00001187 | Mert Yalçın | 202611 | 00039 | 0 | No email | Infotype 0105 subtype 0010 not found | |
| 00001233 | Elif Karaca | 202611 | 00041 | [email protected] | 2 | Sent | Bordro_202611_00001233.pdf sent |
How does the program work?
- 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.
- 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.
- 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.
- The spool request is converted to PDF with CONVERT_ABAPSPOOLJOB_2_PDF; the file name contains the period and personnel number.
- 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.
Performance notes
For payroll areas above a thousand employees, run the program in the background as parallel jobs split by personnel number ranges. Test the capacity of the SAPconnect send queue (SOST) during installation.
Features
- Runs as a background job
- Test mode (check without posting)
- Line-by-line result and error log
- Send the result by email
- ALV list (sort, filter, subtotals)
Authorization objects
- P_ORGINRead authorization for infotypes 0001, 0002 and 0105
- P_PCLXAuthorization to read the payroll results cluster
- S_OC_SENDAuthorization 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.
Related reports
Employee Bank Details Changed Since Last Payroll Report
A custom ALV control report that lists employees whose bank details (infotype 0009) were created or changed after the last payroll run or within a …
Payroll Wage Type Period Comparison and Variance Report
A custom ALV report that compares the payroll results of one period with the previous period per employee and wage type, and lists variances above a …
Let us build this program for your system
Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.