Synchronize your SAP account passwords

Synchronize your SAP account passwords

Do you have SAP accounts across multiple Clients within the same environment? This program will save a lot of hassle within a development or test environment. It copies the password for a nominated user account, i.e. from the current client, to all other clients that account resides in. The program was written in v.4.0B.


REPORT ZPASSWORD.
*---------------------------------------
* Written in a 4.0B system - perform a * syntax check in newer R/3
* versions. If the structure of table
* USR02 hasn't changed, this program
* will work in that later version.
*
* This program will set the password of
* the selected account from the
* client it is run in to all other
* clients in the same environment.
*
* N.B. Message 000 within message class
* ZF contains placeholders only
* - in other words, change ZF to a
* similar available message number
* & class within your own system
* IE. MESSAGE 000(ZF) [in table T100]
* looks like:  & & & &
*---------------------------------------
TABLES: USR02,             "User master 
T000.                      "Client Table
*
DATA: PWORD LIKE USR02-BCODE. 
*
PARAMETER USER LIKE USR02-BNAME DEFAULT SY-UNAME. "Account to Synchroniz
*---------------------------------------
START-OF-SELECTION.
* authorisation check - user can only 
* synchronise their own account
* unless they have the authority to 
* maintain ALL user accounts

  IF SY-UNAME NE USER.
    AUTHORITY-CHECK
    OBJECT 'S_USER_GRP'
    ID 'CLASS'  FIELD '*'
    ID 'ACTVT'

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

FIELD '02'. IF SY-SUBRC NE 0. MESSAGE E000(ZF) WITH 'You may only change your own account'. ENDIF. ENDIF. SELECT SINGLE BCODE INTO PWORD FROM USR02 WHERE BNAME = USER. IF SY-SUBRC EQ 0. SELECT * FROM T000 WHERE MANDT NE SY-MANDT. UPDATE USR02 CLIENT SPECIFIED SET: BCODE = PWORD BCDA1 = SY-DATUM BCDA2 = '' BCDA3 = '' BCDA4 = '' BCDA5 = '' OCOD1 = '' OCOD2 = '' OCOD3 = '' OCOD4 = '' OCOD5 = '' WHERE MANDT = T000-MANDT AND BNAME = USER. IF SY-SUBRC EQ 0. WRITE: / T000-MANDT, USER, 'Updated'. ELSE. WRITE: / T000-MANDT, USER, 'Update FAILED !!!!!!'. ENDIF. ENDSELECT. ELSE. WRITE: / USER , 'Does not exist in this client'. ENDIF.

This was first published in September 2002

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.