首页 > 代码库 > 系统监控指标获取
系统监控指标获取
1、DB02
<style>SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF } .L0S31 { font-style: italic; color: #808080 } .L0S32 { color: #3399FF } .L0S33 { color: #4DA619 } .L0S52 { color: #0000FF } .L0S55 { color: #800080 }</style>
*"----------------------------------------------------------------------
*"*"本地接口:
*" TABLES
*" ET_LOCKS STRUCTURE EXCLLCKWTS
*"----------------------------------------------------------------------
CALL FUNCTION ‘S_DB_EXCLUSIVE_LOCK_WAITERS‘
TABLES
exclusive_lock_waiters = et_locks
EXCEPTIONS
database_not_supported = 1
OTHERS = 2.
2、DB02
<style>SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF } .L0S31 { font-style: italic; color: #808080 } .L0S32 { color: #3399FF } .L0S33 { color: #4DA619 } .L0S52 { color: #0000FF } .L0S55 { color: #800080 } .L0S70 { color: #808080 }</style>
*"----------------------------------------------------------------------
*"*"本地接口:
*" TABLES
*" ET_VBHDR STRUCTURE VBHDR
*"----------------------------------------------------------------------
DATA:l_vbdate_from type vbhdr-vbdate.
CONCATENATE sy-datum ‘000000‘ INTO l_vbdate_from.
SELECT *
INTO TABLE et_vbhdr
FROM vbhdr
WHERE vbstate BETWEEN 1 AND 255
AND vbrc BETWEEN 1 AND 255
AND vbdate BETWEEN l_vbdate_from AND ‘99991231235959‘. "#ec *
DELETE et_vbhdr WHERE vbrc = 9."删除更新错误、更新错误(无重试)
3、SM58
<style>SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF } .L0S31 { font-style: italic; color: #808080 } .L0S52 { color: #0000FF } .L0S55 { color: #800080 } .L0S70 { color: #808080 }</style>
*"----------------------------------------------------------------------
*"*"本地接口:
*" TABLES
*" ET_ARFCSSTATE STRUCTURE ARFCSSTATE
*"----------------------------------------------------------------------
REFRESH:et_arfcsstate[].
SELECT *
INTO TABLE et_arfcsstate
FROM arfcsstate
WHERE arfcdatum = sy-datum.
4、SM66
<style>SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF } .L0S31 { font-style: italic; color: #808080 } .L0S32 { color: #3399FF } .L0S33 { color: #4DA619 } .L0S52 { color: #0000FF } .L0S55 { color: #800080 } .L0S70 { color: #808080 }</style>
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" VALUE(I_MINTIME) TYPE I OPTIONAL
*" TABLES
*" WP_TOTAL_INFO STRUCTURE WPTOTLINFO
*" COMMUNICATION_ERRORS STRUCTURE WPTOTLICER OPTIONAL
*" USED_WP STRUCTURE WPTOTLIUWP OPTIONAL
*"----------------------------------------------------------------------
RANGES:s_itype FOR wptotlinfo-wp_itype.
RANGES:s_istatus FOR wptotlinfo-wp_istatus.
CALL FUNCTION ‘STUM_WP_TOTAL_ACTIVITY‘
EXPORTING
get_only_restricted_data = ‘ ‘
with_cpu = ‘00‘
show_status_on_gui = ‘‘
get_no_db_lock_info = ‘X‘
TABLES
WP_TOTAL_INFO = wp_total_info
COMMUNICATION_ERRORS = communication_errors
USED_WP = used_wp
.
CHECK wp_total_info[] IS NOT INITIAL.
CLEAR s_itype.
s_itype-sign = ‘I‘.
s_itype-option = ‘BT‘.
s_itype-low = 1.
s_itype-high = 6.
APPEND s_itype.
CLEAR s_istatus.
s_istatus-sign = ‘I‘.
s_istatus-option = ‘EQ‘.
s_istatus-low = 4.
APPEND s_istatus.
CLEAR s_istatus.
s_istatus-sign = ‘I‘.
s_istatus-option = ‘EQ‘.
s_istatus-low = 8.
APPEND s_istatus.
CLEAR s_istatus.
s_istatus-sign = ‘I‘.
s_istatus-option = ‘EQ‘.
s_istatus-low = 16.
APPEND s_istatus.
DELETE wp_total_info WHERE wp_itype NOT IN s_itype OR wp_istatus NOT IN s_istatus.
**去除指定时间以下的数据
IF i_mintime > 0.
DELETE wp_total_info WHERE wp_eltime < i_mintime.
ENDIF.
5、ST22
<style>SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF } .L0S31 { font-style: italic; color: #808080 } .L0S32 { color: #3399FF } .L0S33 { color: #4DA619 } .L0S52 { color: #0000FF } .L0S55 { color: #800080 } .L0S70 { color: #808080 }</style>
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" VALUE(I_MAX) TYPE INT4 OPTIONAL
*" TABLES
*" ET_SNAP STRUCTURE RDUMPOV
*"----------------------------------------------------------------------
DATA:lt_snap TYPE TABLE OF snap,
ls_snap TYPE snap.
DATA:ls_out TYPE rdumpov.
DATA:i TYPE i.
DATA:l_from TYPE i.
DATA:l_time TYPE sy-uzeit.
DATA:l_index TYPE i.
DATA:l_ini TYPE i.
SELECT *
INTO TABLE lt_snap
FROM snap
WHERE datum = sy-datum
AND seqno = ‘000‘.
SORT lt_snap BY datum DESCENDING uzeit DESCENDING.
LOOP AT lt_snap INTO ls_snap.
IF i_max > 0 AND sy-tabix > i_max.
EXIT.
ENDIF.
CLEAR:ls_out,i,l_from.
MOVE-CORRESPONDING ls_snap TO ls_out.
CLEAR:l_index,l_from,i,l_ini.
DO.
l_ini = l_from.
l_from = l_from + 2.
i = ls_snap-flist+l_from(3).
l_index = l_from + 3.
CASE ls_snap-flist+l_ini(2).
WHEN ‘FC‘."运行时错误
ls_out-rexception = ls_snap-flist+l_index(i).
WHEN ‘AP‘."已终止程序
ls_out-gprogram = ls_snap-flist+l_index(i).
WHEN ‘AI‘.
WHEN ‘AL‘.
WHEN ‘XC‘.
ls_out-component = ls_snap-flist+l_index(i).
WHEN OTHERS.
EXIT.
ENDCASE.
l_from = l_from + i + 3.
ENDDO.
APPEND ls_out TO et_snap.
ENDLOOP.
系统监控指标获取