REPORT Znadar_dumps message-id sn no standard page heading
line-size 190.
select-options: fecha for sy-datum.
select-options: users for sy-uname.
parameters: hoy as checkbox default ' ',
ayer as checkbox default ' '.
data: begin of snap_h occurs 0,
datum like snap_beg-datum,
uzeit like snap_beg-uzeit,
ahost like snap_beg-ahost,
uname like snap_beg-uname,
mandt like snap_beg-mandt,
modno like snap_beg-modno,
flist like snap_beg-flist,
end of snap_h.
tables: snap,
snap_beg,
snapt,
t100.
tables: tdct, tfdir, funct, trdir.
types: begin of t_msg,
id like sy-msgid,
no like sy-msgno,
v1 like sy-msgv1,
v2 like sy-msgv2,
v3 like sy-msgv3,
v4 like sy-msgv4,
end of t_msg.
*----------- Field Table FT--------------------------------------------*
* *
* FT is filled in BUILT_FT. It contains the SNAP strings, one in each *
* line. Continuation is indicated by Id = '>>'. *
* *
*----------------------------------------------------------------------*
data: begin of ft occurs 1000,
id(2), len type i, value(256),
end of ft.
*----------- RS380: Screen fields--------------------------------------*
data: cerrid like snapt-errid.
data: clinno type i.
data: cinclu like sy-repid.
data: tmp_subpool.
data: begin of rs380,
datum like snap-datum,
uzeit like snap-uzeit,
ahost like snap-ahost,
uname like snap-uname,
mandt like snap-mandt,
modno like snap-modno,
button_today value 'X',
button_yesterday,
button_total,
button_keep,
push_500_list,
push_500_sele,
dumps_today type i,
dumps_yesterday type i,
dumps_total type i,
dumps_hold type i,
snap_used_k type i,
snap_free_k type i,
snap_reorg_days type i,
end of rs380.
*-------------------Status variables -----------------------------------
data: begin of ok, code like sy-ucomm, end of ok.
data: fc like ok-code.
data: init. " INIT = 'X' iff snapshot already imported
data: print_active.
data: rabax_active.
*-------------------Shared variables / tables---------------------------
data: snap_error(60).
data: continuation(120).
data: begin of text_in occurs 400,
line(72),
end of text_in.
data: begin of text_out occurs 400,
line(79),
end of text_out.
* List index
data: begin of list_index occurs 100,
text(80), linno type i,
end of list_index.
* Structure of ENV (Environment), SNAP Id EN
data: begin of env,
saprl(6), "SAP-Release
opsys(16), "Operating System
mtype(16), "Maschinentyp (Workprozess)
whost(20), "Hostname (Workprozess)
dbtyp(20), "Datenbanktyp (Oracle, ...)
dbnam(20), "Datenbankname
dhost(20), "Datenbankhostname
dbown(20), "Datenbankowner
codep(4), "Systemcodepage (zur Zeit leer)
oprel(20), "Betriebssystem-Release
ctype(20), "character type (LC_CTYPE)
compi(30), "Compile time
end of env.
* Structure of SNAP_ID: US (User Data)
data: begin of usr,
mandt(3), "SAP-Mandant
uname(12), "Benutzername
spras(1), "Anmeldesprache
codep(4), "Benutzercodepage (zur Zeit leer)
end of usr.
* Structure of statusinfo
data : begin of statusinfo,
state(1),
gen(1),
btci(1),
memo(1),
defect(1),
btcidt(1),
warning(1),
end of statusinfo.
*-------------------Ranges (Snaplist) ----------------------------------
ranges:
s_datum for snap-datum,
s_uzeit for snap-uzeit,
s_ahost for snap-ahost,
s_uname for snap-uname,
s_mandt for snap-mandt,
s_xhold for snap-xhold,
s_errid for snapt-errid.
data: s_activated(1).
data: loaded_program like sy-repid.
* Aufrufstack extrahieren fr nachfolgende Programmgenerierung
data: begin of stack occurs 0,
prog like sy-repid,
end of stack.
* Messagevariable bei GENERATE REPORT
data mess(100).
tables: usr21, adrp.
DATA: BEGIN OF dnis ocCURS 0,
DNI(10), "Slo pueden tener 3 posiciones
NOM(40), "Slo pueden tener 3 posiciones
END OF dnis.
data: bi_tab like bdcdata occurs 0 with header line,
bi_err like BDCMSGCOLL occurs 0 with header line,
bi_mod(1) value 'E'.
initialization.
fecha-sign = 'I'.
fecha-option = 'BT'.
fecha-high = sy-datum.
append fecha.
SELECT * FROM USR21.
SELECT SINGLE * FROM ADRP WHERE PERSNUMBER = USR21-PERSNUMBER.
dnis-DNI = USR21-BNAME.
CONCATENATE ADRP-NAME_FIRST ADRP-NAME_LAST INTO dnis-NOM
SEPARATED BY ' '.
CONDENSE dnis-NOM.
APPEND dnis.
ENDSELECT.
include <icon>.
at line-selection.
data: cf,
prg(32),
v03 like sy-lisel.
.
if sy-lsind = 1.
perform load_dump.
elseif sy-lsind = 2.
clear cf.
if sy-lisel cp '*program "*'.
cf = 'E'. perform trimea using 'program "' changing prg.
endif.
if sy-lisel cp '*program was "*' and cf is initial.
cf = 'E'. perform trimea using 'program was "' changing prg.
endif.
if sy-lisel cp '*programs "*' and cf is initial.
cf = 'E'. perform trimea using 'programs "' changing prg.
endif.
if sy-lisel cp '*function module "*' and
cf is initial.
cf = 'F'.
perform trimea using 'function module "' changing prg.
endif.
clear bi_tab. refresh bi_tab.
case cf.
when 'E'.
perform dynpro using: 'X' 'SAPLWBABAP' '0100',
' ' 'RS38M-PROGRAMM' prg,
' ' 'RS38M-FUNC_EDIT' 'X',
' ' 'BDC_OKCODE' '=SHOP'.
call transaction 'SE38' using bi_tab mode bi_mod.
when 'F'.
perform dynpro using: 'X' 'SAPMS38L' '1009',
' ' 'RS38L-NAME' prg,
' ' 'BDC_OKCODE' '=SHOW'.
call transaction 'SE37' using bi_tab mode bi_mod.
endcase.
endif.
end-of-selection.
if hoy = 'X' or ayer = 'X'. clear fecha. refresh fecha. endif.
if hoy = 'X'.
fecha-sign = 'I'.
fecha-option = 'EQ'.
fecha-low = sy-datum.
append fecha.
endif.
if ayer = 'X'.
fecha-sign = 'I'.
fecha-option = 'EQ'.
fecha-low = sy-datum - 1.
append fecha.
endif.
perform load_header.
perform write_header_2.
form trimea using cadena
changing salida.
data: bkp like sy-lisel,
ax(2) type n.
bkp = sy-lisel.
search bkp for cadena.
ax = strlen( cadena ).
ax = sy-fdpos + ax.
shift bkp left by ax places.
shift bkp left deleting leading ' '.
search bkp for '"'.
ax = 0.
salida = bkp+ax(sy-fdpos).
endform.
form dynpro using l_dynbegin l_name l_value.
clear bi_tab.
if not l_dynbegin is initial.
bi_tab-program = l_name.
bi_tab-dynpro = l_value.
bi_tab-dynbegin = l_dynbegin.
else.
bi_tab-fnam = l_name.
bi_tab-fval = l_value.
endif.
append bi_tab.
endform.
form load_dump.
rs380-datum = snap_h-datum.
rs380-DATUM = snap_h-DATUM.
rs380-UZEIT = snap_h-UZEIT.
rs380-UNAME = snap_h-UNAME.
rs380-AHOST = snap_h-AHOST.
rs380-MODNO = snap_h-MODNO.
rs380-MANDT = snap_h-MANDT.
clear: ft, cerrid, cinclu, clinno, env, usr.
refresh: ft.
perform build_ft.
perform set_variable using:
'FC' cerrid, "Current error id
'AI' cinclu, "Current include
'AL' clinno, "Current line number
'EN' env, "Environment
'US' usr. "User dara
SY-PFKEY = ' '.
clear SY-UCOMM.
perform:
display_short_text,
display_user_explanation,
* display_user_hints,
display_error_description.
* display_hints.
perform:
* display_files,
* display_environment,
display_transaction,
display_position,
display_source_code,
display_system_fields,
display_variables.
* display_event_stack,
* display_internal_hints,
* display_c_stack,
* display_spool,
* display_loaded_programs.
* display_pxa,
* display_internal_tables,
* display_work_areas,
* display_storage,
* display_cont_cbs,
* display_end_of_list.
endform.
form load_header.
data: ax type i,
bx type i.
select count(*) from snap_beg where
datum in fecha and
seqno = '000'.
ax = sy-dbcnt.
select count(*) from snap_beg where
datum in fecha and
uname = sy-uname and
seqno = '000'.
bx = sy-dbcnt.
RS380-DATUM = sy-datum.
RS380-UZEIT = sy-uzeit.
Write: / 'Total Dumps ', bx, ' de ', ax.
endform.
form write_header_2.
data eax(3) type n.
select * from snap_beg into corresponding fields of table snap_h
where datum in fecha and
seqno = '000'.
sort snap_h by datum descending uzeit descending.
loop at snap_h.
at first.
uline /001(122).
endat.
check snap_h-uname in users.
shift snap_h-flist left by 2 places.
eax = snap_h-flist+0(3).
shift snap_h-flist left by 3 places.
snap_h-flist = snap_h-flist+0(eax).
eax = strlen( snap_h-flist ).
if sy-uname = snap_h-uname.
format color col_heading on.
elseif sy-datum = snap_h-datum.
format color col_total on.
endif.
write: /001 sy-vline, '@10@' as icon hotspot.
if hoy = 'X' or ayer = 'X'.
else.
write: sy-vline, snap_h-datum.
endif.
write: sy-vline, snap_h-uzeit,
* sy-vline, snap_h-ahost(12),
sy-vline.
write: snap_h-uname(12).
data: falsonom like dnis-nom.
if snap_h-uname ne dnis-dni.
read table dnis with key dni = snap_h-uname.
if sy-subrc ne 0.
clear dnis-nom.
endif.
falsonom = dnis-nom.
else.
falsonom = ' " "'.
endif.
write:" sy-vline, snap_h-mandt,
sy-vline,
* snap_h-modno,
snap_h-flist+0(30),
sy-vline,
falsonom.
if sy-uname = snap_h-uname.
format color col_heading off.
elseif sy-datum = snap_h-datum.
format color col_total off.
endif.
write at 122 sy-vline.
hide: snap_h-datum,
snap_h-uzeit,
snap_h-ahost,
snap_h-uname,
snap_h-mandt,
snap_h-modno.
endloop.
if sy-subrc eq 0 . uline /001(122). endif.
endform.
include MS380I10.
include MS380O10.
include MS380F10.
include MS380F20.