Transporte analysieren
Mit diesem Programm kann man alle existierenden Transporte analysieren die es im System gibt.
*&---------------------------------------------------------------------*
*& Report Z_TRANSPORT_INHALTE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT z_transport_inhalte MESSAGE-ID zn.
*=======================================================================
* Type Pools
*=======================================================================
TYPE-POOLS:
slis.
*=======================================================================
* Typedefinitonen, Strukturen, Konstante und Interne Tabellen
*=======================================================================
CONSTANTS:
co_true TYPE boolean VALUE 'X'.
TYPES:
BEGIN OF ty_compr,
object TYPE trobjtype,
obj_name TYPE trobj_name,
objfunc TYPE objfunc,
END OF ty_compr.
TYPES:
BEGIN OF zr1x_show_transport_content_al,
OBJ_NAME TYPE Trobj_name,
PGMID TYPE PGMID,
OBJECT TYPE TROBJTYPE,
TRKORR Type TRKORR,
END OF zr1x_show_transport_content_al.
DATA:
gd_tabix TYPE sytabix,
gt_e070 TYPE TABLE OF e070,
gs_e070 TYPE e070,
gt_e071 TYPE TABLE OF e071,
gs_e071 TYPE e071,
gs_compri TYPE zr1x_show_transport_content_al,
gt_compri TYPE TABLE OF zr1x_show_transport_content_al,
gs_sort TYPE slis_sortinfo_alv,
gt_sort TYPE slis_t_sortinfo_alv,
gs_fieldcat TYPE slis_fieldcat_alv,
gt_fieldcat TYPE slis_t_fieldcat_alv.
*=======================================================================
* Selektionbild
*=======================================================================
SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME.
SELECT-OPTIONS:
s_trkorr FOR gs_e070-trkorr OBLIGATORY,
s_func FOR gs_e070-trfunction,
s_pgmid FOR gs_e071-pgmid,
s_obj FOR gs_e071-object,
s_objnam FOR gs_e071-obj_name.
PARAMETERS:
p_compri AS CHECKBOX.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(79) text-t01.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b01.
*=======================================================================
* START-OF-SELECTION.
*=======================================================================
START-OF-SELECTION.
* Transportauftrag selektieren
SELECT * FROM e070 INTO TABLE gt_e070
WHERE trkorr IN s_trkorr
AND trfunction IN s_func.
IF sy-subrc = 0.
* Alle Objekte des Transportauftrags selektieren
SELECT * FROM e071 INTO TABLE gt_e071
FOR ALL ENTRIES IN gt_e070
WHERE trkorr = gt_e070-trkorr
AND pgmid IN s_pgmid
AND object IN s_obj
AND obj_name IN s_objnam.
ENDIF.
* BREAK-POINT.
* Prüfung auf Gesamtanzeige oder Verdichtet
IF p_compri NE co_true.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZR1X_SHOW_TRANSPORT_CONTENT'
i_structure_name = 'E071'
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZR1X_SHOW_TRANSPORT_CONTENT'
it_fieldcat = gt_fieldcat
TABLES
t_outtab = gt_e071
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* komprimierte Ausgabe
ELSE.
LOOP AT gt_e071
INTO gs_e071.
MOVE-CORRESPONDING gs_e071
TO gs_compri.
IF NOT gs_compri-pgmid = 'CORR'.
APPEND gs_compri
TO gt_compri.
ENDIF.
ENDLOOP.
SORT gt_compri.
DELETE ADJACENT DUPLICATES
FROM gt_compri.
gs_sort-spos = '1'.
gs_sort-fieldname = 'OBJ_NAME'.
gs_sort-up = 'X'.
APPEND gs_sort TO gt_sort.
gs_sort-spos = '3'.
gs_sort-fieldname = 'OBJECT'.
gs_sort-up = 'X'.
APPEND gs_sort TO gt_sort.
gs_sort-spos = '4'.
gs_sort-fieldname = 'PGMID'.
gs_sort-up = 'X'.
APPEND gs_sort TO gt_sort.
gs_sort-spos = '2'.
gs_sort-fieldname = 'TRKORR'.
gs_sort-up = 'X'.
APPEND gs_sort TO gt_sort.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZR1X_SHOW_TRANSPORT_CONTENT'
i_structure_name = 'ZR1X_SHOW_TRANSPORT_CONTENT_AL'
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE gt_fieldcat
INTO gs_fieldcat
WITH KEY fieldname = 'OBJ_NAME'.
gd_tabix = sy-tabix.
gs_fieldcat-outputlen = '60'.
gs_fieldcat-col_pos = '1'.
MODIFY gt_fieldcat
FROM gs_fieldcat
INDEX gd_tabix.
READ TABLE gt_fieldcat
INTO gs_fieldcat
WITH KEY fieldname = 'OBJECT'.
gd_tabix = sy-tabix.
gs_fieldcat-outputlen = '10'.
gs_fieldcat-col_pos = '3'.
MODIFY gt_fieldcat
FROM gs_fieldcat
INDEX gd_tabix.
READ TABLE gt_fieldcat
INTO gs_fieldcat
WITH KEY fieldname = 'PGMID'.
gd_tabix = sy-tabix.
gs_fieldcat-outputlen = '10'.
gs_fieldcat-col_pos = '4'.
MODIFY gt_fieldcat
FROM gs_fieldcat
INDEX gd_tabix.
READ TABLE gt_fieldcat
INTO gs_fieldcat
WITH KEY fieldname = 'TRKORR'.
gd_tabix = sy-tabix.
gs_fieldcat-outputlen = '15'.
gs_fieldcat-col_pos = '2'.
MODIFY gt_fieldcat
FROM gs_fieldcat
INDEX gd_tabix.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZR1X_SHOW_TRANSPORT_CONTENT'
it_fieldcat = gt_fieldcat
it_sort = gt_sort
TABLES
t_outtab = gt_compri
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
CLEAR s_trkorr.
MOVE 'I' TO s_trkorr-sign.
MOVE 'CP' TO s_trkorr-option.
MOVE 'IE1K*' TO s_trkorr-low. "Systemname eintragen + K
APPEND s_trkorr.