Mass Update of User Master Data from Excel
Short answer: A custom program that mass updates the first name, last name, email, department, function, user group, validity dates and default printer of users from an Excel file through the standard user BAPI. A different value can be written for each user; test mode compares current and new values, and protected user groups are never touched. Passwords and role assignments are outside the scope of the program.
- Estimated effort
- S · 3–5 working days
- System
- ECC and S/4HANA
- Tables
- 7
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
SU10 writes the same value to the selected users; but it cannot write a different email, department or validity date to each user from a file, and it offers no before/after comparison. In SU01 users are changed one by one. This program processes each row of the file with its own values, shows the differences in test mode and keeps a log per row.
Who uses it? User administrators and IT support teams; BASIS teams correcting user data after an organizational change, an email domain migration or a new system setup.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| USR02User Logon Data | User group and validity dates; written through the BAPI | Write | ECC + S/4 |
| ADRPPersons (Business Address Services) | First and last name; written through the BAPI | Write | ECC + S/4 |
| ADR6E-Mail Addresses (Business Address Services) | Email address; written through the BAPI | Write | ECC + S/4 |
| ADCPPerson/Address Assignment | Department and function; written through the BAPI | Write | ECC + S/4 |
| USR01User Master Record (Runtime Data) | Default printer; written through the BAPI | Write | ECC + S/4 |
| USR21User Name to Address Key Assignment | Person and address number of the user | Read | ECC + S/4 |
| USGRPUser Groups | Existence check for the user group | Read | ECC + S/4 |
BAPIs and functions used
- BAPI_USER_EXISTENCE_CHECKCheck Whether a User Exists. Checks whether the user in the file exists in the system
- BAPI_USER_GET_DETAILRead User Details. Reads current address, logon and default values for comparison
- BAPI_USER_CHANGEChange User. Changes only flagged fields; password parameters are not used
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | — | Yes | C:\temp\kullanici_guncelleme.xlsx |
| P_TEST | Test mode (compare only) | Checkbox | — | No | X |
| P_BLANK | Blank cell clears the field | Checkbox | — | No | — |
| S_PROT | Protected user groups (never changed) | Range / multiple | USR02-CLASS | No | SUPER, ACIL, TEKNIK |
Input file columns
The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.
| # | Column | Target field | Required |
|---|---|---|---|
| 1 | User | USR02-BNAME | Yes |
| 2 | First name | ADRP-NAME_FIRST | No |
| 3 | Last name | ADRP-NAME_LAST | No |
| 4 | ADR6-SMTP_ADDR | No | |
| 5 | Department | ADCP-DEPARTMENT | No |
| 6 | Function | ADCP-FUNCTION | No |
| 7 | User group | USR02-CLASS | No |
| 8 | Valid from | USR02-GLTGV | No |
| 9 | Valid to | USR02-GLTGB | No |
| 10 | Default printer | USR01-SPLD | No |
Sample upload file
| 1 | User * | First name | Last name | Department | Function | User group | Valid from | Valid to | Default printer | |
|---|---|---|---|---|---|---|---|---|---|---|
| 2 | SDEMIR | Selin | Demir | [email protected] | Satış | Bölge Müdürü | SATIS | 12/31/9999 | LP01 | |
| 3 | KCELIK | Muhasebe | Uzman | MUHASEBE | 06/30/2027 | |||||
| 4 | TAKSOY | [email protected] | DANISMAN | 11/18/2026 | 12/31/2026 |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | User | USR02-BNAME |
| 3 | ADR6-SMTP_ADDR | |
| 4 | Department | ADCP-DEPARTMENT |
| 5 | User group | USR02-CLASS |
| 6 | Valid to | USR02-GLTGB |
| 7 | Changed fields | Calculated File fields that differ from the current value |
| 8 | Status | Calculated Success / Test / Skipped / Error |
| 9 | Message | Calculated BAPI return message or check error |
Sample result list
| Row | User | Department | User group | Valid to | Changed fields | Status | Message | |
|---|---|---|---|---|---|---|---|---|
| 1 | SDEMIR | [email protected] | Sales | SATIS | 12/31/9999 | Function, default printer | Success | User SDEMIR changed |
| 2 | KCELIK | [email protected] | Accounting | MUHASEBE | 06/30/2027 | Valid to | Success | User KCELIK changed |
| 3 | TAKSOY | [email protected] | DANISMAN | 12/31/2026 | Error | Valid-from conflicts with an earlier record; please check |
How does the program work?
- The file is read; the user name is mandatory. By default a blank cell means “do not change”; if the option is on, it clears the field.
- The user is checked with BAPI_USER_EXISTENCE_CHECK; users in protected user groups (e.g. emergency, technical) are skipped.
- The user group is checked in USGRP, and the default printer and email format are validated; the validity start cannot be after the end.
- Current values are read with BAPI_USER_GET_DETAIL and compared with the file; only differing fields are flagged in the change flag structures (ADDRESSX, LOGONDATAX, DEFAULTSX).
- In test mode only the comparison list is produced. In a real run, BAPI_USER_CHANGE is called per user; the password structure is never filled.
- The result is shown per row in ALV: changed fields, status and BAPI message. Failed rows can be downloaded in the same template; the changes also appear in the SU01 change documents.
Performance notes
The BAPI runs per user; a few thousand users are processed in a few minutes. Run very large files in the background from a file on the application server. Reading current values for comparison avoids unnecessary BAPI calls.
Features
- Test mode (check without posting) Test mode shows current and new values side by side without saving.
- ALV list (sort, filter, subtotals)
- Line-by-line result and error log
- Download failed lines as a separate file Failed rows can be downloaded in the same template and uploaded again.
- Runs as a background job
Authorization objects
- S_USER_GRPChange users by user group (ACTVT 02); also required for the target group
- S_TCODEAccess to the program's transaction code
Frequently asked questions
Does the program reset passwords or assign roles?
No. The program never uses the password parameters and reads no password data. Role assignments are also out of scope; they should go through approval in PFCG or SU01.
Can the changes be traced afterwards?
Yes. The BAPI writes the standard user change documents; the change documents report in SUIM shows who changed what and when. The program's own log is also kept by file name and row.
Does it work where Central User Administration (CUA) is used?
With CUA, changes must be made in the central system. When the program runs there, the BAPI distributes the changes to the child systems; local changes in a child system may be blocked by the CUA settings.
Related reports
Automatic Lock of Inactive Users Program
A custom background program that first warns dialog users who have not logged on for a given period by email, locks them with an administrator lock …
Expiring and Expired Role Assignments Report
A custom ALV report that lists role assignments whose validity ends within the next N days or that have ended but are still on the user, with the …
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.