die letzte Benutzung eines Programmes kann über den Fuba Z_USEREXIT_WORKLOAD realisiert werden (jedoch ohne Variante).
Siehe Hinweis 143550 - ST03/Workload: Userexit zur individuellen Verarbeitung
Beispielcoding:
TABLES: ZBCREPMON.
DATA: MY_DATA LIKE ZBCREPMON OCCURS 0 WITH HEADER LINE,
REPMON_TAB LIKE ZBCREPMON OCCURS 0 WITH HEADER LINE.
LOOP AT V2_NORMAL_RECORDS WHERE TCODE NE 'SM51'
AND TCODE NE 'SM59'
AND TCODE NE 'SM66'
AND TCODE NE 'SH01'
AND REPORT NE 'RSHLP001'.
IF V2_NORMAL_RECORDS-REPORT CP 'Z*' OR
V2_NORMAL_RECORDS-REPORT CP 'SAPMZ*'.
CLEAR ZBCREPMON.
SELECT SINGLE STARTTIME ANZAHL
INTO (ZBCREPMON-STARTTIME, ZBCREPMON-ANZAHL) FROM ZBCREPMON
WHERE REPORT = V2_NORMAL_RECORDS-REPORT
AND ACCOUNT = V2_NORMAL_RECORDS-ACCOUNT
AND STARTDATE = V2_NORMAL_RECORDS-STARTDATE.
IF SY-SUBRC NE 0 OR
ZBCREPMON-STARTTIME <= V2_NORMAL_RECORDS-STARTTIME.
MOVE: SY-MANDT TO MY_DATA-MANDT.
MOVE ZBCREPMON-ANZAHL TO MY_DATA-ANZAHL.
MOVE-CORRESPONDING V2_NORMAL_RECORDS TO MY_DATA.
APPEND MY_DATA.
ENDIF.
ENDIF.
ENDLOOP.
SORT MY_DATA.
LOOP AT MY_DATA.
MOVE-CORRESPONDING MY_DATA TO REPMON_TAB.
AT END OF STARTDATE.
ADD 1 TO REPMON_TAB-ANZAHL.
APPEND REPMON_TAB.
ENDAT.
ENDLOOP.
MODIFY ZBCREPMON FROM TABLE REPMON_TAB.
COMMIT WORK.