Skip to Content
Technical Articles

Quick tip: Password mass update report

Each implementation project with SAP Fiori’s role-based principle brings the need to keep numerous test users. Those test users are going to be used by different project members simultaneously, thus the need to share the test users with their passwords. Before sharing the list, there is a need to set the usersโ€™ passwords. Manually updating more than 10 passwords seems like a tedious task. Especially that there are two steps needed:
1. Setting the password,
2. Making sure that there is no forced change at the first logon

Below is the report that automates this job.

The report sets the passwords the same as users, but feel free to adapt the program if you find it disturbing ๐Ÿ˜‰

Tens of man-days saved ๐Ÿคšโœ‹

Regards
Greg

*&———————————————————————*
*& Report ZFIORIPASSRESET
*&———————————————————————*
*&
*&———————————————————————*
REPORT zfioripassreset.

DATA: uname TYPE xubname, returny TYPE i, bapimsg LIKE bapiret2 OCCURS 0 WITH HEADER LINE, p_passw TYPE bapipwd.

TYPES: BEGIN OF ty_itab,
uname TYPE xubname,

END OF ty_itab.

TYPES: tt_itab TYPE STANDARD TABLE OF ty_itab.
DATA: itab TYPE tt_itab,
wa_itab TYPE ty_itab.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: s_uname FOR uname.

SELECTION-SCREEN: END OF BLOCK b1.

INITIALIZATION.
%_s_uname_%_app_%-text = ‘User’.

DATA: user LIKE LINE OF s_uname.

LOOP AT s_uname INTO user.

uname = user-low.
WRITE:/ ‘Changing: ‘,uname.

p_passw-bapipwd = uname.

CALL FUNCTION ‘BAPI_USER_CHANGE’
EXPORTING
username = uname
password = p_passw
passwordx = ‘X’
productive_pwd = ‘X’
TABLES
return = bapimsg.

LOOP AT bapimsg.

WRITE:/ bapimsg-message .
ENDLOOP.
WRITE:/.

ENDLOOP.

 

3 Comments
You must be Logged on to comment or reply to a post.
  • In case you would need one place to publish your test-users with passwords, consider using Fiori Tracker’s Test users info records function. It keeps your test users linked with roles, so project members can easily find the correct user for the chosen role.

  • Hi Grzegorz,

    Thanks for the report, if I am not wrong this would help the security folks for the password change request and as you said immensely when there is a need of test users for different Fiori Roles assigned to different work spaces.