COFC的错误信息记录,在标准功能下面是不能删除的:

oss note 530174 - In the 'Reprocessing of confirmations with errors in calc.CO 提供了一个删除的程序,代码如下:
*&---------------------------------------------------------------------*
*& Report ZCOFC_CANC_NEW
*&---------------------------------------------------------------------*
report zcofc_canc_new.
tables: afrc.
data: i_afrc like afrc occurs 0 with header line.
data: i_afru like afru occurs 0 with header line.
data: tmp_kokrs like caufv-kokrs.
data: tmp_bukrs like caufv-kokrs.
data: i_postdate like afru-budat.
data: ierr like confer.
data: locked type c.
data: flg_succ type c.
data: l_caufv type caufv.
types: begin of lst_table,
rueck like afru-rueck,
rmzhl like afru-rmzhl,
message_id like confer-message_id,
message_no like confer-message_no,
msg_type like confer-msg_type,
message_text like confer-message_text,
succ type c,
end of lst_table.
data: lst_table type lst_table occurs 0 with header line.
include: <icon>.
selection-screen begin of block sel1 with frame title text-001.
select-options: order for afrc-aufnr.
parameters: autyp like afrc-autyp obligatory.
parameters: postdate like afru-budat default sy-datum.
parameters: test default 'X'.
parameters: log default 'X'.
selection-screen end of block sel1.
if autyp is initial.
write:/ text-002.
exit.
endif.
select * from afrc into table i_afrc
where autyp eq autyp and
aufnr in order.
check not i_afrc[] is initial.
sort i_afrc by rueck rmzhl.
select * from afru into table i_afru for all entries in i_afrc
where rueck eq i_afrc-rueck and
rmzhl eq i_afrc-rmzhl and
stokz eq ' ' and
stzhl eq '00000000'.
check not i_afru[] is initial.
sort i_afru by rueck rmzhl.
* Cancelation of confirmations setting posting date if needed
loop at i_afru.
clear tmp_kokrs.
select single * into l_caufv from caufv
where aufpl eq i_afru-aufpl.
tmp_kokrs = l_caufv-kokrs.
tmp_bukrs = l_caufv-bukrs.
check not tmp_kokrs is initial.
* Posting period closed ?
call function 'CO_RU_CHECK_PERIOD_BLOCKED'
exporting
budat_imp = i_afru-budat
kokrs_imp = tmp_kokrs
bukrs_imp = tmp_bukrs
exceptions
period_blocked = 1
others = 2.
if sy-subrc eq 1 and not postdate is initial.
i_postdate = postdate.
else.
clear i_postdate.
endif.
call function 'CO_RI_CONFIRMATION_CANCEL'
exporting
confirmation_number = i_afru-rueck
confirmation_counter = i_afru-rmzhl
confirmation_postdat = i_postdate
test = test
importing
errors = ierr
already_locked = locked
successfully_canceled = flg_succ
exceptions
already_canceled = 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.
if not locked is initial.
append i_afru.
continue.
endif.
lst_table-rueck = i_afru-rueck.
lst_table-rmzhl = i_afru-rmzhl.
lst_table-message_id = ierr-message_id.
lst_table-message_no = ierr-message_no.
lst_table-msg_type = ierr-msg_type.
lst_table-message_text = ierr-message_text.
lst_table-succ = flg_succ.
append lst_table.
endloop.
if not log is initial.
loop at lst_table.
if not lst_table-succ is initial.
write: icon_green_light,text-003,lst_table-rueck,text-004,
lst_table-rmzhl.
write:at /6 lst_table.
else.
write: icon_red_light,text-003,lst_table-rueck,text-004,
lst_table-rmzhl.
write:at /6 lst_table.
endif.
uline.
endloop.
endif.
维护文本元素:

使用方法


没有问题,去掉测试模式执行。

156

被折叠的 条评论
为什么被折叠?



