Вылечили такой программой:
report z_jobs_wo_variant.
data:
lt_jobs type table of tbtcp,
lt_valtab type table of rsparams.
field-symbols:
<lfs_job> like line of lt_jobs.
parameters: p_delete type abap_bool.
select
j~progname
, j~variant
, j~jobcount
, j~jobname
from tbtcp as j
join tbtco as js
on j~jobname = js~jobname
and j~jobcount = js~jobcount
and js~status = 'S'
into corresponding fields of table @lt_jobs
where progname = 'RSPROCESS'.
loop at lt_jobs
assigning <lfs_job>.
call function 'RS_VARIANT_CONTENTS'
exporting
report = <lfs_job>-progname
variant = <lfs_job>-variant
execute_direct = 'X'
tables
valutab = lt_valtab
exceptions
others = 1.
if sy-subrc <> 0.
write: / <lfs_job>-jobname, <lfs_job>-jobcount.
if p_delete = abap_true.
call function 'BP_JOB_DELETE'
exporting
jobcount = <lfs_job>-jobcount
jobname = <lfs_job>-jobname
exceptions
others = 1.
if sy-subrc <> 0.
write 'not deleted'.
else.
write 'successfully deleted'.
endif.
endif.
endif.
endloop.
report z_jobs_wo_variant.
data:
lt_jobs type table of tbtcp,
lt_valtab type table of rsparams.
field-symbols:
<lfs_job> like line of lt_jobs.
parameters: p_delete type abap_bool.
select
j~progname
, j~variant
, j~jobcount
, j~jobname
from tbtcp as j
join tbtco as js
on j~jobname = js~jobname
and j~jobcount = js~jobcount
and js~status = 'S'
into corresponding fields of table @lt_jobs
where progname = 'RSPROCESS'.
loop at lt_jobs
assigning <lfs_job>.
call function 'RS_VARIANT_CONTENTS'
exporting
report = <lfs_job>-progname
variant = <lfs_job>-variant
execute_direct = 'X'
tables
valutab = lt_valtab
exceptions
others = 1.
if sy-subrc <> 0.
write: / <lfs_job>-jobname, <lfs_job>-jobcount.
if p_delete = abap_true.
call function 'BP_JOB_DELETE'
exporting
jobcount = <lfs_job>-jobcount
jobname = <lfs_job>-jobname
exceptions
others = 1.
if sy-subrc <> 0.
write 'not deleted'.
else.
write 'successfully deleted'.
endif.
endif.
endif.
endloop.
Комментариев нет:
Отправить комментарий