{"audience":"Information security and IT infrastructure teams, SAP authorization administrators, HR operations teams.","authorization_objects":[{"note":"Authorization to read employee data by personnel area, employee group and infotype","object":"P_ORGIN"},{"note":"Authorization to create, change and lock users by user group","object":"S_USER_GRP"}],"components":[],"countries":[],"effort_days_max":18,"effort_days_min":12,"effort_size":"L","faq":[{"a":"No. If an identity management product exists, it runs this flow. The program is for companies without such a product or that only want to connect SAP HCM with the directory.","q":"Is it needed when an identity management product is in place?"},{"a":"The connection depends on the company's middleware: a direct LDAP query or an integration service calling the directory API. The SAP side stays the same; only the connection layer is adapted during installation.","q":"How does it connect to the directory?"},{"a":"Yes. The user BAPIs and HCM infotypes are the same on S/4HANA. Because employees are also business partners there, business partner synchronization is left to the standard employee-to-business-partner sync.","q":"Does it work on S/4HANA?"}],"features":[{"code":"test_run","label":"Test mode (check without posting)","note":"Produces the difference list without changing anything"},{"code":"log","label":"Line-by-line result and error log","note":"Every action is logged with user, time and result"},{"code":"error_file","label":"Download failed lines as a separate file","note":"Failed records are written to an error file that can be reprocessed"},{"code":"background","label":"Runs as a background job","note":"Scheduled as a nightly delta and a weekly full comparison"},{"code":"email","label":"Send the result by email","note":"A summary of locked and created accounts is e-mailed to the security team"}],"functions":[{"name":"RH_GET_LEADER","role":"Finds the manager of an org unit"},{"name":"BAPI_USER_LOCK","role":"Locks the SAP user of a leaver"},{"name":"BAPI_USER_CHANGE","role":"Updates the user's validity date and address data"},{"name":"BAPI_USER_CREATE1","role":"Creates SAP users for new hires"},{"name":"HR_INFOTYPE_OPERATION","role":"Writes the user name and e-mail from the directory to infotype 0105"}],"gap":"SU01 and SU10 maintain users one by one or in bulk, and PA30 stores the user name and e-mail in infotype 0105; but there is no ready comparison and update tool between SAP HCM and the directory. This normally requires a separate identity management product. For companies without one, the program treats HR master data as the single source and aligns the directory and SAP users with it.","id":"hcm-employee-active-directory-sync","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-18","logic":"1. By change date (since the last run), PA0000 (action and employment status STAT2), PA0001 (org unit, position, cost centre), PA0002 (first and last name) and PA0105 (subtype 0001 SAP user, 0010 e-mail) are read.\n2. Org unit and position names come from HRP1000; the manager is found with RH_GET_LEADER (HRP1001 relationship A012 'manages').\n3. The account list from the directory is taken through middleware via an LDAP query or the directory API; the matching key is the personnel number (employee ID attribute) or the e-mail in PA0105.\n4. For every record the comparison sets an action: new account, attribute update (title, department, manager, cost centre), disable, or no action.\n5. For leavers (STAT2 = 0) the SAP user is locked with BAPI_USER_LOCK and its validity end is set to the leaving date with BAPI_USER_CHANGE; the directory account is disabled through the middleware.\n6. For new hires, an SAP user is created with BAPI_USER_CREATE1 according to the position-to-role mapping in a rule table; the user name and e-mail from the directory are written back to PA0105 with HR_INFOTYPE_OPERATION.\n7. A test run only shows the difference list. In a live run every action is logged, and failed ones go to an error file that can be reprocessed.","module":"HCM","object_type":"interface","output_columns":[{"calculated":false,"formula":"","label":"Personnel no.","source_field":"PERNR","source_table":"PA0000"},{"calculated":false,"formula":"","label":"First name","source_field":"VORNA","source_table":"PA0002"},{"calculated":false,"formula":"","label":"Last name","source_field":"NACHN","source_table":"PA0002"},{"calculated":false,"formula":"","label":"SAP user","source_field":"USRID","source_table":"PA0105"},{"calculated":false,"formula":"","label":"Org unit","source_field":"STEXT","source_table":"HRP1000"},{"calculated":true,"formula":"Logon name returned by the directory","label":"Directory account","source_field":null,"source_table":null},{"calculated":true,"formula":"Attributes that differ (title, department, manager, status)","label":"Difference","source_field":null,"source_table":null},{"calculated":true,"formula":"Create, update, disable or none","label":"Action","source_field":null,"source_table":null},{"calculated":true,"formula":"Success, error or test","label":"Result","source_field":null,"source_table":null}],"parameters":[{"example":"1000","kind":"select_option","label":"Company code","name":"S_BUKRS","ref_field":"PA0001-BUKRS","required":false},{"example":"00001024","kind":"select_option","label":"Personnel number","name":"S_PERNR","ref_field":"PA0000-PERNR","required":false},{"example":"Delta","kind":"radio","label":"Run: delta / full comparison","name":"P_MODE","ref_field":"","required":true},{"example":"X","kind":"checkbox","label":"Lock SAP users of leavers","name":"P_LOCK","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Create users for new hires","name":"P_CREATE","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Test run","name":"P_TEST","ref_field":"","required":false}],"part_of":[],"performance":"Schedule a full comparison weekly and a delta run every night. Read the PA tables by the AEDTM change date; request only the attributes needed from the directory.","quote_url":"https://nekuhub.com/en/request-a-quote/?report=hcm-employee-active-directory-sync","related":["basis-inactive-user-auto-lock-job","basis-user-master-mass-update-upload","hcm-leaver-sap-user-lock-job"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Changes or locks users in bulk; does not compare them with HR master data.","tcode":"SU10"},{"note":"User and e-mail are entered manually in infotype 0105; there is no directory synchronization.","tcode":"PA30"}],"summary":"An interface program that compares hires, leavers and organizational changes in SAP HCM with the accounts in the corporate directory (Active Directory) and updates the differences. Job title, department, manager and cost centre are pushed to the directory; leavers have their directory account and SAP user locked, and new hires get users in SAP and connected systems. Every step is tracked with a log and an error file.","tables":[{"access":"read","join_on":"","role":"Actions and employment status (driving table)","table":"PA0000","variant":"both"},{"access":"read","join_on":"PA0001-PERNR = PA0000-PERNR","role":"Org unit, position and cost centre","table":"PA0001","variant":"both"},{"access":"read","join_on":"PA0002-PERNR = PA0000-PERNR","role":"First and last name","table":"PA0002","variant":"both"},{"access":"read_write","join_on":"PA0105-PERNR = PA0000-PERNR","role":"SAP user name and e-mail (communication)","table":"PA0105","variant":"both"},{"access":"read","join_on":"HRP1000-OBJID = PA0001-ORGEH / PA0001-PLANS","role":"Org unit and position names","table":"HRP1000","variant":"both"},{"access":"read","join_on":"HRP1001-OBJID = PA0001-ORGEH AND HRP1001-SUBTY = 'A012'","role":"Manager relationship (A012)","table":"HRP1001","variant":"both"},{"access":"read_write","join_on":"USR02-BNAME = PA0105-USRID","role":"SAP user: lock and validity","table":"USR02","variant":"both"}],"title":"Employee Master Data and Active Directory Comparison and Update","url":"https://nekuhub.com/en/programs/employee-master-data-active-directory-comparison-and-update/","vendor_id":"nekudos"}