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

Display the transports of a specified period



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Transport and Upgrade | Транспорт и Обновления
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Nov 25, 2007 12:49 pm    Post subject: Display the transports of a specified period Reply with quote

Tree structure graphics with drill down functions to display the transports of a specified period

Code:
*
* This program uses a tree structure to dispaly the
* transports of a specified period. You can drill
* down in a tree to display the transports by type,
* number and date and to display the objects inside.
*
REPORT ZTRPLIST.

TABLES: E070, E071.
PARAMETERS: STRDAT TYPE D DEFAULT SY-DATUM,
            ENDDAT TYPE D DEFAULT SY-DATUM.
DATA: BEGIN OF ITAB OCCURS 100,
    TRFUNCTION LIKE E070-TRFUNCTION,
    AS4DATE    LIKE E070-AS4DATE,
    TRKORR     LIKE E070-TRKORR,
    PGMID      LIKE E071-PGMID,
    OBJECT     LIKE E071-OBJECT,
    OBJ_NAME   LIKE E071-OBJ_NAME,
END OF ITAB.
DATA: BEGIN OF SITAB OCCURS 100,
    TRFUNCTION LIKE E070-TRFUNCTION,
    AS4DATE    LIKE E070-AS4DATE,
    TRKORR     LIKE E070-TRKORR,
    PGMID      LIKE E071-PGMID,
    OBJECT     LIKE E071-OBJECT,
    OBJ_NAME   LIKE E071-OBJ_NAME,
END OF SITAB.
DATA: C(3), TEXT1(50), TEXT2(50), COL1 TYPE I, COL2 TYPE I, LEVEL TYPE
      I, F15 TYPE C, LEN1 TYPE I, LEN2 TYPE I, COUNT TYPE I.
DATA: BEGIN OF TREE OCCURS 100.
        INCLUDE STRUCTURE SNODETEXT.
DATA: END OF TREE.

SELECT-OPTIONS SRC_SYTS FOR C NO INTERVALS DEFAULT 'DEV'.

START-OF-SELECTION.
  SET PF-STATUS 'LIBS1'.
  SELECT * FROM E070 WHERE AS4DATE >= STRDAT AND
                           AS4DATE <= ENDDAT
                           ORDER BY TRFUNCTION AS4DATE.
    SELECT * FROM E071 WHERE TRKORR = E070-TRKORR AND
      PGMID <> 'CORR'.
      MOVE-CORRESPONDING E070 TO ITAB.
      MOVE-CORRESPONDING E071 TO ITAB.
      APPEND ITAB.
    ENDSELECT.
  ENDSELECT.

  LOOP AT ITAB.
    SITAB = ITAB. APPEND SITAB.
  ENDLOOP.

  DATA: BEGIN OF STRUCC OCCURS 500.
          INCLUDE STRUCTURE SNODETEXT.
  DATA: END OF STRUCC.

  LOOP AT ITAB.
    AT FIRST.
*   write: / 'Transports between', strdat, 'and', enddat.
      TEXT1 = 'Transports between'.
      TEXT1+21 = STRDAT.
      TEXT1+31 = 'and'.
      TEXT1+35 = ENDDAT.
      CLEAR TEXT2.
      LEN1 = 50. LEN2 = 0.
      COL1 = 1. COL2 = 2. LEVEL = 1.
      PERFORM FILL_TREETAB.
    ENDAT.
    AT NEW TRFUNCTION.
*   write: / itab-trfunction color 3.
      COUNT = 0.
      LOOP AT SITAB.
        IF ITAB-TRFUNCTION = SITAB-TRFUNCTION.
          COUNT = COUNT + 1.
        ENDIF.
      ENDLOOP.
      TEXT1 = ITAB-TRFUNCTION.
      TEXT1+3 = 'type transport'.
      TEXT2 = COUNT.
      CONDENSE TEXT2.
      LEN1 = 20. LEN2 = 16.
      COL1 = 3. COL2 = 7. LEVEL = 2.
      PERFORM FILL_TREETAB.
    ENDAT.
    AT NEW TRKORR.
*   write: / itab-trkorr color 4, itab-as4date color 4.
      TEXT1 = ITAB-TRKORR.
      TEXT2 = ITAB-AS4DATE.
      LEN1 = 10. LEN2 = 10.
      COL1 = 4. COL2 = 4. LEVEL = 3.
      PERFORM FILL_TREETAB.
    ENDAT.
* write: / itab-pgmid color 5, itab-object color 5, itab-obj_name(30)
    TEXT1 = ITAB-PGMID.
    TEXT1+4 = ITAB-OBJECT.
    TEXT1+10 = ITAB-OBJ_NAME(30).
    CLEAR TEXT2.
    LEN1 = 50. LEN2 = 0.
    COL1 = 5. COL2 = 5. LEVEL = 4.
    PERFORM FILL_TREETAB.

  ENDLOOP.

  CALL FUNCTION 'RS_TREE_CONSTRUCT'
       TABLES
            NODETAB      = TREE
       EXCEPTIONS
            TREE_FAILURE = 1.
  SY-LSIND = 0.
  CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
       EXPORTING
            CALLBACK_PROGRAM      = 'ZTRPLIST'
            CALLBACK_USER_COMMAND = 'NODE_SELECT'
       IMPORTING
            F15                   = F15.

*---------------------------------------------------------------------*
*       FORM NODE_SELECT                                              *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  KNOTEN                                                        *
*  -->  COMMAND                                                       *
*  -->  EXIT                                                          *
*  -->  LIST_REFRESH                                                  *
*---------------------------------------------------------------------*
FORM NODE_SELECT TABLES KNOTEN STRUCTURE SEUCOMM
  USING COMMAND
  CHANGING EXIT
           LIST_REFRESH.
  EXIT = ' '.
  LIST_REFRESH = 'X'.
ENDFORM.


*---------------------------------------------------------------------*
*       FORM FILL_TREETAB                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM FILL_TREETAB.
  TREE-NAME = TEXT1.
  TREE-COLOR = COL1.
  TREE-INTENSIV = '1'.
  TREE-TEXT = TEXT1.
  TREE-TLENGTH = LEN1.
  TREE-TLEVEL = LEVEL.
  TREE-TCOLOR = COL1.
  TREE-TINTENSIV = '1'.
  TREE-TEXT1 = TEXT2.
  TREE-TLENGTH1 = LEN2.
  TREE-TCOLOR1 = COL2.
  TREE-TINTENSIV = '0'.
  APPEND TREE.
ENDFORM.
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 -> Transport and Upgrade | Транспорт и Обновления 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.