Large SAP landscapes run 40-50+ systems — ECC, S/4HANA, BW, SRM, GRC, Solution Manager, regional instances. The same employee gets a different user ID in each one (SMITHJ, J.SMITH, JSMITH01, 00456789). Nothing connects them, which quietly inflates FUE license counts, leaves orphaned accounts after offboarding, breaks User Access Reviews, and hides cross-system SoD conflicts.
The trap most cleanups fall into: matching on names alone. Names are the weakest identity signal you have. This prompt links user IDs on every signal SAP stores — email, person number, and name at once — and labels each match with the strongest signal behind it, so you know which to act on and which to review.
It's free. No form, no login. Copy it and run it against your exported user data.
What you'll need
| Table | What it gives you |
|---|---|
USR02 | User list: User ID (BNAME), client (MANDT), user type (USTYP) |
USR21 | Links BNAME to the person (PERSNUMBER) |
USER_ADDR | Person name (full name source) |
ADR6 | Email (SMTP_ADDR), the strongest cross-system identity key |
Pull these from every system, tag each row with the system SID and client, and union them into a single CSV with columns: Full name, User Name, System, Client, Email, Person Number, User Type.
The prompt
Copy this verbatim into your LLM of choice, then attach the CSV described above.
Identify cases where the same person holds different User Name (BNAME) values,
across one or many SAP systems/clients. The same User Name repeated across
systems is OK and is not a duplicate by itself. Two user IDs belong to the same
person if they are linked by ANY shared identity signal — email, person number,
or normalized name — not by name alone and not by one signal suppressing another.
Use these source columns:
- Full name (person name)
- User Name (BNAME)
- System (SID)
- Client (MANDT)
- Email (user email from USR21 -> ADR6, matched on PERSNUMBER +
ADDRNUMBER, primary address only. Customer/vendor emails that
also live in ADR6 are out of scope and must not be attached.)
- Person Number (USR21.PERSNUMBER — assigned per system)
- User Type (USR02.USTYP)
Logic:
1. Clean inputs:
- Normalize Full name:
- Convert to uppercase
- Remove titles (Mr., Mrs., Ms., Miss, Dr.)
- Fold accents to plain letters (JOSÉ -> JOSE)
- If the name contains a comma, treat it as "Last, First" and reorder to
First Last before splitting
- Remove punctuation, special characters, digits, underscores, extra spaces
- Split the cleaned name into words
- Normalize Email: lowercase and trim. Treat blank, or any value without "@",
as missing.
- Normalize Person Number: trim. Treat blank or all-zeros as missing.
2. Derive:
- First Name Normalized = first word of cleaned Full name
- Last Name Normalized = last word of cleaned Full name
- Name Key First Last = First Name Normalized + space + Last Name Normalized
3. Exclude records where:
- Full name, Email, and Person Number are ALL missing (nothing to match on)
- User Type is a non-person account: USTYP in B (System), C (Communication),
S (Service), L (Reference). Keep only A (Dialog) and any custom
dialog-equivalent types the landscape defines.
- Full name equals User Name AND Email is missing AND Person Number is missing
(a bare account ID with no stronger signal)
- For the name signal only: cleaned Full name has fewer than two tokens.
Records that still carry an Email or Person Number remain eligible for the
email / person-number signals.
4. Link identities — build groups from THREE independent signals, then merge any
groups that share a user (connected components). A user ID is linked to
another when they share:
- the same normalized Email, OR
- the same System + Client + Person Number, OR
- the same Name Key First Last.
Every user ID that ends up in the same connected group is treated as the same
person. No signal is a "fallback" — all three are evaluated for every record.
5. Assign Match Basis PER USER ID = the strongest signal that actually links that
user to at least one other user in its group, ranked:
Email (highest) > Person Number > Name (lowest).
- Email : linked to another ID by a shared user email — high confidence.
- Person Number : linked by a shared per-system person number — high confidence.
- Name : linked ONLY by a shared name key (person numbers differ or are
absent) — LOW confidence, must be reviewed by a human before any action,
because two different real people can share a name.
6. Keep only groups that contain more than one distinct User Name.
Output one row per group + User Name combination.
Required output columns, in this exact order:
- Person Key
- Match Basis
- Name Key First Last
- First Name Normalized
- Last Name Normalized
- Email
- User Name
- Rows For User ID
- Systems
Column definitions:
- Person Key: readable identifier of the group — the shared email if the group is
email-linked, else System|Client|PersonNumber if person-number-linked, else the
Name Key First Last
- Match Basis: Email, Person Number, or Name — the strongest signal linking THIS
user to its group, and therefore its confidence (see step 5)
- Name Key First Last: normalized first + last name key
- First Name Normalized: first token from cleaned Full name
- Last Name Normalized: last token from cleaned Full name
- Email: normalized user email for that User Name, blank if none
- User Name: distinct user ID (BNAME)
- Rows For User ID: number of source rows for that group and User Name combination
- Systems: comma-separated list of distinct System values for that group and
User Name combination
Sort the output by:
1. Match Basis (Email, then Person Number, then Name)
2. Person Key ascending
3. User Name ascending
Important:
- Do not create summary tabs, charts, pivots, or extra sheets.
- Do not include same-user-ID-only duplicates unless the same person has multiple
distinct User Name values.
- Match Basis = Name rows are the review bucket: lower confidence, human check
before any deprovisioning or license action.
- Email must be the user's own address (USR21 -> ADR6 on PERSNUMBER + ADDRNUMBER),
never a customer or vendor email that happens to share the ADR6 table.
- Save the final file as Distinct_User_IDs_By_Name.xlsx.
Why confidence matters
This prompt links user IDs by three signals at once — email, person number, and name — and labels every match with the signal that made it. Email and person-number matches are high-confidence and safe to act on. Name-only matches are the review bucket: two real people can share a name, so a human checks those before any license or access action. One caveat baked in: the email must be the user's own address (USR21 -> ADR6 on person number + address number), never a customer or vendor email that happens to share the ADR6 table.
Beyond a one-time snapshot
This prompt is a one-time snapshot from an exported CSV. SyntaAI does it live and continuously across your entire SAP landscape — plus role build, user admin, FUE optimization, UAR, audit, threat detection, vulnerability scanning, and SoD.
Want the SQL to pull this straight from USR02 / USR21 / USER_ADDR / ADR6?
Optional. The prompt above is fully readable and copyable whether or not you use this.