Web Servis Log/Günlük Programı
Servis ayarlarından tüm loglar(başarılı/başarısız) kaydedilecek şekilde ayarlı ise aşağıdaki tablolar dolacaktır.
SRT_UTIL_ERRLOG
SRT_MONLOG_DATA2
Program SRT_MONLOG_DATA2 tablosundaki kayıtların toplamını veya detayını verir.
*&---------------------------------------------------------------------*
*& Report ZTR_WEB_SERVICE_LOG
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
*&
*&ztr_s_ws_001
*&USERNAME Types SYUNAME CHAR 12 0 R/3-Sistemi, kullanıcının bağlantı adı
*&CALLEDPROG Types ZTR_E_WS_CALLEDPROG CHAR 255 0 Called Prog
*&COMM_PATT Types ZTR_E_WS_COMM_PATT CHAR 255 0 Comm Patt
*&DURATION Types ZTR_E_WS_DURATION INT4 10 0 Duration
*&COUNTER Types ZTR_E_WS_COUNTER INT4 10 0 Counter
*&RESP_SIZE Types ZTR_E_WS_RESP_SIZE INT4 10 0 Response Size
*&
report ztr_web_service_log.
tables: ztr_s_ws_001.
types: begin of ty_monlog,
call_id type srt_moni_id,
ts_call type timestampl,
username type syuname ,
complete type ztr_e_ws_complete,
calledprog type ztr_e_ws_calledprog,
comm_patt type ztr_e_ws_comm_patt,
duration type ztr_e_ws_duration,
resp_size type ztr_e_ws_resp_size,
end of ty_monlog.
types: tty_monlog type sorted table of ty_monlog with unique key call_id.
data: gt_monlog type tty_monlog.
data: gt_monlog_std type standard table of ty_monlog.
types : ty_monlog_total type ztr_s_ws_001.
types : tty_monlog_total type sorted table of ztr_s_ws_001 with unique key username calledprog comm_patt.
data: gt_total type tty_monlog_total.
data: gt_total_std type standard table of ty_monlog_total.
parameters: p_detail type c radiobutton group rtyp,
p_total type c radiobutton group rtyp.
parameters: p_bastar type sy-datum default sy-datum,
p_sontar type sy-datum default sy-datum.
parameters: p_basst type sy-uzeit default `000000`,
p_sonst type sy-uzeit default `235959`.
select-options: s_user for ztr_s_ws_001-username default `WSUSER`,
s_cprog for ztr_s_ws_001-calledprog default `ZXXX_SERVICE` .
start-of-selection.
perform f_get_data.
end-of-selection.
if gt_monlog_std[] is initial.
message `Kayıt bulunamadı` type `I`.
else.
case `X`.
when p_total.
perform f_display_alv tables gt_total_std using `Toplam`.
when p_detail.
perform f_display_alv tables gt_monlog_std using `Detay`.
endcase.
endif.
*&---------------------------------------------------------------------*
*& Form f_get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form f_get_data.
data: lv_start type timestampl.
data: lv_end type timestampl.
data: ls_monlog like line of gt_monlog.
data: ls_total like line of gt_total.
refresh gt_monlog.
refresh gt_monlog_std.
refresh gt_total.
refresh gt_total_std.
convert date p_bastar
time p_basst
into time stamp lv_start time zone sy-zonlo .
convert date p_sontar
time p_sonst
into time stamp lv_end time zone sy-zonlo .
lv_end = lv_end + `0.9999999`.
select call_id
ts_call
username
complete
calledprog
comm_patt
duration
resp_size
into table gt_monlog
from srt_monlog_data2
where ts_call between lv_start and lv_end
and username in s_user
and calledprog in s_cprog.
gt_monlog_std[] = gt_monlog[].
case `X`.
when p_total.
loop at gt_monlog into ls_monlog.
move-corresponding ls_monlog to ls_total.
ls_total-counter = 1.
collect ls_total into gt_total.
endloop.
gt_total_std[] = gt_total[].
endcase.
endform. "f_get_data
*&---------------------------------------------------------------------*
*& Form f_display_alv
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->PRT_TABLE text
* -->PRM_TITLE text
*----------------------------------------------------------------------*
form f_display_alv tables prt_table
using prm_title.
data: lv_title type string.
lv_title = prm_title.
call function `ZTR_POPUPALV`
exporting
i_title = lv_title
i_popup = space
tables
it_alv = prt_table.
endform. "f_display_alv