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

Shows Development Object Changes by Date



 
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: 1636

PostPosted: Wed Aug 20, 2008 9:35 am    Post subject: Shows Development Object Changes by Date Reply with quote

Code:
* Source Name is  ZCHANGES
REPORT ZCHANGES
 LINE-SIZE 255 NO STANDARD PAGE HEADING.
********************************************************************
* Purpose - to determine Development Objects THAT HAVE CHANGED     *
********************************************************************
TABLES: VRSD, TRDIR, USR02, E071, E070V, *E070V, TADIR, TFDIR, TLOCK.
SELECT-OPTIONS: DATUM FOR VRSD-DATUM DEFAULT SY-DATUM.
*SELTEXT*E* "Change made within this Date Range
SELECT-OPTIONS: UNAME FOR USR02-BNAME.
*SELTEXT*E*  "User(s) to be Selected
PARAMETERS: SORT1  RADIOBUTTON GROUP TMOD,
* Selection Text  'Sort by Date and Time
      SORT2  RADIOBUTTON GROUP TMOD DEFAULT 'X',
* Selection Text  'Sort by Development Object
      S2OPT1 AS CHECKBOX,
* Selection Text  'Unique  Development Objects
      SORT3  RADIOBUTTON GROUP TMOD.
* Selection Text  'Sort by Development Object Type
DATA: BEGIN OF TAB OCCURS 500,
      OBJNAME LIKE VRSD-OBJNAME,
      DATUM LIKE VRSD-DATUM,
      ZEIT  LIKE VRSD-ZEIT,
      OBJTYPE LIKE VRSD-OBJTYPE,
      AUTHOR  LIKE VRSD-AUTHOR,
      KORRNUM LIKE VRSD-KORRNUM,
      END OF TAB.
DATA: KEY-OBJNAME LIKE TAB-OBJNAME.
DATA: BEGIN OF TEMP.
        INCLUDE STRUCTURE TAB.
DATA: END OF TEMP.
DATA: REC-COUNT TYPE P.
DATA: TMP-PNAME LIKE TFDIR-PNAME.
DATA: TMP-INCLUDE LIKE TFDIR-INCLUDE.
TABLES: RS38M.
DATA: BEGIN OF TTAB OCCURS 10.
        INCLUDE STRUCTURE TEXTPOOL.
DATA:   END OF TTAB.
DATA: BEGIN OF PREV,
      OBJNAME LIKE TAB-OBJNAME,
      OBJTYPE LIKE TAB-OBJTYPE,
      END OF PREV.
DATA: S2OPT1-CONT.
AT SELECTION-SCREEN OUTPUT.
  IF SORT2 IS INITIAL.
    LOOP AT SCREEN.
      IF SCREEN-NAME CS 'S2OPT1'.
        SCREEN-INVISIBLE     =    1.
        SCREEN-INPUT         =    0.
        SCREEN-OUTPUT        =    0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

START-OF-SELECTION.
  SELECT * FROM VRSD WHERE DATUM IN DATUM
                     AND AUTHOR IN UNAME.
* check vrsd-objname(1) ne '@'.
* check vrsd-objname(4) ne 'SAPL'.
* check vrsd-objname(5) ne 'LCJPS'.
    MOVE-CORRESPONDING VRSD TO TAB.
    APPEND TAB.
  ENDSELECT.
  COMMIT WORK.
  SORT  TAB BY OBJNAME.
  SELECT * FROM TRDIR WHERE UDAT IN DATUM
                        AND UNAM IN UNAME.
    CHECK TRDIR-OCCURS  NE 'X'.
    CHECK TRDIR-NAME(2) NE 'LG'.
    CHECK TRDIR-NAME(2) NE 'AQ'.
    CHECK TRDIR-RSTAT   NE 'P'.
    CHECK TRDIR-NAME(4) NE 'SAPL'.
    CHECK TRDIR-NAME(4) NE 'RSTP'.
    CHECK TRDIR-NAME(5) NE 'LCJPS'.
    CHECK TRDIR-NAME(5) NE 'SAPDB'.
* check trdir-name(1) ne '@'.
    CLEAR TAB.
    MOVE TRDIR-UDAT     TO  TAB-DATUM.
    MOVE TRDIR-STIME    TO  TAB-ZEIT.
    MOVE 'PROG'         TO  TAB-OBJTYPE.
    MOVE TRDIR-NAME     TO  TAB-OBJNAME.
    MOVE TRDIR-UNAM     TO  TAB-AUTHOR.
    IF TAB-KORRNUM IS INITIAL.
      SELECT * FROM TLOCK
        WHERE OBJECT EQ 'PROG'
          AND AUTHOR EQ TAB-AUTHOR.
        IF TLOCK-HIKEY(8) EQ TRDIR-NAME.
          MOVE TLOCK-TRKORR TO TAB-KORRNUM.
        ENDIF.
      ENDSELECT.
    ENDIF.
    CLEAR E071.
    IF TAB-KORRNUM IS INITIAL.
      SELECT * FROM E071
        WHERE PGMID  EQ 'R3TR'
          AND OBJECT EQ 'PROG'
          AND OBJ_NAME EQ TRDIR-NAME.
        MOVE E071-TRKORR TO TAB-KORRNUM.
      ENDSELECT.
    ENDIF.
    IF TAB-KORRNUM IS INITIAL.
      SELECT * FROM E071
        WHERE PGMID  EQ 'LIMU'
          AND OBJECT EQ 'REPS'
          AND OBJ_NAME EQ TRDIR-NAME.
        MOVE E071-TRKORR TO TAB-KORRNUM.
      ENDSELECT.
    ENDIF.
    IF TAB-KORRNUM IS INITIAL.
      SELECT * FROM E071
        WHERE PGMID  EQ 'LIMU'
          AND OBJECT EQ 'REPT'
          AND OBJ_NAME EQ TRDIR-NAME.
        MOVE E071-TRKORR TO TAB-KORRNUM.
      ENDSELECT.
    ENDIF.
*
    IF TAB-KORRNUM IS INITIAL
      AND TRDIR-NAME(1) EQ 'L'.
      MOVE 'SAPL'   TO TMP-PNAME.
      MOVE TRDIR-NAME+1(4) TO TMP-PNAME+4(4).
      MOVE TRDIR-NAME+6(2) TO TMP-INCLUDE.
      CLEAR TFDIR.
      SELECT * FROM TFDIR WHERE PNAME EQ TMP-PNAME
                            AND INCLUDE EQ TMP-INCLUDE.
        EXIT.
      ENDSELECT.
      SELECT * FROM E071
        WHERE PGMID  EQ 'LIMU'
          AND OBJECT EQ 'FUNC'
          AND OBJ_NAME EQ TFDIR-FUNCNAME.
        MOVE E071-TRKORR TO TAB-KORRNUM.
      ENDSELECT.
    ENDIF.
    IF TAB-KORRNUM IS INITIAL.
      SELECT * FROM TADIR
        WHERE PGMID  EQ 'R3TR'
          AND OBJECT EQ 'PROG'
          AND OBJ_NAME EQ TRDIR-NAME.
        IF TADIR-KORRNUM IS INITIAL.
          MOVE TADIR-DEVCLASS TO TAB-KORRNUM.
        ELSE.
          MOVE TADIR-KORRNUM  TO TAB-KORRNUM.
        ENDIF.
      ENDSELECT.
    ENDIF.
    IF TAB-KORRNUM IS INITIAL.
      SELECT * FROM TADIR
        WHERE PGMID  EQ 'LIMU'
          AND OBJECT EQ 'REPS'
          AND OBJ_NAME EQ TRDIR-NAME.
        IF TADIR-KORRNUM IS INITIAL.
          MOVE TADIR-DEVCLASS TO TAB-KORRNUM.
        ELSE.
          MOVE TADIR-KORRNUM  TO TAB-KORRNUM.
        ENDIF.
      ENDSELECT.
    ENDIF.
    IF TAB-KORRNUM IS INITIAL.
      SELECT * FROM TADIR
        WHERE PGMID  EQ 'LIMU'
          AND OBJECT EQ 'REPT'
          AND OBJ_NAME EQ TRDIR-NAME.
        IF TADIR-KORRNUM IS INITIAL.
          MOVE TADIR-DEVCLASS TO TAB-KORRNUM.
        ELSE.
          MOVE TADIR-KORRNUM  TO TAB-KORRNUM.
        ENDIF.
      ENDSELECT.
    ENDIF.
    MOVE TAB TO TEMP.
    READ TABLE TAB WITH KEY OBJNAME = TEMP-OBJNAME BINARY SEARCH.
    IF SY-SUBRC NE 0.
      INSERT TAB INDEX SY-TABIX.
    ENDIF.
  ENDSELECT.
  COMMIT WORK.
  IF NOT SORT1 IS INITIAL.
    SORT  TAB BY DATUM ZEIT.
  ENDIF.
  IF NOT SORT2 IS INITIAL.
    SORT  TAB BY OBJNAME OBJTYPE DATUM ZEIT.
    IF S2OPT1 IS INITIAL.
      SORT  TAB BY OBJNAME OBJTYPE DATUM ZEIT.
    ELSE.
      SORT  TAB BY OBJNAME ASCENDING
                   OBJTYPE ASCENDING
                   DATUM   DESCENDING
                   ZEIT    DESCENDING.
    ENDIF.
  ENDIF.
  IF NOT SORT3 IS INITIAL.
    SORT  TAB BY OBJTYPE OBJNAME DATUM ZEIT.
  ENDIF.
  LOOP AT TAB.
    MOVE 'Y' TO S2OPT1-CONT.
    IF NOT SORT2 IS INITIAL AND NOT S2OPT1 IS INITIAL.
       IF TAB-OBJNAME EQ PREV-OBJNAME
          AND TAB-OBJTYPE EQ PREV-OBJTYPE.
             MOVE 'N' TO S2OPT1-CONT.
      ENDIF.
      MOVE-CORRESPONDING TAB TO PREV.
    ENDIF.
    CHECK S2OPT1-CONT EQ 'Y'.
    ADD 1 TO REC-COUNT.
    IF TAB-OBJTYPE EQ 'DYNP'.
      REPLACE '   ' WITH ' / ' INTO TAB-OBJNAME.
      CONDENSE TAB-OBJNAME.
    ENDIF.
    CLEAR E070V-AS4TEXT.
    SELECT * FROM E070V WHERE TRKORR EQ TAB-KORRNUM.
      IF NOT E070V-STRKORR IS INITIAL.
        SELECT * FROM *E070V WHERE TRKORR EQ E070V-STRKORR.
          MOVE *E070V-AS4TEXT TO E070V-AS4TEXT.
          EXIT.
        ENDSELECT.
      ENDIF.
      EXIT.
    ENDSELECT.
    REFRESH TTAB.
    CLEAR: RS38M-REPTI, TTAB.
    READ TEXTPOOL TAB-OBJNAME(8)  INTO TTAB LANGUAGE SY-LANGU.
    READ TABLE TTAB WITH KEY 'R'.
    RS38M-REPTI = TTAB-ENTRY.
    IF NOT SORT1 IS INITIAL.
      WRITE: / TAB-DATUM,
               12 TAB-ZEIT,
               21 TAB-OBJTYPE,
               26 TAB-AUTHOR,
               39 TAB-KORRNUM,
               60 TAB-OBJNAME,
                  RS38M-REPTI,
                  E070V-AS4TEXT.
    ENDIF.
    IF NOT SORT2 IS INITIAL.
      WRITE: /
                  TAB-OBJNAME,
               35 TAB-OBJTYPE,
               40 TAB-DATUM,
               51 TAB-ZEIT,
               60 TAB-AUTHOR,
               73 TAB-KORRNUM,
                  RS38M-REPTI,
                  E070V-AS4TEXT.
    ENDIF.
    IF NOT SORT3 IS INITIAL.
      WRITE: /
                  TAB-OBJTYPE,
               06 TAB-OBJNAME,
               40 TAB-DATUM,
               51 TAB-ZEIT,
               60 TAB-AUTHOR,
               73 TAB-KORRNUM,
                  RS38M-REPTI,
                  E070V-AS4TEXT.
    ENDIF.
  ENDLOOP.
  WRITE: / REC-COUNT, '= Records Changed'.
  INCLUDE ZCONINC3.
  FORMAT INTENSIFIED OFF.
  IF NOT SORT1 IS INITIAL.
    WRITE: / 'Date',
             12 'Time',
             21 'Type',
             26 'Changed by',
             39 'Correction #',
             60 'Object Name',
             95 'Description & Transport Name'.
  ENDIF.
  IF NOT SORT2 IS INITIAL.
    WRITE: /    ' Object Name',
               35 'Type',
               40 'Date',
               51 'Time',
               60 'Changed by',
               73 'Transport',
               84 'Report Title',
              155 'Transport Description'.
  ENDIF.
  IF NOT SORT3 IS INITIAL.
    WRITE: /
                  'Type',
               05 ' Object Name',
               40 'Date',
               51 'Time',
               60 'Changed by',
               73 'Transport',
               84 'Report Title',
              155 'Transport Description'.
  ENDIF.
  FORMAT INTENSIFIED ON.
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.