The Conventional way to get the load details say for infocube is to open the context menu and click on manage on an infocube. If we want collect load details for 10 physical data targets then we have to repeat the above procedure for ten times. In a Support environment if a consultant want collect load details happened in that day then it could be tedious job to collect manually. This program doesn't require any input parameters at all. It will give us what ever the loads which happened on a particular day into all physical data targets in the system. We can perform filter and sort with resulted output as it is built using ALV.
________________________________________
Here is the ABAP code.
----REPORT ZDATA_LOAD_MONITOR.
type-pools: slis.
DATA: W_ICUBE TYPE RSINFOCUBE,
W_RNSIDLAST TYPE RSSID,
W_TIMESTAMP TYPE RSTIMESTMP,
ZDATE1(14),
ZDATE(8).
data: begin of itab occurs 0,
W_DTA type RSSTATMANDTA,
W_DTA_TYPE TYPE RSSTATMANDTA_TYPE,
W_LINESREAD type sy-tabix,
W_LINESTRANSFERRED type sy-tabix,
W_ISOURCE TYPE RSISOURCE,
W_SOURCE_DTA TYPE RSSTATMANDTA,
end of itab.
data:s_fieldcat type slis_fieldcat_alv,
t_fieldcat type slis_t_fieldcat_alv.
SELECT ICUBE RNSIDLAST TIMESTAMP FROM RSICCONT
INTO (W_ICUBE,W_RNSIDLAST,W_TIMESTAMP).
ZDATE1 = W_TIMESTAMP.
ZDATE = ZDATE1.
IF ZDATE equip SY-DATUM.
SELECT SINGLE dta DTA_TYPE anz_recs insert_recs ISOURCE SOURCE_DTA FROM RSSTATMANPART INTO itab
WHERE partnr = W_RNSIDLAST.
append itab.
ENDIF.
ENDSELECT.
perform fieldcatlog using 'TARGET' 'ITAB' 'W_DTA'.
perform fieldcatlog using 'TARGET TYPE' 'ITAB' 'W_DTA_TYPE'.
perform fieldcatlog using 'RECORDS SELECTED' 'ITAB' 'W_LINESREAD'.
perform fieldcatlog using 'RECORDS TRANSFERED' 'ITAB' 'W_LINESTRANSFERRED'.
perform fieldcatlog using 'SOURCE' 'ITAB' 'W_SOURCE_DTA'.
perform fieldcatlog using 'INFOSOURCE' 'ITAB' 'W_ISOURCE'.
sort itab by W_DTA W_DTA_TYPE W_LINESREAD W_LINESTRANSFERRED W_SOURCE_DTA W_ISOURCE .
delete ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
IT_FIELDCAT = t_fieldcat
TABLES
T_OUTTAB = itab.
*&---------------------------------------------------------------------*
*& Form FIELDCATLOG
*&---------------------------------------------------------------------*
FORM FIELDCATLOG USING VALUE(P_0107)
p_0108
p_0109.
clear s_fieldcat.
s_fieldcat-seltext_l = P_0107.
s_fieldcat-fieldname = p_0109.
s_fieldcat-tabname = p_0108.
APPEND s_fieldcat to t_fieldcat.
ENDFORM. " FIELDCATLOG
Output after executing the program:
Output will have type of target i.e. DSO or Cube and we can know what is the source for the data target.

0 comments:
Post a Comment