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

Report of All Development Objects by Development Class



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



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Wed Aug 20, 2008 9:55 am    Post subject: Report of All Development Objects by Development Class Reply with quote

Code:
* Source Name is  ZDEVCLAS
* Source Name is  ZDEVCLAS
REPORT ZDEVCLAS MESSAGE-ID ZZ NO STANDARD PAGE HEADING
                       LINE-SIZE 255 LINE-COUNT 65.
TABLES: TADIR, TRDIR, E071, E070V, *E070V, USR01, USR03, TFDIR.

DATA: BEGIN OF E071TAB OCCURS 500,
      TRKORR     LIKE E071-TRKORR,
      PGMID      LIKE E071-PGMID,
      OBJECT     LIKE E071-OBJECT,
      OBJ_NAME   LIKE E071-OBJ_NAME,
      AS4TEXT    LIKE E070V-AS4TEXT,
        END OF E071TAB.

DATA: BEGIN OF TAB OCCURS 500,
      DEVCLASS   LIKE TADIR-DEVCLASS,
      PGMID      LIKE TADIR-PGMID,
      OBJECT     LIKE TADIR-OBJECT,
      OBJ_NAME   LIKE TADIR-OBJ_NAME,
      AS4USER    LIKE E070-AS4USER,
      AS4DATE    LIKE E070-AS4DATE,
      AS4TIME    LIKE E070-AS4TIME,
      TRKORR     LIKE E070V-TRKORR,
      TYPE(7),
      TSTATUS(4),
      AS4TEXT    LIKE E070V-AS4TEXT,
        END OF TAB.
SELECT-OPTIONS: DEVC FOR TAB-DEVCLASS DEFAULT '$TMP'.
*SELTEXT*E*  "Development Class(s)
SELECT-OPTIONS: AUTHOR FOR USR01-BNAME.
*SELTEXT*E*  "Author(s) of Changes
SELECT-OPTIONS: OBJNAME FOR TAB-OBJ_NAME.
*SELTEXT*E*  "Object Name(s) Changed
SELECT-OPTIONS: TRKORR FOR TAB-TRKORR
                   DEFAULT 'DEVK900000' TO 'DEVK999999'.
*SELTEXT*E*  "Transport/Corr Number(s)
PARAMETERS:
  SINCDATE LIKE TAB-AS4DATE DEFAULT '19980101'.
*SELTEXT*E*  "Changes Since this Date
SELECTION-SCREEN SKIP.
PARAMETERS:
  SORTDEVC DEFAULT 'X' RADIOBUTTON GROUP UPMD,
*SELTEXT*E*  "Sort by Development Class"
  SORTAUTH             RADIOBUTTON GROUP UPMD,
*SELTEXT*E*  "Sort by Author"
  SORTOBJ              RADIOBUTTON GROUP UPMD,
*SELTEXT*E*  "Sort by Object Name"
  SORTTRKO             RADIOBUTTON GROUP UPMD,
*SELTEXT*E*  "Sort by Correction Number"
  SORTTIME             RADIOBUTTON GROUP UPMD.
*SELTEXT*E*  "Sort by Date & Time Updated"
SELECTION-SCREEN SKIP.
PARAMETERS:
  TRANSPTX DEFAULT 'X' AS CHECKBOX,
*SELTEXT*E*  "Show Transports"
  CORRREPX DEFAULT 'X' AS CHECKBOX.
*SELTEXT*E*  "Show Corrections/Repairs"
SELECTION-SCREEN SKIP.
PARAMETERS:
  RLSDX DEFAULT 'X' AS CHECKBOX,
*SELTEXT*E*  "Show Released Requests'
  OPENX DEFAULT 'X' AS CHECKBOX.
*SELTEXT*E*  "Show Open Requests"
DATA: TEMP-NAME LIKE TRDIR-NAME.
DATA: BEGIN OF OLD.
        INCLUDE STRUCTURE TAB.
DATA:   END OF OLD.
TABLES: RS38M.
DATA: BEGIN OF TTAB OCCURS 10.
        INCLUDE STRUCTURE TEXTPOOL.
DATA:   END OF TTAB.
DATA: TMP-USR03(160).
DATA: BEGIN OF TMP-TFDIR,
        PNAME LIKE TFDIR-PNAME,
        INCLUDE LIKE TFDIR-INCLUDE,
        END OF TMP-TFDIR.

SELECT * FROM TADIR WHERE DEVCLASS IN DEVC
                      AND AUTHOR  IN AUTHOR
                      AND OBJ_NAME  IN OBJNAME
                      AND KORRNUM EQ '         '
                      AND GENFLAG EQ ' '.
  CHECK TADIR-OBJ_NAME(2) NE 'LG'.
  CHECK TADIR-OBJ_NAME(2) NE 'AQ'.
  CHECK TADIR-OBJ_NAME(4) NE 'SAPL'.
  CHECK TADIR-OBJ_NAME(4) NE 'RSTP'.
  CHECK TADIR-OBJ_NAME(5) NE 'LCJPS'.
  CHECK TADIR-OBJ_NAME(5) NE 'SAPDB'.
  CLEAR  E071TAB.
  MOVE-CORRESPONDING TADIR TO E071TAB.
  MOVE-CORRESPONDING E071TAB TO TAB.
  PERFORM GET-TRDIR-DATA.
  MOVE TAB-AS4TEXT TO E071TAB-AS4TEXT.
  IF  TADIR-DEVCLASS IN DEVC
    AND TADIR-OBJ_NAME IN OBJNAME
    AND TADIR-AUTHOR IN AUTHOR
    AND TADIR-AUTHOR(3) NE 'SAP'.
    APPEND E071TAB.
  ENDIF.
ENDSELECT.
COMMIT WORK.
SELECT * FROM E071 WHERE TRKORR IN TRKORR
                     AND OBJ_NAME IN OBJNAME.
  CLEAR E071TAB.
  MOVE-CORRESPONDING E071 TO E071TAB.
  IF E071-OBJECT EQ 'FUNC'.
    SELECT SINGLE * FROM TFDIR WHERE FUNCNAME EQ E071-OBJ_NAME.
    IF SY-SUBRC EQ 0.
      CLEAR E071TAB-OBJ_NAME.
      MOVE TFDIR-PNAME+3(5)  TO E071TAB-OBJ_NAME.
      MOVE 'U'               TO E071TAB-OBJ_NAME+5(1).
      MOVE TFDIR-INCLUDE     TO E071TAB-OBJ_NAME+6(2).
    ENDIF.
  ENDIF.
  IF    E071TAB-OBJ_NAME IN OBJNAME
    AND E071TAB-OBJ_NAME(2) NE 'LG'
    AND E071TAB-OBJ_NAME(2) NE 'AQ'
    AND E071TAB-OBJ_NAME(4) NE 'SAPL'
    AND E071TAB-OBJ_NAME(4) NE 'RSTP'
    AND E071TAB-OBJ_NAME(5) NE 'LCJPS'
    AND E071TAB-OBJ_NAME(5) NE 'SAPDB'
    AND E071TAB-OBJECT      NE 'RELE'
    AND E071TAB-OBJECT      NE 'MERG'
    AND E071TAB-OBJECT      NE 'VDAT'.
    APPEND E071TAB.
  ENDIF.
ENDSELECT.
COMMIT WORK.
SORT E071TAB BY PGMID    ASCENDING
                OBJECT   ASCENDING
                OBJ_NAME ASCENDING
                TRKORR   DESCENDING.
COMMIT WORK.

CLEAR OLD.
LOOP AT E071TAB.
  CLEAR TAB.
  MOVE-CORRESPONDING E071TAB TO TAB.
  IF TAB-OBJ_NAME EQ OLD-OBJ_NAME
      AND TAB-OBJECT EQ OLD-OBJECT
      AND TAB-PGMID  EQ OLD-PGMID
      AND TAB-TRKORR IS INITIAL.
    MOVE TAB-TRKORR TO OLD-TRKORR.
  ENDIF.
  IF TAB-OBJ_NAME EQ OLD-OBJ_NAME
      AND TAB-OBJECT EQ OLD-OBJECT
      AND TAB-PGMID  EQ OLD-PGMID
      AND TAB-TRKORR EQ OLD-TRKORR.
    CONTINUE.
  ENDIF.
  MOVE-CORRESPONDING TAB TO OLD.
  MOVE TAB-OBJ_NAME TO TEMP-NAME.
  IF TAB-DEVCLASS IS INITIAL.
    CLEAR TADIR.
    SELECT SINGLE * FROM TADIR WHERE PGMID EQ TAB-PGMID
                                 AND OBJECT EQ TAB-OBJECT
                                 AND OBJ_NAME EQ TAB-OBJ_NAME.
    IF SY-SUBRC EQ 0.
      MOVE TADIR-DEVCLASS   TO TAB-DEVCLASS.
      MOVE TADIR-AUTHOR     TO TAB-AS4USER.
      PERFORM GET-TRDIR-DATA.
    ENDIF.
  ENDIF.
  CLEAR TADIR.
  IF TAB-DEVCLASS IS INITIAL.
    CALL FUNCTION 'RS_PROGRAM_GET_DEVCLASS'
         EXPORTING
              PROGNAME = TEMP-NAME
         IMPORTING
              ADIR     = TADIR
              DEVCLASS = TAB-DEVCLASS
         EXCEPTIONS
              OTHERS   = 1.
    IF SY-SUBRC EQ 0.
      MOVE TADIR-DEVCLASS   TO TAB-DEVCLASS.
      MOVE TADIR-AUTHOR     TO TAB-AS4USER.
      PERFORM GET-TRDIR-DATA.
    ENDIF.
  ENDIF.
  CHECK TAB-DEVCLASS IN DEVC.
  CLEAR TAB-TSTATUS.
  IF NOT TAB-TRKORR IS INITIAL.
    SELECT * FROM E070V WHERE TRKORR EQ TAB-TRKORR.
      IF E070V-TRSTATUS EQ 'R'.
        MOVE 'RLSD'    TO TAB-TSTATUS.
      ELSE.
        MOVE 'OPEN'    TO TAB-TSTATUS.
      ENDIF.
      MOVE 'Cor/Rep'     TO TAB-TYPE.
      MOVE-CORRESPONDING E070V TO TAB.
      IF TAB-TSTATUS CS 'OPEN'.
        PERFORM GET-TRDIR-DATA.
      ENDIF.
      IF  TAB-DEVCLASS IN DEVC
        AND TAB-OBJ_NAME IN OBJNAME
        AND TAB-AS4USER IN AUTHOR
*      and tab-trkorr in trkorr
       AND TAB-AS4USER(3) NE 'SAP'
       AND ( ( TAB-TSTATUS = 'OPEN' AND OPENX EQ 'X' ) OR
             ( TAB-TSTATUS = 'RLSD' AND RLSDX EQ 'X' ) )
       AND NOT CORRREPX IS INITIAL
       AND TAB-AS4DATE GE SINCDATE.
        APPEND TAB.
      ENDIF.
      SELECT * FROM *E070V WHERE TRKORR EQ E070V-STRKORR.
        IF *E070V-TRSTATUS EQ 'R'.
          MOVE 'RLSD'    TO TAB-TSTATUS.
        ELSE.
          MOVE 'OPEN'    TO TAB-TSTATUS.
        ENDIF.
        MOVE-CORRESPONDING *E070V TO TAB.
        MOVE 'Transpt'     TO TAB-TYPE.
        IF  TAB-DEVCLASS IN DEVC
          AND TAB-OBJ_NAME IN OBJNAME
          AND TAB-AS4USER IN AUTHOR
*        and tab-trkorr in trkorr
         AND TAB-AS4USER(3) NE 'SAP'
       AND ( ( TAB-TSTATUS = 'OPEN' AND OPENX EQ 'X' ) OR
             ( TAB-TSTATUS = 'RLSD' AND RLSDX EQ 'X' ) )
         AND NOT TRANSPTX IS INITIAL
         AND TAB-AS4DATE GE SINCDATE.
          APPEND TAB.
        ENDIF.
      ENDSELECT.
    ENDSELECT.
  ELSE.
    IF    TAB-DEVCLASS IN DEVC
      AND TAB-OBJ_NAME IN OBJNAME
      AND TAB-AS4USER IN AUTHOR
*     and tab-trkorr in trkorr
      AND TAB-AS4USER(3) NE 'SAP'
      AND TAB-AS4DATE GE SINCDATE.
      APPEND TAB.
    ENDIF.
  ENDIF.
ENDLOOP.

COMMIT WORK.
IF NOT SORTDEVC IS INITIAL.
  SORT TAB BY DEVCLASS ASCENDING
              AS4USER ASCENDING
              OBJ_NAME ASCENDING
              TRKORR   DESCENDING.
ENDIF.
IF NOT SORTTRKO IS INITIAL.
  SORT TAB BY TRKORR   DESCENDING
              OBJ_NAME ASCENDING.
ENDIF.
IF NOT SORTAUTH IS INITIAL.
  SORT TAB BY AS4USER ASCENDING
              TRKORR   DESCENDING
              OBJ_NAME ASCENDING.
ENDIF.
IF NOT SORTOBJ  IS INITIAL.
  SORT TAB BY OBJ_NAME ASCENDING
              TRKORR   DESCENDING
              AS4USER ASCENDING.
ENDIF.
IF NOT SORTTIME IS INITIAL.
  SORT TAB BY AS4DATE  DESCENDING
              AS4TIME  DESCENDING
              OBJ_NAME ASCENDING
              TRKORR   DESCENDING
              AS4USER ASCENDING.
ENDIF.
COMMIT WORK.

CLEAR OLD.
IF NOT SORTDEVC IS INITIAL.
  LOOP AT TAB.
    IF TAB-DEVCLASS NE OLD-DEVCLASS.
      NEW-PAGE.
    ENDIF.
    IF TAB-OBJ_NAME EQ OLD-OBJ_NAME
        AND TAB-TRKORR NE OLD-TRKORR
        AND TAB-TRKORR IS INITIAL.
      MOVE TAB-TRKORR TO OLD-TRKORR.
    ENDIF.
    IF TAB-OBJ_NAME NE OLD-OBJ_NAME
        OR TAB-TRKORR NE OLD-TRKORR.
      PERFORM GET-USR03-DATA.
      WRITE: /1 TAB-AS4USER,
             14 TAB-OBJ_NAME,
             53 TAB-PGMID,
             58 TAB-OBJECT,
             63 TAB-TRKORR,
                TAB-TYPE,
                TAB-TSTATUS,
                TAB-AS4DATE,
                TAB-AS4TIME,
                TAB-AS4TEXT,
                TMP-USR03(50).
      IF TAB-OBJECT EQ 'FUNC'.
        CLEAR TMP-TFDIR.
        MOVE 'SAP' TO         TMP-TFDIR-PNAME.
        MOVE TAB-OBJ_NAME(5) TO  TMP-TFDIR-PNAME+3(5).
        MOVE TAB-OBJ_NAME+6(2) TO  TMP-TFDIR-INCLUDE.
        CLEAR TFDIR.
        SELECT * FROM TFDIR WHERE PNAME EQ TMP-TFDIR-PNAME
                              AND INCLUDE EQ TMP-TFDIR-INCLUDE.
          EXIT.
        ENDSELECT.
        IF NOT TFDIR-FUNCNAME IS INITIAL.
          WRITE: / TFDIR-FUNCNAME UNDER TAB-OBJ_NAME.
        ENDIF.
      ENDIF.
    ENDIF.
    MOVE-CORRESPONDING TAB TO OLD.
  ENDLOOP.
ELSE.
  LOOP AT TAB.
    IF TAB-OBJ_NAME EQ OLD-OBJ_NAME
      AND TAB-TRKORR NE OLD-TRKORR
      AND TAB-TRKORR IS INITIAL.
      MOVE TAB-TRKORR TO OLD-TRKORR.
    ENDIF.
    IF TAB-OBJ_NAME NE OLD-OBJ_NAME
      OR TAB-TRKORR NE OLD-TRKORR.
      PERFORM GET-USR03-DATA.
      WRITE: /1 TAB-AS4USER,
             14 TAB-OBJ_NAME,
             53 TAB-PGMID,
             58 TAB-OBJECT,
             63 TAB-TRKORR,
                TAB-TYPE,
                TAB-TSTATUS,
                TAB-AS4DATE,
                TAB-AS4TIME,
                TAB-AS4TEXT,
                TAB-DEVCLASS,
                TMP-USR03(50).
      IF TAB-OBJECT EQ 'FUNC'.
        CLEAR TMP-TFDIR.
        MOVE 'SAP' TO         TMP-TFDIR-PNAME.
        MOVE TAB-OBJ_NAME(5) TO  TMP-TFDIR-PNAME+3(5).
        MOVE TAB-OBJ_NAME+6(2) TO  TMP-TFDIR-INCLUDE.
        CLEAR TFDIR.
        SELECT * FROM TFDIR WHERE PNAME EQ TMP-TFDIR-PNAME
                              AND INCLUDE EQ TMP-TFDIR-INCLUDE.
          EXIT.
        ENDSELECT.
        IF NOT TFDIR-FUNCNAME IS INITIAL.
          WRITE: / TFDIR-FUNCNAME UNDER TAB-OBJ_NAME.
        ENDIF.
      ENDIF.
    ENDIF.
    MOVE-CORRESPONDING TAB TO OLD.
  ENDLOOP.
ENDIF.
*---------------------------------------------------------------------*
*       FORM GET-TRDIR-DATA                                           *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM GET-TRDIR-DATA.
  CLEAR TRDIR.
  SELECT SINGLE * FROM TRDIR WHERE NAME EQ TAB-OBJ_NAME.
  IF SY-SUBRC EQ 0.
    MOVE TRDIR-UDAT   TO TAB-AS4DATE.
    MOVE TRDIR-STIME  TO TAB-AS4TIME.
    IF TAB-AS4TEXT IS INITIAL.
      REFRESH TTAB.
      CLEAR: RS38M-REPTI, TTAB.
      READ TEXTPOOL TRDIR-NAME   INTO TTAB LANGUAGE SY-LANGU.
      READ TABLE TTAB WITH KEY 'R'.
      RS38M-REPTI = TTAB-ENTRY.
      IF SY-SUBRC EQ 0 AND NOT RS38M-REPTI IS INITIAL.
        MOVE RS38M-REPTI TO TAB-AS4TEXT.
      ENDIF.
    ENDIF.
  ENDIF.
ENDFORM.

*---------------------------------------------------------------------*
*       FORM GET-USR03-DATA                                           *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM GET-USR03-DATA.
  CLEAR TMP-USR03.
  SELECT SINGLE * FROM USR03 WHERE BNAME EQ TAB-AS4USER.
  IF SY-SUBRC EQ 0.
    MOVE USR03-NAME1   TO TMP-USR03.
    MOVE USR03-NAME2   TO TMP-USR03+40.
    MOVE USR03-NAME3   TO TMP-USR03+80.
    MOVE USR03-NAME4   TO TMP-USR03+120.
    CONDENSE TMP-USR03.
  ENDIF.
ENDFORM.

INCLUDE ZCONINC3.
FORMAT INTENSIFIED OFF.
IF NOT SORTDEVC IS INITIAL.
  WRITE: / ' Sorted by Development Class=', TAB-DEVCLASS.
ENDIF.
IF NOT SORTAUTH IS INITIAL.
  WRITE: / ' Sorted by Author'.
ENDIF.
IF NOT SORTTRKO IS INITIAL.
  WRITE: / ' Sorted by Transport/Correction Number'.
ENDIF.
IF NOT SORTOBJ  IS INITIAL.
  WRITE: / ' Sorted by Object Name'.
ENDIF.
WRITE: /1 'Person',
       14 'Object Name',
       53 'Pgm',
       58 'Obj',
       63 'Request'.
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 -> ABAP Dictionary 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.