report znadar_sm50 line-size 110 no standard page heading.
constants: opcode_wp_stop(1) type x value 2,
opcode_wp_debug(1) type x value 6.
data: wp_tabl like wpinfo occurs 0 with header line,
bkp like wpinfo occurs 0 with header line,
begin of conta occurs 0,
WP_TYP like bkp-WP_TYP,
ecx type i,
end of conta.
at line-selection.
clear bkp. refresh bkp.
do.
read line sy-index.
if sy-subrc ne 0. exit. endif.
check sy-lisel+0(1) = 'X'.
bkp = wp_tabl.
append bkp.
enddo.
* Matix Reload
if sy-cucol >= 02 and sy-cucol <= 10.
sy-LSIND = 0. perform load_Data.
endif.
* DON'T STOP ME
if sy-cucol >= 14 and sy-cucol <= 17. perform stop. endif.
* ¿ Quieres la pastilla azul o la roja ?
if sy-cucol >= 21 and sy-cucol <= 25. perform debug_me. endif.
end-of-selection.
perform load_Data.
form load_data.
data: with_cpu type x value 0,
nom(30),
ape(160).
clear conta. refresh conta.
call function 'TH_WPINFO'
EXPORTING WITH_CPU = with_cpu
tables wplist = wp_tabl
EXCEPTIONS SEND_ERROR = 1
OTHERS = 2.
loop at wp_tabl.
clear conta.
conta-WP_TYP = wp_tabl-WP_TYP.
conta-ecx = 1.
collect conta.
check wp_tabl-WP_BNAME is initial.
delete wp_tabl.
endloop.
loop at wp_tabl.
at first.
write: / 'Refrescar' hotspot on color col_total, sy-vline,
'STOP' hotspot on color col_total, sy-vline,
'DEBUG' hotspot on color col_total, sy-vline.
loop at conta.
write conta-ecx to nom.
if conta-ecx is initial. nom = '0'. endif.
concatenate ape conta-WP_TYP ':' nom '|'
into ape separated by ' '.
condense ape.
endloop.
write: ape(60) color col_positive.
uline /001(120).
endat.
if wp_tabl-WP_BNAME = sy-uname.
format color col_heading.
else.
format color col_normal.
endif.
clear syst-FTYPE.
write: / syst-FTYPE as checkbox,
wp_tabl-WP_TYP,
wp_tabl-WP_MANDT,
wp_tabl-WP_BNAME,
wp_tabl-WP_ELTIME,
wp_tabl-WP_REPORT,
wp_tabl-WP_TABLE,
wp_tabl-WP_ACTION.
hide: syst-FTYPE, wp_tabl.
select single p~name_first p~name_last into (nom, ape)
from usr21 as f inner join adrp as p on f~persnumber = p~persnumber
where f~BNAME = wp_tabl-WP_BNAME.
concatenate nom ape into ape separated by ' '.
condense ape.
write: / ape(30) under wp_tabl-WP_BNAME.
clear ape.
select single text into ape from trdirt
where name = wp_tabl-WP_REPORT
and sprsl = sy-langu.
write: ape(30) under wp_tabl-WP_REPORT.
clear ape.
select single ddtext into ape from dd02t
where tabname = wp_tabl-WP_TABLE
and ddlanguage = sy-langu.
write: ape(30) under wp_tabl-WP_TABLE.
uline /001(120).
endloop.
endform.
form stop.
perform decide using 'Matar el proceso'.
check syst-FTYPE = 'J'.
loop at bkp.
CALL 'ThWpInfo' ID 'OPCODE' FIELD OPCODE_WP_STOP
ID 'PID' FIELD bkp-WP_PID.
check SY-SUBRC eq 0.
MESSAGE S398(00) WITH 'Proceso ' bkp-WP_PID ' cancelado'.
endloop.
endform.
form debug_me.
perform decide using 'Depurar el proceso'.
check syst-FTYPE = 'J'.
loop at bkp.
call 'ThWpInfo' id 'OPCODE' field opcode_wp_debug
id 'WP_INDEX' field bkp-wp_index.
exit.
endloop.
endform.
form decide using txt.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING TEXTLINE1 = txt
TITEL = 'RED ALERT'
IMPORTING ANSWER = syst-FTYPE.
endform.