SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Synchronize password accross clients



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sat Jun 07, 2008 10:56 am    Post subject: Synchronize password accross clients Reply with quote

Synchronize password accross clients.
(Warning !! this report makes an update directly against the data base)

Code:
REPORT ZSYNC_PASSWORD message-id zaut.

*----------------------------------------------------------------------*
* Beskrivelse:  Programmet synkroniserer password pе tvжrs alle        *
*               klienter. Det password der bliver distribueret ud      *
*               er det password man har pе den klient er er logget pе  *
*                                                                      *
*               Man kan med dette program ikke se passwordet, og man   *
*               kan ikke angive et nyt password, ligesom at programmet *
*               ikke unlocker brugeren hvis denne er locked            *
*               Med dette program kan man heller ikke synkroniserer    *
*               det initiale password ud pе andre klienter, da         *
*               afviklingen af programmet krжver at man er logget pе   *
*                                                                      *
* Autorisation: For at kunne synkroniserer password for andre brugere  *
*               end den bruger der er logget pе krжvet der at man er   *
*               autorisationsobjekt ZSYNC_PASS = '59'                  *
*                                                                      *
* Afvikling:    Programmet afvikles i forgrunden                       *
*                                                                      *
* Parametre:    USER - intialer pе den bruger der skal have synkronis- *
*                      ret password                                    *
*----------------------------------------------------------------------*


TABLES: USR02, T000.
DATA: PASSWD LIKE USR02-BCODE.
PARAMETERS: USER LIKE USR02-BNAME default sy-uname.

SELECT SINGLE * FROM USR02 WHERE BNAME = USER.
*IF SY-UNAME <> 'SAP*'.
*  WRITE: / 'Only SAP* is allowed to run this program'. EXIT.
*ENDIF.
IF SY-SUBRC <> 0.
   message i001 with user.
   exit .
ENDIF.
IF USER NE SY-UNAME.

  AUTHORITY-CHECK OBJECT 'ZSYNC_PASS'
           ID 'ACTVT' FIELD '59'.
 if sy-subrc <> 0.
   message i002 with user.
   exit .
  endif.
endif.

PASSWD = USR02-BCODE.
CLEAR USR02.
WRITE: / 'Passwordet for', USER, 'er synkroniseret i klienterne:'.
SELECT * FROM T000 WHERE MANDT <> SY-MANDT.

* lock user

CALL FUNCTION 'ENQUEUE_E_USR04'
 EXPORTING
*   MODE_USR04           = 'E'
    MANDT                = T000-MANDT
    BNAME                = USER.
*   X_BNAME              = ' '
*   _SCOPE               = '2'
*   _WAIT                = ' '
*   _COLLECT             = ' '
* EXCEPTIONS
*   FOREIGN_LOCK         = 1
*   SYSTEM_FAILURE       = 2
*   OTHERS               = 3


  SELECT * FROM USR02 CLIENT SPECIFIED WHERE MANDT = T000-MANDT AND
           BNAME = USER.
    WRITE: / USR02-MANDT.
    USR02-BCODE = PASSWD.
    USR02-LTIME = SY-UZEIT.
    USR02-BCDA1 = USR02-BCDA2 = USR02-BCDA3 = SY-DATUM.
    USR02-BCDA4 = USR02-BCDA5 = SY-DATUM.
  UPDATE USR02 CLIENT SPECIFIED.
  ENDSELECT.

* Lеs brugeren op

CALL FUNCTION 'DEQUEUE_E_USR04'
 EXPORTING
*   MODE_USR04       = 'E'
   MANDT            = T000-MANDT
   BNAME            = USER.
*   X_BNAME          = ' '
*   _SCOPE           = '3'
*   _SYNCHRON        = ' '
*   _COLLECT         = ' '

ENDSELECT.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.