BASIS Program Custom development Mass upload

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

  • SU10 User Mass Maintenance. Writes the same value to selected users; no per-user values or comparison.
  • SU01 User Maintenance. Changes users one at a time; not suitable for bulk changes.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
USR02User Logon DataUser group and validity dates; written through the BAPIWriteECC + S/4
ADRPPersons (Business Address Services)First and last name; written through the BAPIWriteECC + S/4
ADR6E-Mail Addresses (Business Address Services)Email address; written through the BAPIWriteECC + S/4
ADCPPerson/Address AssignmentDepartment and function; written through the BAPIWriteECC + S/4
USR01User Master Record (Runtime Data)Default printer; written through the BAPIWriteECC + S/4
USR21User Name to Address Key AssignmentPerson and address number of the userReadECC + S/4
USGRPUser GroupsExistence check for the user groupReadECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEUpload file (XLSX or CSV)Single value—YesC:\temp\kullanici_guncelleme.xlsx
P_TESTTest mode (compare only)Checkbox—NoX
P_BLANKBlank cell clears the fieldCheckbox—No—
S_PROTProtected user groups (never changed)Range / multipleUSR02-CLASSNoSUPER, 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.

#ColumnTarget fieldRequired
1UserUSR02-BNAMEYes
2First nameADRP-NAME_FIRSTNo
3Last nameADRP-NAME_LASTNo
4EmailADR6-SMTP_ADDRNo
5DepartmentADCP-DEPARTMENTNo
6FunctionADCP-FUNCTIONNo
7User groupUSR02-CLASSNo
8Valid fromUSR02-GLTGVNo
9Valid toUSR02-GLTGBNo
10Default printerUSR01-SPLDNo

Sample upload file

1User *First nameLast nameEmailDepartmentFunctionUser groupValid fromValid toDefault printer
2SDEMIRSelinDemir[email protected]SatışBölge MüdürüSATIS12/31/9999LP01
3KCELIKMuhasebeUzmanMUHASEBE06/30/2027
4TAKSOY[email protected]DANISMAN11/18/202612/31/2026
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2UserUSR02-BNAME
3EmailADR6-SMTP_ADDR
4DepartmentADCP-DEPARTMENT
5User groupUSR02-CLASS
6Valid toUSR02-GLTGB
7Changed fieldsCalculated File fields that differ from the current value
8StatusCalculated Success / Test / Skipped / Error
9MessageCalculated BAPI return message or check error

Sample result list

RowUserEmailDepartmentUser groupValid toChanged fieldsStatusMessage
1SDEMIR[email protected]SalesSATIS12/31/9999Function, default printerSuccessUser SDEMIR changed
2KCELIK[email protected]AccountingMUHASEBE06/30/2027Valid toSuccessUser KCELIK changed
3TAKSOY[email protected]DANISMAN12/31/2026ErrorValid-from conflicts with an earlier record; please check
A view built with fictional sample data; not real system data.

How does the program work?

  1. 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.
  2. The user is checked with BAPI_USER_EXISTENCE_CHECK; users in protected user groups (e.g. emergency, technical) are skipped.
  3. The user group is checked in USGRP, and the default printer and email format are validated; the validity start cannot be after the end.
  4. 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).
  5. 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.
  6. 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

BASIS Program Custom Background program

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 …

USR02 · USR21 · ADR6 · AGR_USERS

BASIS Report Custom ALV report

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 …

AGR_USERS · AGR_TEXTS · AGR_DEFINE · AGR_1016

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.

Related report: Mass Update of User Master Data from Excel