Data Privacy: Blocking and Destruction

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

An HR system holds some of the most personal data a company has: addresses, bank accounts, pay, absences. Data protection laws, such as the European General Data Protection Regulation (GDPR), say that such data may be kept only as long as there is a reason for it. SAP HR answers in two steps. First it can block the data of a person who has left, so that almost nobody can read it any more but it still exists. Later it can destroy the data for good, once the retention period (the time the company must or may keep it) has passed and nothing, such as a lawsuit, requires keeping it. After reading this page you can explain the difference between blocking, archiving and destroying, name the switches, reports and transactions that do each, and follow one employee from leaving the company to destruction. It is written against SAP S/4HANA 2025 FPS02 on premise and Private Edition, where the HR functions come from SAP HCM for SAP S/4HANA (H4S4), a separately licensed component. SAP S/4HANA Cloud Public Edition and SAP SuccessFactors have their own data protection tools and are not covered here. This page is not legal advice: SAP’s documentation itself says the company is responsible for the rules it defines and for obeying the law.

All employees, dates and rules in the examples are made up for this site. They are not values delivered by SAP.

Before you read

  • HR and Payroll Basics: what an employee file, a personnel number and a payroll run are, in plain words.

  • Infotypes: the records of an employee file, such as Actions (0000), Organizational Assignment (0001) and Basic Pay (0008).

  • Users, Roles and Authorizations: how SAP decides what a user may see, because blocking works through that decision.

Key terms

  • Data privacy: the rules and tools that limit who may see personal data and for how long it may be kept.

  • Blocking: taking away access to data that is no longer needed for its purpose, without deleting it.

  • Authorization main switch: a system switch (such as AUTSW BLOCK) that turns an HR authorization check on or off.

  • Information Lifecycle Management (ILM): the SAP component that manages how long data is kept and when it is destroyed.

  • Retention rule: a rule that says how long data of a kind must be kept, counted from a start date.

  • Destruction object: a bundle of related data, such as a personnel number, that can be destroyed in one run.

  • Destruction lock: a record, also called a legal hold, that stops data from being destroyed although its retention period has ended.

  • Archiving: moving data that is no longer needed day to day out of the database into an archive, to save space.

Three words that are not the same

SAP’s documentation separates three things that people often mix up. A shelf of paper files is a good picture.

  • Delete removes data that is wrong or no longer needed, usually inside a running business process.

  • Archive moves finished data out of the operational system into an archive system. The reason is cost and database size. The data still exists and may be read from the archive until its retention period ends.

  • Destroy removes data that has reached the end of its retention period and may no longer be kept for legal reasons. It is removed from the operational system and from the archive system. The reason is data privacy, and the documentation states that destruction cannot be reversed once the delete phase has run.

Blocking sits before all three. It deletes nothing. It only changes who may read the data. A person who left a year ago is a good example: payroll is finished, the business purpose is over, but a tax audit might still need the records, so the company cannot destroy them yet. Blocking lets only a few users see them until the legal period ends.

flowchart TD A[Employee is active] --> B[Employee leaves, process complete] B --> C{Residence period over?} C -- no --> B C -- yes --> D[Block: only users with P_BLOCK may read] D --> E{Retention over and no destruction lock?} E -- no --> D E -- yes --> F[Preprocessing run, optional approval] F --> G[Destruction run] G --> H[Personnel number and data destroyed] H --> I[No new data may be created for the destroyed period]

The diagram is a reading aid drawn for this page from the SAP help topics listed under References, not a figure from SAP. The "residence period" in the diagram is the time the data stays readable after the leaving date. Its length is the company’s own rule, set in ILM.

Part 1: Blocking

Why block before destroying

Access to HR data is normally controlled by two checks: the general authorization check, based on authorization objects such as P_ORGIN (HR: Master Data), and the structural authorization check, based on authorization profiles of the organization. Both answer the question "may this user read this employee’s data?" for active staff. Neither says "this employee left long ago, so nobody should look at the file any more". Blocking adds that.

SAP’s documentation describes blocking at two levels of detail.

  • Block a personnel number. All data of an employee who left, for example, more than a year ago is blocked, and only specific users may still reach it.

  • Block data in the past (time-dependent authorization). Even for active employees, infotype data older than a given age (the documentation gives five years as an example) may not be needed any more, so access to old records can be limited by time.

Blocking personnel numbers

The documentation gives this example: a German company wants to block employee data a year after an employee leaves, and only users with special authorization for the country grouping (MOLGA) Germany may still read the blocked data. The pieces are these.

Piece What it does

Authorization main switch AUTSW BLOCK (HR: Authorization Switch Blocking)

Turns the blocking check on. In the standard system it has the value 0, which means off. The value 1 activates the check. It is maintained in Customizing for Personnel Management under Personnel Administration, Tools, Authorization Management, Maintain Authorization Main Switches.

Residence rules in ILM for the ILM object HRPA_PERNR

Required. They say when an employee who left becomes blocked, that is, how long the data stays accessible after the leaving date.

BAdI HRPA_RP_PERNR_BLOCKING

Optional. A place to add company-specific checks when personnel numbers are blocked.

Veto checks of registered applications

Optional. Applications outside HR can veto the blocking of an employee’s data.

Report RP_PA_BLOCKING_PERNR (Block Personnel Numbers After Employees Have Left)

Saves the start of the blocking period for each employee. The HR authorization check later uses that date. The same report can also unblock employees.

Report RP_PA_BLOCKING_PERNR_DISPLAY (Display Block Date in Infotype 0003)

Shows whether a personnel number is blocked.

BAdI HRPAD00AUTH_BLOCK (HR: Block Personnel Numbers)

Decides which users may read blocked data. Its default implementation uses the authorization object P_BLOCK (HCM: Access to Master Records with Country/Region-Specific Blocks): only users with P_BLOCK may access the data of blocked employees.

The documentation adds a practical point: users that hold very many authorizations, such as batch users with the profile SAP_ALL, should also be granted P_BLOCK with the value * for the country grouping (MOLGA), for performance reasons. All of this is Customizing and report work that requires an SAP system; it is not run here.

Blocking in the running example

Suppose Ben Okoye (00001235), the Sales Clerk of the example, leaves Example Trading Co. on 30.06.2026 and every payroll process for him is finished. The company’s example residence rule is "one year after the leaving date". Once the leaving date plus one year has been reached (30.06.2027 in this example), running RP_PA_BLOCKING_PERNR stores the start of the blocking period for 00001235. From then on, a payroll clerk with the normal role no longer sees Ben’s infotypes. A user whose role contains P_BLOCK for Ben’s country grouping still does. The one-year period and the date are example values chosen for this page, not SAP defaults.

Time-dependent authorization

For access limited by the age of the data, SAP delivers the BAdI HRPAD00AUTH_TIME (Time Logic in the PA Authorization Check). It is not implemented in the standard system, but a sample implementation is delivered to copy and adapt. In the sample, the minimum authorization periods, in months, are kept per infotype or subtype and per country grouping in the table T77PADDUR_DEF. Different roles can get different periods: the documentation compares a shift planner, who needs one year of absence data, with an HR administrator, who needs more for parental leave entitlements. A role gets its period through the table T77PADDUR_KEY (role IDs), the table T77PADDURATION (period per role ID) and the authorization object P_DURATION (HR: Authorization Time Periods for HR Master Data). The method RESTRICT_PAYROLL_ACCESS of the same BAdI can also limit access to payroll results.

End of purpose check for business partners

An employee can also exist as a business partner, a customer or a vendor, for example when an expense claim is paid to the person as a supplier. SAP provides an End of Purpose (EoP) check in HCM that asks: is a personnel number linked to the business partner, customer or vendor, has that personnel number left the company, and has the retention period expired? Only if the answers are yes can the linked partner be blocked, and a re-hired employee’s partner can be unblocked automatically. This is described in the topic End of Purpose (EoP) Check in HCM.

Part 2: Destruction

The building blocks

  • Information Lifecycle Management (ILM) holds the retention rules. In the application IRM Policies and Rules (transaction IRMPOL) you define policies for an ILM object. For personnel numbers the ILM object is HRPA_PERNR.

  • A retention rule has a country grouping (MOLGA) as condition field, a minimum and a maximum retention period with a unit, a time base (the date from which the period is counted) and an optional time offset.

  • A destruction object or an archiving object groups related data that can be destroyed together. In HR there are archiving objects for archiving and destruction, archiving objects for destruction only, and destruction objects. With an archiving object the data is first written to a temporary archive file and then deleted. With a destruction object the temporary file is skipped and the data is deleted straight from the database.

  • A destruction lock, also called a legal hold, protects data that must be kept longer, for example because of a lawsuit. In HR it is a record in infotype 3246 (Legal Hold).

A retention rule with numbers

SAP’s own example for HRPA_PERNR is the following rule for Germany, which this page reuses with the running example.

Country grouping Minimum retention Maximum retention Unit Time base Time offset

DE

1

1

Year

Leaving Date of Employee (HCM_TERMN_DATE)

End of Year

To apply it, the system takes the time base (the leaving date), moves it by the time offset, and counts the retention period from there. With the example employee Ben, whose leaving date is 30.06.2026:

  1. Time base: leaving date 30.06.2026.

  2. Time offset End of Year: the retention period starts on 31.12.2026.

  3. Retention period of 1 year: it ends on 31.12.2027.

So Ben’s personnel number can be destroyed after 31.12.2027, if no destruction lock holds it back. The arithmetic was checked by hand. The country grouping DE, the one-year period and Ben’s leaving date are used here only as an illustration. The documentation also gives a country grouping as the only condition field of the personnel-number rule, so a company that operates in several countries defines one rule line per country grouping.

The two ways to destroy a personnel number

SAP describes two routes. Both need an SAP system and are not run here.

Route Programs and transactions Notes

Destruction object HRPA_PERNR through ILM

Preprocessing program RP_PERNR_PRE, optional approval program RP_PERNR_APPROVE (transaction HRPA_PERNR_APPROVE), destruction program RP_PERNR_DES, all started from transaction ILM_DESTRUCTION.

Destroys the personnel numbers of employees who left, after the retention period. All data that the report RPUDELPN would delete is deleted too.

Reports RPUDELPP and RPUDELPN

RPUDELPP, Destruction of Personnel Numbers in Live Systems, requests and executes. It calls RPUDELPN, Delete Personnel Numbers Completely.

In non-productive systems RPUDELPN can be run directly. The two roles, request and execute, follow the double verification principle.

Destruction with HRPA_PERNR, step by step

  1. Define the retention rule for HRPA_PERNR in IRMPOL, as in the table above.

  2. Preprocessing. In ILM_DESTRUCTION choose the category Data from the Database, give the ILM object HRPA_PERNR and choose Preprocessing. The variant of RP_PERNR_PRE needs a leaving date (it is mandatory) and may add a country grouping or one personnel number, which is meant mainly for test mode. In production mode the program generates a preprocessing ID; in test mode it does not. A description text helps to find the run later. The BAdI HRPA_RP_PERNR_PRE can exclude personnel numbers from the selection.

  3. Approval (optional). The approver opens transaction HRPA_PERNR_APPROVE, enters the ID of the preprocessing run and approves or rejects selected personnel numbers. Requester and approver must not be the same person. The step can be switched off with the ADMINWOAPP switch.

  4. Destruction run. In ILM_DESTRUCTION choose Destroy for the same ILM object. The variant of RP_PERNR_DES needs the ID of the preprocessing run. In test mode no personnel number is deleted; in production mode they are.

  5. Check the log. Detail level and output format of the log are variant settings.

Authorizations: the approver needs the object P_DEL_PERN (Destruction of Data in Live Systems) and the right to start HRPA_PERNR_APPROVE.

Destruction by archiving objects (other HR data)

For parts of an employee’s data, such as old absences or appraisal documents, SAP uses archiving objects that support ILM. The retention rules are created in Customizing for Personnel Administration under Tools, Data Privacy, Data Destruction, Define Retention Rules, for each archiving object of the audit area HCM_DP (HCM Data Privacy). The documentation’s example: for appraisal documents the administrator sets a minimum retention period of three years and the start time End of the Fiscal Year. Data records are considered only when the end date determined from that rule lies in the past.

The run is started from Archive Administration (transaction SARA) and has up to three phases.

Phase What happens

Preprocessing (optional)

Exists for archiving objects that need a destruction log or a creation block, for example payroll data. The system generates a run ID and writes, for each personnel number, a record to infotype 0283 (Archiving/Data Destruction) with the status Prepared for Data Destruction. Nothing is deleted.

Write

Creates the temporary archive file. Nothing is deleted yet.

Delete

Deletes the data from the database tables and the archive file. In infotype 0283 the status becomes Destroyed.

With a preprocessing program the delete step follows automatically after the write step. Without one, delete is started manually. Because the process is critical, the standard process is divided into two steps so that different users can own them. The destruction log, available from SARA under Management or Logs, lists archive file, session, date, time and user. After destruction the number of objects is shown as 0, because all file information is removed for data privacy reasons.

Authorization for destruction

The write and delete programs read the data through the logical database PNPCE, so the usual HR checks apply: P_ORGIN, P_ORGXX and the structural authorization check. The report authorization object P_ABAP can override the infotype authorization for these programs only. That allows an administrator to destroy HR master data without being allowed to read the same data otherwise. Because the programs refer to archiving objects, the archiving authorizations apply too, and write and delete rights can be controlled separately.

If a legal case is open, data may need to be kept although its retention period is over. A destruction lock is created for one or more personnel numbers with transaction ILM_LHM, or in HR as a record of infotype 3246. The record names the subtype (identical to the name of the archiving object, for example HRPA_PERNR), the name of the legal hold such as the lawsuit, and a free text. It is valid from the entry date of the employee to the highest system date. The documentation notes that records under a lock can still be edited, for example in PA30 (Maintain HR Master Data).

In the example: if Ben had a lawsuit about overtime pending on 31.12.2027, a lock for subtype HRPA_PERNR would stop his destruction until the lock is removed.

After destruction: no re-creating

Data privacy also means that destroyed data must not be created again. The system therefore writes a destruction date into infotype 0283 and blocks the creation, change or deletion of data of the same kind for the destroyed period. SAP’s example: after all absence data older than three years was destroyed up to 31.12.2007, no absence data for that employee can be created for that period. The block applies whichever transaction is used.

Archiving and the authorization checks

Ordinary archiving, done to save database space rather than for privacy, uses the Archive Development Kit (ADK) and Archive Administration (SARA); the same SARA transaction is the entry point for the HR destruction runs above. The documentation points out that the destruction of data in HR assumes that you know data archiving and SARA. For the ABAP statement behind authorization objects such as P_ORGIN, see Authority Checks.

What older books show, and what has changed

The book SAP ERP HCM: Technical Principles and Programming, 1st edition (2013), is still a good guide to the HR authorization objects (P_ORGIN, P_ORGXX, P_PERNR and the structural check) that this page builds on. It was written before the EU regulation applied in 2018 and its table of contents is organized around reports, logical databases and payroll programming. The blocking and destruction functions described here (the AUTSW BLOCK switch, the HRPA_PERNR destruction object, the infotypes 0283 and 3246) are part of the current HCM for SAP S/4HANA documentation and are not what the book teaches. Read the book for the authorization background, and this page and the SAP topics below for privacy.

Summary

  • Data privacy in HR has two stages: blocking (nobody but a few users may read the data of people who have left) and destruction (the data is removed for good after its retention period).

  • Blocking is off by default. It is switched on with the authorization main switch AUTSW BLOCK set to 1, driven by residence rules for the ILM object HRPA_PERNR and the report RP_PA_BLOCKING_PERNR, and it uses the authorization object P_BLOCK.

  • Archive moves data out of the database to save space. Destroy removes it from both the system and the archive and cannot be undone after the delete phase.

  • Retention rules in ILM (transaction IRMPOL) count a period from a time base such as the leaving date, plus an offset. In the example, Ben’s leaving date 30.06.2026 gives a retention period from 31.12.2026 to 31.12.2027.

  • Personnel numbers are destroyed with the HRPA_PERNR object through preprocessing, an optional approval by another person, and the destruction run, or with the reports RPUDELPP and RPUDELPN.

  • A destruction lock (infotype 3246, transaction ILM_LHM) holds back destruction for a legal case, and infotype 0283 records what was prepared and destroyed and blocks re-creating data for the destroyed period.