SAP COFC错误信息记录删除

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

oss note 530174 - In the 'Reprocessing of confirmations with errors in calc.CO 提供了一个删除的程序,代码如下:

*&---------------------------------------------------------------------*

*& Report ZCOFC_CANC_NEW

*&---------------------------------------------------------------------*

report zcofc_canc_new.

tablesafrc.

datai_afrc like afrc occurs with header line.

datai_afru like afru occurs with header line.

datatmp_kokrs like caufv-kokrs.

datatmp_bukrs like caufv-kokrs.

datai_postdate like afru-budat.

dataierr like confer.

datalocked type c.

dataflg_succ type c.

datal_caufv type caufv.

typesbegin 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.

datalst_table type lst_table occurs with header line.

include<icon>.

selection-screen begin of block sel1 with frame title text-001.

  select-optionsorder for afrc-aufnr.

  parametersautyp like afrc-autyp obligatory.

  parameterspostdate like afru-budat default sy-datum.

  parameterstest default 'X'.

  parameterslog 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 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.

      writeicon_green_light,text-003,lst_table-rueck,text-004,

lst_table-rmzhl.

      write:at /6 lst_table.

    else.

      writeicon_red_light,text-003,lst_table-rueck,text-004,

lst_table-rmzhl.

      write:at /6 lst_table.

    endif.

    uline.

  endloop.

endif.

维护文本元素:

使用方法

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值