Google Search - Blog...........

User List Of The System

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: - *
* *
*----------------------------------------------------------------------*
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: .
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
.
DO.
ASSIGN U4-PROFS+X(12) TO
.
IF
EQ ' '.
EXIT.
ENDIF.
Y = ( X - 2 ) / 12.
IF Y NE 0.
Y = Y MOD 3.
IF Y EQ 0.
WRITE: / '| | | | | |'.
ENDIF.
ENDIF.
WRITE:
,'|'.
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.

No comments:

Post a Comment