ABAP Program to do Mass Password Changes
*&---------------------------------------------------------------------* *& Report ZPASSWORD_MASS_CREATE * *& * *&---------------------------------------------------------------------* *& * *&---------------------------------------------------------------------* REPORT ZPASSWORD_MASS_CREATE message-id zpassword. tables usr01. data: lt_return type bapiret2 occurs 0 with header line. data: lw_user type BAPIBNAME-BAPIBNAME. select-options: s_bname for usr01-bname obligatory NO INTERVALS. parameters: p_passw type bapipwd obligatory. at selection-screen. loop at s_bname where option ne 'EQ'. message e001. endloop. start-of-selection. loop at s_bname. select count(*) from usr01 where bname in s_bname. if sy-subrc ne 0. write: / 'Userid:', s_bname-low , 'is not found in database'. continue. endif. Write: / 'about to reset password for user:', s_bname-low. lw_user = s_bname-low. CALL FUNCTION 'BAPI_USER_CHANGE' EXPORTING USERNAME = lw_user PASSWORD = p_passw PASSWORDX = 'X' TABLES RETURN = lt_return. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'. loop at lt_return. write: / '.....' , lt_return-MESSAGE. endloop. endloop. if sy-subrc ne 0. write: / 'No user selected'. endif. .