HCM Program Custom development Form

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.

TableRoleAccessSystem
HRPY_RGDIRDirectory for Payroll ResultsEmployees with a valid payroll result in the periodReadECC + S/4
PA0105HR Master Record: Infotype 0105 (Communications)Employee's email address (subtype 0010)ReadECC + S/4
PA0001HR Master Record: Infotype 0001 (Organizational Assignment)Name and payroll areaReadECC + S/4
PA0002HR Master Record: Infotype 0002 (Personal Data)Payslip languageReadECC + S/4
T549QPayroll PeriodsPayroll period start and end datesReadECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
S_ABKRSPayroll areaRange / multiplePA0001-ABKRSYesTM
P_PERIODPayroll period (YYYYPP)Single valueHRPY_RGDIR-FPPERYes202611
S_PERNRPersonnel numberRange / multiplePA0001-PERNRNo00001024
P_FORMRemuneration statement formSingle value—YesTR01
P_OFFCYInclude off-cycle resultsCheckbox—No—
P_RESENDResend to employees already sentCheckbox—No—
P_TESTTest mode (create PDFs, do not send)Checkbox—NoX

Result list columns

#ColumnSource
1Pers. no.HRPY_RGDIR-PERNR
2NamePA0001-ENAME
3Payroll periodHRPY_RGDIR-FPPER
4Result seq. no.HRPY_RGDIR-SEQNR
5EmailPA0105-USRID_LONG
6PDF pagesCalculated Number of pages of the converted spool request
7StatusCalculated Sent, test, no email, already sent or error
8MessageCalculated Message from the conversion or send function

Sample result list

Pers. no.NamePayroll periodResult seq. no.EmailPDF pagesStatusMessage
00001024Deniz Aksoy20261100042[email protected]1SentBordro_202611_00001024.pdf sent
00001187Mert Yalçın202611000390No emailInfotype 0105 subtype 0010 not found
00001233Elif Karaca20261100041[email protected]2SentBordro_202611_00001233.pdf sent
A view built with fictional sample data; not real system data.

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.

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

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.

Related report: Email Payslips as PDF to Employees Program