Posted: Wed Aug 20, 2008 9:37 am Post subject: Shows Import History by Development Object
Code:
* Source Name is ZCHANGEZ
REPORT ZCHANGEZ
* Show Status of Imports by Development Object
LINE-COUNT 65
LINE-SIZE 255 NO STANDARD PAGE HEADING.
TABLES: VRSD, E070, USR21, adrp, DD07T, E07T, E071, V_E071EU, TRDIR.
SELECT-OPTIONS: DATUM FOR VRSD-DATUM DEFAULT SY-DATUM.
*SELTEXT*E* "Change made within this Date Range
SELECT-OPTIONS: UNAME FOR USR21-BNAME.
*SELTEXT*E* "User(s) to be Selected
select-options: obj_name for v_e071eu-obj_name.
*SELTEXT"E" "Object Name(s) to be Selected
DATA: BEGIN OF TAB OCCURS 500,
AS4USER LIKE E070-AS4USER,
STRKORR LIKE VRSD-KORRNUM, "Transport Request
TRKORR LIKE E070-TRKORR, "Sub Request
OBJNAME LIKE VRSD-OBJNAME, "Object Name
OBJTYPE LIKE VRSD-OBJTYPE, "Object Type
AS4DATE LIKE E070-AS4DATE,
END OF TAB.
DATA: BEGIN OF TT_COFI_LINES OCCURS 500.
INCLUDE STRUCTURE TSTRFCOFIL.
DATA: END OF TT_COFI_LINES.
DATA: TT_COFI_LINES-COUNT(8) TYPE P.
DATA: TT_COFI_LIT(10).
DATA: TT_COFI_LIT2 LIKE DD07T-DDTEXT.
DATA: BEGIN OF TAB-DD07T OCCURS 100,
DOMVALUE_L LIKE DD07T-DOMVALUE_L,
DDTEXT LIKE DD07T-DDTEXT,
END OF TAB-DD07T.
DATA: BEGIN OF TAB2 OCCURS 500,
OBJNAME LIKE VRSD-OBJNAME, "Object Name
OBJTYPE LIKE VRSD-OBJTYPE, "Object Type
TRKORR LIKE E070-TRKORR,
TARSYSTEM LIKE TT_COFI_LINES-TARSYSTEM,
STRKORR LIKE E070-STRKORR,
AS4USER LIKE E070-AS4USER,
AS4DATE LIKE E070-AS4DATE,
CHGDATE LIKE SY-DATUM,
RETCODE LIKE TT_COFI_LINES-RETCODE,
TRTIME LIKE TT_COFI_LINES-TRTIME,
TRDATE LIKE TT_COFI_LINES-TRDATE,
STATUS LIKE TT_COFI_LIT,
LIT2 LIKE TT_COFI_LIT2,
TARSORTIND,
END OF TAB2.
DATA: BEGIN OF PREV,
AS4USER LIKE E070-AS4USER,
OBJNAME LIKE TAB2-OBJNAME,
STRKORR LIKE E070-TRKORR,
TARSYSTEM LIKE TT_COFI_LINES-TARSYSTEM,
TRDATE LIKE E070-AS4DATE,
END OF PREV.
DATA: TEMP-LINE(150).
DATA: TEMP-NAME(060).
SET BLANK LINES ON.
SELECT * FROM DD07T WHERE DDLANGUAGE EQ SY-LANGU
AND DOMNAME EQ 'TRBATFUNC'.
MOVE-CORRESPONDING DD07T TO TAB-DD07T.
APPEND TAB-DD07T.
ENDSELECT.
CLEAR TAB-DD07T.
MOVE 'I' TO TAB-DD07T-DOMVALUE_L.
MOVE 'Import' TO TAB-DD07T-DDTEXT.
APPEND TAB-DD07T.
CLEAR TAB-DD07T.
MOVE 'P' TO TAB-DD07T-DOMVALUE_L.
MOVE 'Problem' TO TAB-DD07T-DDTEXT.
APPEND TAB-DD07T.
SORT TAB-DD07T BY DOMVALUE_L.
SELECT * FROM V_E071EU WHERE AS4DATE IN DATUM "Change Date
AND AS4USER IN UNAME
and obj_name in obj_name.
IF V_E071EU-AS4DATE IN DATUM
AND V_E071EU-AS4USER IN UNAME
AND NOT V_E071EU-STRKORR IS INITIAL.
CLEAR TAB.
MOVE V_E071EU-STRKORR TO TAB-STRKORR.
MOVE V_E071EU-TRKORR TO TAB-TRKORR.
MOVE V_E071EU-AS4USER TO TAB-AS4USER.
MOVE V_E071EU-AS4DATE TO TAB-AS4DATE.
MOVE V_E071EU-OBJ_NAME TO TAB-OBJNAME.
MOVE V_E071EU-OBJECT TO TAB-OBJTYPE.
COLLECT TAB.
ENDIF.
ENDSELECT.
COMMIT WORK.
LOOP AT TAB.
REFRESH TT_COFI_LINES.
CALL FUNCTION 'STRF_READ_COFILE'
EXPORTING
IV_DIRTYPE = 'T'
IV_TRKORR = TAB-STRKORR
TABLES
TT_COFI_LINES = TT_COFI_LINES
EXCEPTIONS
WRONG_CALL = 1
NO_INFO_FOUND = 2
OTHERS = 3.
DESCRIBE TABLE TT_COFI_LINES LINES TT_COFI_LINES-COUNT.
IF TT_COFI_LINES-COUNT > 0.
SORT TT_COFI_LINES BY TRDATE TRTIME.
LOOP AT TT_COFI_LINES WHERE FUNCTION NE 'P'
and function ne '<'
and function ne 'E'.
CLEAR TAB2.
IF TT_COFI_LINES-RETCODE EQ 0.
MOVE 'Successful' TO TT_COFI_LIT.
ELSE.
MOVE 'FAILED' TO TT_COFI_LIT.
ENDIF.
MOVE TAB-STRKORR TO TAB2-STRKORR.
MOVE TT_COFI_LINES-TARSYSTEM TO TAB2-TARSYSTEM.
MOVE TT_COFI_LINES-TRDATE TO TAB2-TRDATE.
MOVE TT_COFI_LINES-TRTIME TO TAB2-TRTIME.
MOVE TT_COFI_LINES-RETCODE TO TAB2-RETCODE.
MOVE TT_COFI_LIT TO TAB2-STATUS.
CLEAR TT_COFI_LIT2.
IF TT_COFI_LINES-RETCODE NE 0.
READ TABLE TAB-DD07T WITH KEY DOMVALUE_L =
TT_COFI_LINES-FUNCTION
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE TAB-DD07T-DDTEXT TO TT_COFI_LIT2.
ENDIF.
ENDIF.
MOVE TT_COFI_LIT2 TO TAB2-LIT2.
MOVE TAB-TRKORR TO TAB2-TRKORR.
IF TAB2-TARSYSTEM(3) EQ 'DEV'.
MOVE '1' TO TAB2-TARSORTIND.
ENDIF.
IF TAB2-TARSYSTEM(2) EQ 'RD'.
MOVE '2' TO TAB2-TARSORTIND.
ENDIF.
IF TAB2-TARSYSTEM(2) EQ 'RQ'.
MOVE '3' TO TAB2-TARSORTIND.
ENDIF.
IF TAB2-TARSYSTEM(2) EQ 'RP'.
MOVE '5' TO TAB2-TARSORTIND.
ENDIF.
MOVE TAB-OBJNAME TO TAB2-OBJNAME.
MOVE TAB-OBJTYPE TO TAB2-OBJTYPE.
MOVE TAB-AS4USER TO TAB2-AS4USER.
APPEND TAB2.
ENDLOOP.
ELSE.
CLEAR TAB2.
MOVE-CORRESPONDING TAB TO TAB2.
MOVE TAB-AS4DATE TO TAB2-CHGDATE.
APPEND TAB2.
ENDIF.
ENDLOOP.
SORT TAB2 BY AS4USER OBJNAME STRKORR TARSORTIND TRDATE
RETCODE DESCENDING TRTIME.
LOOP AT TAB2.
IF PREV-AS4USER NE TAB2-AS4USER.
CLEAR USR21.
clear adrp.
select single * from usr21 where bname eq tab2-as4user.
clear adrp.
clear temp-name.
select * from adrp where persnumber eq usr21-persnumber.
move adrp-name_text to temp-name.
exit.
endselect.
CONDENSE TEMP-NAME.
NEW-PAGE.
ENDIF.
IF PREV-OBJNAME EQ TAB2-OBJNAME
AND PREV-STRKORR EQ TAB2-STRKORR
AND PREV-TARSYSTEM EQ TAB2-TARSYSTEM
AND PREV-TRDATE EQ TAB2-TRDATE.
CONTINUE.
ENDIF.
IF PREV-OBJNAME NE TAB2-OBJNAME
OR PREV-STRKORR NE TAB2-STRKORR.
WRITE: / ' '.
ENDIF.
MOVE-CORRESPONDING TAB2 TO PREV.
CLEAR E07T.
SELECT SINGLE * FROM E07T WHERE TRKORR EQ TAB2-STRKORR
AND LANGU EQ SY-LANGU.
CLEAR TEMP-LINE.
MOVE TAB2-LIT2 TO TEMP-LINE.
MOVE '*' TO TEMP-LINE+60.
MOVE E07T-AS4TEXT TO TEMP-LINE+61.
CONDENSE TEMP-LINE.
IF NOT TAB2-CHGDATE IS INITIAL.
MOVE TAB2-CHGDATE TO TAB2-TRDATE.
MOVE 'OPEN' TO TAB2-STATUS.
CLEAR TRDIR.
SELECT SINGLE * FROM TRDIR WHERE NAME EQ TAB2-OBJNAME.
MOVE TRDIR-STIME TO TAB2-TRTIME.
ENDIF.
WRITE: /01 TAB2-OBJNAME, 35 TAB2-OBJTYPE,
41 TAB2-STRKORR, TAB2-TRKORR,
63 TAB2-TARSYSTEM(3), TAB2-TRDATE, TAB2-TRTIME,
88 TAB2-STATUS, TEMP-LINE(64).
ENDLOOP.
INCLUDE ZCONINC3.
FORMAT INTENSIFIED OFF.
WRITE: / 'Data for Selected User', TAB2-AS4USER, TEMP-NAME.
WRITE: /01 'Object Name & Type',
41 'Transport& SubTask',
63 'Import System and Time',
88 'Status and Transport Description'.
FORMAT INTENSIFIED ON.
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.