SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Report basic status of an SAP systems



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sat Nov 17, 2007 6:32 pm    Post subject: Report basic status of an SAP systems Reply with quote

ABAP code and UNIX script to report basic status of an SAP system or systems; primarily a concatenated version of SM04, SM13, SM50, ST03, and others

Using/installing the monitoring tool


1 The file show_sap.txt has the source code for the function module. I've
called it Z_SHOW_STATUS but it could be anything else.

When defining the function module (SE37), remember to set the
RFC supported flag.

There are no import or export parameters, but there is a table that is
used to return the information. The Table parameter is INFO, and I have
used a ref structure of ABAPTEXT.

Remember to activate the function after uploading the code.

2 The program to call the fucntion from UNIX is the one supplied with
the rfcsdk kit, called startrfc. It needs to be compiled with the
appropriate switches for your operating system.

3 Execute the compiled program with the appropriate switches for
host name, instance, client, username, password. You also need to
add the switches for calling the function.

It will probably look something like:

startrfc -3 -h host -s 00 -u user -p password -c client \
-F Z_SHOW_STATUS -T INFO,72,w=-

where host is the host name,
00 is the instance number
user is the username
password is the password
client is the client
Z_SHOW_STATUS is the function module
INFO is the name of the table parameter
72 is it's wisth (in bytes)
w=- means print the contents to standard output.

Unix SH script
Code:

#!/bin/ksh
oss_host="sapserv6"
sleep_time=60
tmp_file="/tmp/sap_status.txt"
typeset -L15 aa
typeset -L25 dd
typeset -R6 tt
function extract_info {
if (( counter == 0 )); then
let all_users=0
let all_modes=0
let all_freeD=0
let all_ofD=0
let all_freeB=0
let all_ofB=0
let all_stop=0
let all_long=0
let all_err=0
let all_dumps=0
let all_batch=0
let all_dialog=0
let all_total=0
fi
inst[counter]=$(head -n 1 $tmp_file$node|cut -d " " -f 3)
at[counter]=$(head -n 1 $tmp_file$node|cut -d " " -f 8)
host[counter]=$node
users[counter]=$(grep Users $tmp_file$node|awk '{print $3}')
modes[counter]=$(grep Modes $tmp_file$node|awk '{print $3}')
freeD[counter]=$(grep 'Free D' $tmp_file$node|\
awk '{print $4, $5, $6 }')
freeB[counter]=$(grep 'Free B' $tmp_file$node|\
awk '{print $4, $5, $6 }')
stop[counter]=$(grep Stopped $tmp_file$node|awk '{print $4}')
long[counter]=$(grep Long $tmp_file$node|awk '{print $5}')
err[counter]=$(grep Errors $tmp_file$node|awk '{print $6}')
update[counter]=$(grep Update $tmp_file$node|\
awk '{print $4}')
if grep 'Last short' $tmp_file$node >/dev/null;then
   dumps[counter]=0
else
   dumps[counter]=$(grep 'Short dumps' $tmp_file$node|\
   awk '{print $5, $7}')
fi
batch[counter]=$(grep 'Batch step' $tmp_file$node|\
awk '{print $7,"(" $9 " ms)"}')
dialog[counter]=$(grep 'Dialog step' $tmp_file$node|\
awk '{print $7,"(" $9 " ms)"}')
total[counter]=$(grep 'Total step' $tmp_file$node|\
awk '{print $7,"(" $9 " ms)"}')
brback[counter]=$(grep 'Last brbac' $tmp_file$node|\
awk '{print $6}')
brarch[counter]=$(grep 'Last brarc' $tmp_file$node|\
awk '{print $6}')
archspace[counter]=$(grep 'Archive space' $tmp_file$node|\
awk '{print $5}')

let all_users=all_users+users[counter]
let all_modes=all_modes+modes[counter]
let all_freeD=all_freeD+$(print ${freeD[counter]}|\
awk '{print $1}')
let all_freeB=all_freeB+$(print ${freeB[counter]}|\
awk '{print $1}')
let all_stop=all_stop+stop[counter]
let all_long=all_long+long[counter]
let all_err=all_err+$(print ${err[counter]}|\
awk '{print $1}')
let all_dumps=all_dumps+$(print ${dumps[counter]}|\
awk '{print $1}')
let all_batch=all_batch+$(print ${batch[counter]}|\
awk '{print $1}')
let all_dialog=all_dialog+$(print ${dialog[counter]}|\
awk '{print $1}')
let all_total=all_total+$(print ${total[counter]}|\
awk '{print $1}')

let counter=counter+1
}
######      start here
#
let last_ping=00
while (( 1 == 1 )); do
let counter=0
node=iipa01
if /ops/show_sap.exe -3 -h $node -s 00 -T INFO,72,w=$tmp_file$node; then
extract_info
fi
node=iipa02
if /ops/show_sap.exe -3 -h $node -s 00 -T INFO,72,w=$tmp_file$node; then
extract_info
fi
node=iipa03
if /ops/show_sap.exe -3 -h $node -s 00 -c 000 -T
INFO,72,w=$tmp_file$node; then
extract_info
fi
##
clear
let i=0
dd="Status at"
tt="Totals"
print -n "$dd"
while (( $i < $counter ));
do
aa=${at[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Instance"
tt=""
print -n "$dd"
while (( $i < $counter ));
do
aa=${inst[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Host"
tt=""
print -n "$dd"
while (( $i < $counter ));
do
aa=${host[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Users"
tt=$all_users
print -n "$dd"
while (( $i < $counter ));
do
aa=${users[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Modes"
tt=$all_modes
print -n "$dd"
while (( $i < $counter ));
do
aa=${modes[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Free DIA"
tt=$all_freeD
print -n "$dd"
while (( $i < $counter ));
do
aa=${freeD[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Free BTC"
tt=$all_freeB
print -n "$dd"
while (( $i < $counter ));
do
aa=${freeB[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Stopped processes"
tt=$all_stop
print -n "$dd"
while (( $i < $counter ));
do
aa=${stop[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Long running processes"
tt=$all_long
print -n "$dd"
while (( $i < $counter ));
do
aa=${long[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Errors with updates"
tt=$all_err
print -n "$dd"
while (( $i < $counter ));
do
aa=${err[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Update status"
tt=""
print -n "$dd"
while (( $i < $counter ));
do
aa=${update[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Short dumps today"
tt=$all_dumps
print -n "$dd"
while (( $i < $counter ));
do
aa=${dumps[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Batch steps today"
tt=$all_batch
print -n "$dd"
while (( $i < $counter ));
do
aa=${batch[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Dialog steps today"
tt=$all_dialog
print -n "$dd"
while (( $i < $counter ));
do
aa=${dialog[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Total steps today"
tt=$all_total
print -n "$dd"
while (( $i < $counter ));
do
aa=${total[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Last brbackup"
tt=""
print -n "$dd"
while (( $i < $counter ));
do
aa=${brback[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Last brarchive"
tt=""
print -n "$dd"
while (( $i < $counter ));
do
aa=${brarch[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
##
let i=0
dd="Archive space"
tt=""
print -n "$dd"
while (( $i < $counter ));
do
aa=${archspace[$i]}
print -n "$aa"
let i=$i+1
done
print "$tt"
##
print -n "Waiting for $sleep_time seconds"
let i=1
while (( $i <= $sleep_time));do
let mod=$i%10
if (( 0 == $mod ));then
print -n "x"
else
print -n "."
fi
sleep 1
let i=$i+1
done
#sleep  $sleep_time
done


ABAP function
Code:

FUNCTION Z_SHOW_STATUS.
*"----------------------------------------------------------------------
*"*"Local interface:
*"       TABLES
*"              INFO STRUCTURE  ABAPTEXT
*"----------------------------------------------------------------------
  TABLES: VBHDR,SNAP_BEG,SNAPT, SDBAH.
data:
 th_opcode(1)                    type x,
 VB_GET_INFO                     LIKE TH_OPCODE VALUE 17,
 VBSINFO(20),
 VBINFO LIKE VBINFO.

  DATA: AVAILABLE LIKE SALGENP-INT1,
      TEXT LIKE SALGENP-TEXT,
      VALUE LIKE SALCOM-VALUE,
      PROBLEMS.
  DATA: DAYS_DIFF TYPE I.
  DATA: TODAY LIKE SY-DATUM, YESTERDAY LIKE SY-DATUM.
  DATA: BEGIN OF BACKUP_TAB OCCURS 10.
          include structure sdbah.
  data: end of backup_tab.
  DATA: BEGIN OF ARCHIVE_TAB OCCURS 10.
          include structure sdbah.
  data: end of archive_tab.

  DATA: BEGIN OF SUMMARY OCCURS 10.
          INCLUDE STRUCTURE SAPWLSUMRY.
  DATA: END OF SUMMARY.
  data: begin of fcc,
                id(2), ll(3), errid like snapt-errid,
        end of fcc.

  field-symbols: <f>.

  data: begin of usr_tabl occurs 10.
          include structure uinfo.
  data: end of usr_tabl.
  data: begin of wp_tabl occurs 10.
          include structure wpinfo.
  data: end of wp_tabl.


  DATA: VB_COUNTER TYPE I,
       DIA_JOBS TYPE I,
       BTC_JOBS TYPE I,
       RECS TYPE I,
       LONG_RUNNING TYPE I,
       STOPPED TYPE I,
       FREE_DIA TYPE I,
       FREE_BTC TYPE I,
       TOTAL_RESPTI TYPE I,
       TOTAL_QUEUETI TYPE I,
       LAST_TIME LIKE SY-UZEIT,
       MAX_TIME LIKE SY-UZEIT,
       AVE_RESPTI TYPE I,
       AVE_QUEUETI TYPE I,
       TOTAL_COUNT TYPE I.
  DATA:
        workdate like sy-datum,
        WORKTIME LIKE SY-UZEIT,
        WORKRC LIKE SDBAH-RC.
  DATA: OPCODE            TYPE X,
        SUM_USR           LIKE SY-INDEX,
        SUM_MODE          LIKE SY-INDEX,
        WITH_CPU         TYPE X VALUE 0,
        TH_VB_RC                        LIKE SY-INDEX,
        vb_notexecuted                  like th_vb_rc value 255,
        vb_autosysexec                  like th_vb_rc value 254,
        vb_autodiaexec                  like th_vb_rc value 253,
        vb_run_v2                       like th_vb_rc value 252,
        vb_delete                       like th_vb_rc value 251,
        vb_restart_v1                   like th_vb_rc value 250,
        vb_restart_v2                   like th_vb_rc value 249,
        vb_autodelete                   like th_vb_rc value 248,
        vb_executed                     like th_vb_rc value 247,
        vb_run_v1                       like th_vb_rc value 246,
        vb_v2_ok                        like th_vb_rc value 245,
        vb_ok                           like th_vb_rc value 0,
        vb_v1_ok                        like th_vb_rc value 1,
        vb_hdr_insert                   like th_vb_rc value 2,
        vb_hdr_read                     like th_vb_rc value 3,
        vb_dump                         like th_vb_rc value 4,
        vb_commit                       like th_vb_rc value 5,
        vb_modul_read                   like th_vb_rc value 6,
        vb_modul_update                 like th_vb_rc value 7,
        vb_no_memory                    like th_vb_rc value 8,
        vb_sap_exit                     like th_vb_rc value 9,
        vb_no_dynp_memory               like th_vb_rc value 10,
        vb_bad_mode                     like th_vb_rc value 11,
        vb_run_stopped                  like th_vb_rc value 12,
        vb_del_stopped                  like th_vb_rc value 13,
        vb_wrong_parameter              like th_vb_rc value 14,
        VB_NO_PARAMETER                 LIKE TH_VB_RC VALUE 15,
        VB_DEADLOCK                     LIKE TH_VB_RC VALUE 16,
        VB_NO_SERVER                    LIKE TH_VB_RC VALUE 17,
        VB_NO_SERVER_LIST               LIKE TH_VB_RC VALUE 18.
  DEFINE SHOW_DATE.
  DAYS_DIFF = TODAY - WORKDATE.
  IF WORKRC <> 0.
    MOVE '- failed (' TO OUTPUT_LINE+42.
    IF WORKDATE = TODAY.
      MOVE 'today)' TO OUTPUT_LINE+52.
    ELSE.
      IF WORKDATE = YESTERDAY.
        MOVE 'yesterday)' TO OUTPUT_LINE+52.
      ELSE.
        WRITE DAYS_DIFF TO OUTPUT_LINE+52(2).
        WRITE 'days ago)' TO OUTPUT_LINE+54.
      ENDIF.
    ENDIF.
  ELSE.
    MOVE '- OK (' TO OUTPUT_LINE+42.
    IF WORKDATE = TODAY.
      MOVE 'today)' TO OUTPUT_LINE+48.
    ELSE.
      IF WORKDATE = YESTERDAY.
        MOVE 'yesterday)' TO OUTPUT_LINE+48.
      ELSE.
        WRITE DAYS_DIFF TO OUTPUT_LINE+48(2).
        WRITE 'days ago)' TO OUTPUT_LINE+50.
      ENDIF.
    ENDIF.
  ENDIF.
  END-OF-DEFINITION.

  TODAY = SY-DATUM.
  YESTERDAY = SY-DATUM.
  YESTERDAY = SY-DATUM - 1.

  IF SY-DBSYS(6) = 'ORACLE'.
    PERFORM LOG_ALERT(RSORADBA) USING PROBLEMS
                            VALUE
                            TEXT
                            AVAILABLE.
    CALL FUNCTION 'DB_ORA_BACKUP_TAB'
*      importing
*           tabcnt     = tabcnt
         TABLES
              BACKUP_TAB = BACKUP_TAB.

    SELECT * FROM SDBAH INTO TABLE ARCHIVE_TAB
    WHERE FUNCT IN
   ('sve','cpy','ssv','svd','cpd','ssd','dsv','dcp','cps','cds',
    'SVE','CPY','SSV','SVD','CPD','SSD','DSV','DCP','CPS','CDS')
       ORDER BY BEG DESCENDING.
  ENDIF.
  VB_COUNTER = 0.
  SELECT * INTO VBHDR FROM VBHDR.
    case vbhdr-vbrc.
      when vb_ok.
      when vb_v1_ok.
      when vb_v2_ok.
      when vb_run_v1.
      when vb_executed.
      when vb_restart_v2.
      when vb_restart_v1.
      when vb_run_v2.
      when vb_autodiaexec.
      when vb_autosysexec.
      when vb_notexecuted.
      when others.
        VB_COUNTER = VB_COUNTER + 1.
    endcase.

  ENDSELECT.
  opcode = 2.
  call 'ThUsrInfo' id 'OPCODE' field opcode
    id 'TAB' field usr_tabl-*sys*.
  SUM_USR = -1.                                             "us
  SUM_MODE = -1.                                            "us
  loop at usr_tabl.
    sum_usr = sum_usr + 1.
    sum_mode = sum_mode + usr_tabl-extmodi.
  endloop.

  free wp_tabl.

  IF SY-BATCH = 'X'.
    FREE_BTC = 1.                                           "us
  ELSE.
    FREE_DIA = 1.                                           "us
  ENDIF.
  opcode = 1.
  call 'ThWpInfo' id 'OPCODE' field opcode id 'TAB' field
    wp_tabl-*sys* id 'CPU' field with_cpu.
  LOOP AT WP_TABL.
    IF WP_TABL-WP_ITYPE = 1.
      DIA_JOBS = DIA_JOBS + 1.
    ENDIF.
    IF WP_TABL-WP_ITYPE = 4.
      BTC_JOBS = BTC_JOBS + 1.
    ENDIF.
    IF WP_TABL-WP_ISTATUS = 2.
      IF WP_TABL-WP_ITYPE = 1.
        FREE_DIA = FREE_DIA + 1.
      ELSEIF WP_TABL-WP_ITYPE = 4.
        FREE_BTC = FREE_BTC + 1.
      ENDIF.
    ENDIF.
    IF WP_TABL-WP_ISTATUS = 8.
      STOPPED = STOPPED + 1.
    ENDIF.
    IF ( WP_TABL-WP_ELTIME > 600 ) AND
       ( wp_tabl-wp_itype <> 4 ) and
       ( wp_tabl-wp_iwait <> 9 ) .
      LONG_RUNNING = LONG_RUNNING + 1.
    ENDIF.

  ENDLOOP.
  RECS = 0.
  select * from snap_beg
            WHERE SEQNO = '000' AND DATUM = SY-DATUM
                     ORDER BY DATUM UZEIT.
    RECS = RECS + 1.
  ENDSELECT.

  FCC = SNAP_BEG-FLIST.
  IF FCC-LL CO '0123456789'.
    ASSIGN FCC-ERRID(FCC-LL) TO <F>.
    SNAPT-ERRID = <F>.
  ELSE.
    SNAPT-ERRID = '?????'.
  ENDIF.
  CALL FUNCTION 'SAPWL_GET_SUMMARY_STATISTIC'
*        destination destination
       EXPORTING
            PERIODTYPE                     = 'D'
            HOSTID                         = SY-HOST
            STARTDATE                      = SY-DATUM
       TABLES
            SUMMARY                       = SUMMARY.

       call 'ThVBCall'
         id 'OPCODE' field vb_get_info
         id 'VBINFO' field vbinfo.

       if sy-subrc = 0.
         if vbinfo-vb_active = 1.
           VBSINFO = 'OK'.
         else.
           if vbinfo-autostop = 1.
             VBSINFO = 'Deactivated by system'.
           else.
             VBSINFO = 'Deactivated by user'.
           endif.
         endif.
        ENDIF.

* data fname(60) value '/tmp/sap_status.txt'.
  DATA:OUTPUT_LINE(100).

* open dataset fname for output in text mode.

  MOVE 'SAP system ' TO OUTPUT_LINE.
  MOVE SY-SYSID TO OUTPUT_LINE+12.
  MOVE 'status as at ' TO OUTPUT_LINE+16.
  WRITE SY-DATUM TO OUTPUT_LINE+30(10).
  WRITE SY-UZEIT TO OUTPUT_LINE+41(9).
  CONDENSE OUTPUT_LINE.
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  MOVE 'Users' TO OUTPUT_LINE.
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE: SUM_USR TO OUTPUT_LINE+31(3).
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  MOVE 'Modes' TO OUTPUT_LINE.
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE SUM_MODE TO OUTPUT_LINE+31(3).
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  MOVE 'Free DIA' TO OUTPUT_LINE.
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE FREE_DIA TO OUTPUT_LINE+31(3).
  MOVE 'of ' TO OUTPUT_LINE+34.
  MOVE DIA_JOBS TO OUTPUT_LINE+37(3).
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  MOVE 'Free BTC' TO OUTPUT_LINE.
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE FREE_BTC TO OUTPUT_LINE+31(3).
  MOVE 'of ' TO OUTPUT_LINE+34.
  MOVE BTC_JOBS TO OUTPUT_LINE+37(3).
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  MOVE 'Stopped processes' TO OUTPUT_LINE.
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE STOPPED TO OUTPUT_LINE+31(3).
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  MOVE 'Long running processes' TO OUTPUT_LINE.
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE LONG_RUNNING TO OUTPUT_LINE+31(3).
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  MOVE 'Errors with update records' TO OUTPUT_LINE.
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE VB_COUNTER TO OUTPUT_LINE+31(3).
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  MOVE 'Update status' TO OUTPUT_LINE.
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE VBSINFO TO OUTPUT_LINE+31.
  APPEND OUTPUT_LINE TO INFO.

  IF RECS > 0.
    MOVE 'Short dumps today' TO OUTPUT_LINE.
    MOVE ':' TO OUTPUT_LINE+29.
    MOVE RECS TO OUTPUT_LINE+31(3).
    MOVE 'latest:' TO OUTPUT_LINE+34.
    WRITE SNAP_BEG-UZEIT TO OUTPUT_LINE+42(8).
    MOVE SNAP_BEG-UNAME TO OUTPUT_LINE+51(12).
    MOVE SNAPT-ERRID TO OUTPUT_LINE+64(20).
*   transfer output_line to fname.
    APPEND OUTPUT_LINE TO INFO.
  ELSE.
    MOVE 'Last short dump today' TO OUTPUT_LINE.
    MOVE ':' TO OUTPUT_LINE+29.
    MOVE '(none)' TO OUTPUT_LINE+31(6).
*   transfer output_line to fname.
    APPEND OUTPUT_LINE TO INFO.
  ENDIF.
  LOOP AT SUMMARY.
    TOTAL_COUNT = TOTAL_COUNT + SUMMARY-COUNT.
    TOTAL_RESPTI = TOTAL_RESPTI + SUMMARY-RESPTI.
    TOTAL_QUEUETI = TOTAL_QUEUETI + SUMMARY-QUEUETI.
    IF SUMMARY-LASTRECTI > MAX_TIME.
      MAX_TIME = SUMMARY-LASTRECTI.
    ENDIF.
    IF SUMMARY-TASKTYPE = 'DIALOG' OR SUMMARY-TASKTYPE = 'BCKGRD'.
      LAST_TIME = SUMMARY-LASTRECTI.
      IF SUMMARY-TASKTYPE = 'DIALOG'.
        MOVE 'Dialog steps as at ' TO OUTPUT_LINE.
        WRITE LAST_TIME TO OUTPUT_LINE+19(8).
      ELSE.
        MOVE 'Batch steps as at ' TO OUTPUT_LINE.
        WRITE LAST_TIME TO OUTPUT_LINE+18(8).
      ENDIF.
      MOVE ':' TO OUTPUT_LINE+29.
      MOVE SUMMARY-COUNT TO OUTPUT_LINE+31(6).
      MOVE '(ave ' TO OUTPUT_LINE+38.
      AVE_RESPTI = SUMMARY-RESPTI / SUMMARY-COUNT.
      AVE_QUEUETI = SUMMARY-QUEUETI / SUMMARY-COUNT.
      MOVE AVE_RESPTI TO OUTPUT_LINE+44(5).
      MOVE 'ms, ave wait' TO OUTPUT_LINE+49.
      MOVE AVE_QUEUETI TO OUTPUT_LINE+62(4).
      MOVE 'ms)' TO OUTPUT_LINE+66.
*     transfer output_line to fname.
      APPEND OUTPUT_LINE TO INFO.
    ENDIF.
  ENDLOOP.
  MOVE 'Total steps as at ' TO OUTPUT_LINE.
  WRITE MAX_TIME TO OUTPUT_LINE+18(8).
  MOVE ':' TO OUTPUT_LINE+29.
  MOVE TOTAL_COUNT TO OUTPUT_LINE+31(6).
  MOVE '(ave ' TO OUTPUT_LINE+38.
  AVE_RESPTI = TOTAL_RESPTI / TOTAL_COUNT.
  AVE_QUEUETI = TOTAL_QUEUETI / TOTAL_COUNT.
  MOVE AVE_RESPTI TO OUTPUT_LINE+44(5).
  MOVE 'ms, ave wait' TO OUTPUT_LINE+49.
  MOVE AVE_QUEUETI TO OUTPUT_LINE+62(4).
  MOVE 'ms)' TO OUTPUT_LINE+66.
* transfer output_line to fname.
  APPEND OUTPUT_LINE TO INFO.

  IF SY-DBSYS(6) = 'ORACLE'.
    READ TABLE BACKUP_TAB INDEX 1.
    MOVE 'Last brbackup' TO OUTPUT_LINE.
    MOVE ':' TO OUTPUT_LINE+29.
    WORKRC = BACKUP_TAB-RC.
    WORKDATE = BACKUP_TAB-BEG(8).
    WORKTIME = BACKUP_TAB-BEG+8(6).
    WRITE WORKDATE TO OUTPUT_LINE+31(10).
    SHOW_DATE.
    APPEND OUTPUT_LINE TO INFO.

    READ TABLE ARCHIVE_TAB INDEX 1.
    MOVE 'Last brarchive' TO OUTPUT_LINE.
    MOVE ':' TO OUTPUT_LINE+29.
    WORKRC = ARCHIVE_TAB-RC.
    WORKDATE = ARCHIVE_TAB-BEG(8).
    WORKTIME = ARCHIVE_TAB-BEG+8(6).
    WRITE WORKDATE TO OUTPUT_LINE+31(10).
    SHOW_DATE.
    APPEND OUTPUT_LINE TO INFO.

    WRITE 'Archive space available' TO OUTPUT_LINE.
    MOVE ':' TO OUTPUT_LINE+29.
    WRITE AVAILABLE TO OUTPUT_LINE+31(10).
    APPEND OUTPUT_LINE TO INFO.
  ENDIF.
* close dataset fname.
ENDFUNCTION.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.