ABAP顾问
分类:
2007-07-09 14:44:22
REPORT z_barry_server_list .
DATA: hosts LIKE msxxlist OCCURS 0 WITH HEADER LINE .
DATA: rfcsi_export LIKE rfcsi.
DATA: hex TYPE x,
dec TYPE i,
dec_char(3) TYPE c,
n TYPE i,
ip(16) .
CALL FUNCTION 'RFC_GET_LOCAL_SERVERS'
TABLES
hosts = hosts
EXCEPTIONS
not_available = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT hosts.
DO 4 TIMES.
n = sy-index - 1.
hex = hosts-hostadr+n(1).
dec = hex .
dec_char = dec.
CONCATENATE ip '.' dec_char INTO ip.
ENDDO.
SHIFT ip.
WRITE: / hosts-name,
hosts-host,
hosts-serv,
(2) hosts-msgtypes,
(8) hosts-hostadr,
ip,
(4) hosts-servno.
HIDE: hosts-name,hosts-host.
ENDLOOP.
AT LINE-SELECTION.
CALL FUNCTION 'RFC_SYSTEM_INFO' DESTINATION hosts-name
IMPORTING
rfcsi_export = rfcsi_export .
WRITE / : rfcsi_export-rfcproto,
rfcsi_export-rfcchartyp,
rfcsi_export-rfcinttyp,
rfcsi_export-rfcflotyp,
rfcsi_export-rfcdest,
rfcsi_export-rfchost,
rfcsi_export-rfcsysid,
rfcsi_export-rfcdatabs,
rfcsi_export-rfcdbhost,
rfcsi_export-rfcdbsys,
rfcsi_export-rfcsaprl,
rfcsi_export-rfcmach,
rfcsi_export-rfcopsys,
rfcsi_export-rfctzone,
rfcsi_export-rfcdayst,
rfcsi_export-rfcipaddr,
rfcsi_export-rfckernrl,
rfcsi_export-rfchost2,
rfcsi_export-rfcsi_resv.