Lock Master Data for Personnel Number in ABAP for a long time

385 views Asked by At

Because of the DSGVO we need to delete personnel data but first we need to lock the personnel data (Infotypes).

Every function module I use works only while the reports is in execution, after that the personnel data is unlocked again.

  DATA: LS_RETURN TYPE BAPIRETURN1. "Return Struktur
  DATA: LV_ERROR_MESSAGE TYPE STRING. "Error Message

* Sperrung der Personalnummer
  CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
    EXPORTING
      NUMBER = GV_PERNR "Personalnummer
    IMPORTING
      RETURN = LS_RETURN.

Does somebody know a way to do it ?

Greets

1

There are 1 answers

1
Philipp On

As József Szikszai pointed out in a comment, the proper solution for this would be to install and configure Information Lifecycle Management.

But introducing ILM can be a rather large project. So if you need a "good enough" stopgap solution now, then you could solve this via permissions.

I don't have much experience with permissions in HR, but it seems to me like the permission object P_ORGIN should do the job. Simply assign those employees to a separate Personnel Area, Employee Group, Employee Subgroup or Organizational Key (depending on what fits best in your HR permission concept) and then adjust your permission roles so that nobody has the permission to edit these personnel records.

More information on permissions in the module HR can be found in this document from the documentation.