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

Create a system user list in multi-client development system



 
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 Nov 17, 2007 6:26 pm    Post subject: Create a system user list in multi-client development system Reply with quote

Create a system user list , useful in multi-client development system

Code:

REPORT ZSBEN002 LINE-SIZE 120 LINE-COUNT 90.
*----------------------------------------------------------------------*
* Description:   The report creates a user list of the system.         *
*                Useful in a multi-client development system.          *
*                Fields: user-id, client, printer, profiles            *
*                                                                      *
* Parameters: Mand, when ' ' sorted by user, when 'X' sorted by client *
*                                                                      *
* Authorization: S_USER_GRP, User Master Anzeigen                      *
*              ( Warning: It is not adequate for a production system ) *
*                                                                      *
* Class:         Report                                                *
*                                                                      *
* Customizing:   -                                                     *
*                                                                      *
* R/3 Release:   3.0d                                                  *
*                                                                      *
* Programmer:    Bence Toth                                            *
* Date:          1996 September                                        *
*----------------------------------------------------------------------*
TABLES: USR04, USR01, TSP03.
PARAMETERS: MAND.
DATA: BEGIN OF U4 OCCURS 0,
         MANDT LIKE USR04-MANDT,
         BNAME LIKE USR04-BNAME,
         MODDA LIKE USR04-MODDA,
         MODTI LIKE USR04-MODTI,
         MODBE LIKE USR04-MODBE,
         NRPRO LIKE USR04-NRPRO,
         PROFS LIKE USR04-PROFS.
DATA: END OF U4.
DATA: X TYPE I VALUE 2.
DATA: Y TYPE I VALUE 1.
DATA: Z TYPE I.
FIELD-SYMBOLS: <A>.

TOP-OF-PAGE.
  ULINE (102).
  WRITE: / '|Name','         |Cli. |','Prin.|','Mod.date   |',
                   'Creator      |','User Profile', 102 '|'.
  ULINE (102).
  SKIP.
  ULINE (102).

END-OF-SELECTION.

  AUTHORITY-CHECK OBJECT 'S_USER_GRP'
           ID 'CLASS' FIELD '*'
           ID 'ACTVT' FIELD '03'.
  IF SY-SUBRC NE 0. EXIT. ENDIF.

  REFRESH U4.
  CLEAR U4.
  SELECT * FROM USR04 CLIENT SPECIFIED.
    MOVE-CORRESPONDING USR04 TO U4.
    APPEND U4.
    CLEAR U4.
  ENDSELECT.
  IF MAND EQ ' '.
    SORT U4 BY BNAME MANDT.
  ELSE.
    SORT U4 BY MANDT BNAME.
  ENDIF.
  LOOP AT U4.
* Check that all profiles of the user is on the same page
    Z = ( SY-LINCT - SY-LINNO ) - ( U4-NRPRO - 2 ) / 36 - 1.
    IF Z LE 0. NEW-PAGE. ENDIF.
    FORMAT INTENSIFIED OFF.
    SELECT SINGLE * FROM USR01 CLIENT SPECIFIED WHERE
                                MANDT EQ U4-MANDT AND
                                BNAME EQ U4-BNAME.
    SELECT SINGLE * FROM TSP03 WHERE PADEST EQ USR01-SPLD.
    WRITE: / '|',U4-BNAME INTENSIFIED ON,
             '|',U4-MANDT,
             '|',USR01-SPLD,
             '|',U4-MODDA,
             '|',U4-MODBE,'|'.
    ASSIGN 1 TO <A>.
    DO.
      ASSIGN U4-PROFS+X(12) TO <A>.
      IF <A> EQ '            '.
        EXIT.
      ENDIF.
      Y = ( X - 2 ) / 12.
      IF Y NE 0.
        Y = Y MOD 3.
        IF Y EQ 0.
   WRITE: / '|              |     |      |            |              |'.
        ENDIF.
      ENDIF.
      WRITE: <A>,'|'.
      ADD 12 TO X.
    ENDDO.
    WHILE X > 38.
      X = X - 36.
    ENDWHILE.

    CASE X.
      WHEN 26.
        WRITE: '             |'.
      WHEN 38.
      WHEN 14.
        WRITE: '             |              |'.
      WHEN 2.
        WRITE: '             |              |              |'.
      WHEN OTHERS.
        WRITE: / 'ez az:', X.
    ENDCASE.
    X = 2.
    Y = 1.
 WRITE: / '|              |---------------------------------------------
----------------------------------------|'.
    AT END OF BNAME.
      POSITION 1. WRITE '---------------'.
    ENDAT.
* New-page at the end of each Client, when sorted by client
    AT END  OF MANDT.
      CHECK MAND EQ 'X'.
      NEW-PAGE.
    ENDAT.
  ENDLOOP.
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.