프로그래밍/SAP ABAP

[SAP/PM] 통지 1234578 : 불일치 단계/상태 관리

2021. 7. 26. 14:01

통지리스트   T-CODE : IW22

 

** 통지 1234578 : 불일치 단계/상태 관리  

  ▷ SAP Note 2641810 적용해야 함.

 

pm : IW22  -> Notice xxxxxxxx : Inconsistency Phase/Status Management

 

메시지 번호 IM285

Diagnosis

For notification &v1& there is an inconsistency between the notification phase (QMEL-PHASE) and status management.

Refer to note 551133 about the notification phase.

 

System Response

The transaction fails.

 

Procedure

If the data inconsistency exists at database level, then you can remove the data inconsistency by using the repair report in note 2641810.

 

Procedure for System Administration

Create an OSS message, so that SAP can determine the cause of the data inconsistency.

------

 

<참조> https://blogs.sap.com/2021/04/12/inconsistency-phase-status-management/

<S4/HANA> The field QMEL-PHASE should contain any value from the below list:

 

To correct this, you need to implement SAP Note 2641810 – EAM notification/QM notification/PS notification: Inconsistencies: Notification phase/status management.

This note contains an executable program which goes to QMEL table and update field PHASE of each notification, based on active status in table JEST for the OBJNR.

The correction program works on below logic of JEST-STAT:

If JEST-STAT = I0068.

1 is updated in QMEL-PHASE.

If JEST-STAT = I0069.

2 is updated in QMEL-PHASE.

If JEST-STAT = I0070.

3 is updated in QMEL-PHASE.

If JEST-STAT = I0072.

4 is updated in QMEL-PHASE.

If JEST-STAT = I0076.

5 is updated in QMEL-PHASE.

 

<참조> https://blogs.sap.com/2016/04/25/have-you-ever-been-pilot-released/

 

 

>>>

 

SAP Note 2641810  EAM notification/QM notification/PS notification 현재 'Pilot Released' 상태로,
SAP Support Portal snote 통해 조회/적용이 불가능하고 Incidents 작성을 통해 SAP에서 직접 지원을 받아야 함.

 

** notification phase/status management 프로그램

[사용방법]
1. se38 : ZEAM_NOT_PHASE_01 Report 실행
2. 'Test Mode'  지시자는 기본 값으로 설정되어 있음
3. 'Test Mode' 실행 , Database 변경하지 않고 불일치 데이터만 표시함
4. 불일치 데이터를 수정하려면 'Test Mode' 지시자 설정 해제  실행
5. 'Dictionary Ref' Parameter 특정 EAM/QM Notification, PS Claim 대상으로 지정할 사용하며
공백으로 경우, 전체 데이터를 대상으로 선정함

 

 

* Program : ZEAM_NOT_PHASE_01 

 

*&---------------------------------------------------------------------*
*& Report ZPM_NOT_PHASE_01
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
* This report check PHASE for EAM or QM notifications or PS-Claims
* PHASE have to correspond with corresponding status management data
*
* Phase functionality must be activated for notifications
* --> note 551133
*
* Select-Options S_QMNUM :
* - you can restrict by notification number
* - set flag dictionary reference for this text element
*
* Parameter P_TEST :
* - P_TEST =  SPACE -> update mode
* - P_TEST <> SPACE -> test mode
* - only in update mode the report will make database changes
* - set text "Test Mode" for this text element
*
* Parameter P_EAM :
* choose this parameter mean check EAM notifications
* - set text "EAM" for this text element*
*
* Parameter P_QM :
* choose this parameter mean check QM notifications
* - set text "QM" for this text element*
*
* Parameter P_PS :
* choose this parameter mean check PS-Claim
* - set text "PS" for this text element*
*
* List output columns :
* - Notification number  -> notification number
* - actual phase         -> actual phase by QMEL-IPHAS
* - correct phase        -> correct phase by status management
*
* only in update mode actual phase will be corrected by correct phase
*
* Before use this report in update mode within productive system do
* tests in an orderly manner within a quality system !!!!!
*
* This report replace report ZPM_NOT_PHASE_01 of note 554474 !


REPORT  ZEAM_NOT_PHASE_01.

  tablesqmel,jest.
  tablesPMFLAGS,tq80.

  rangesr_qmart for qmel-qmart.

  select-options s_qmnum for qmel-qmnum.

  parameters P_EAM  radiobutton group NTYP,
               P_QM   radiobutton group NTYP,
               P_PS   radiobutton group NTYP.

  parameters p_testl    type default 'X'.

  data l_retcd                        like sy-subrc,
         l_phase                        like qmel-phase,
         l_counter_bad_qmel             type p.

  data begin of int_qmel occurs 0,
           qmnum     like qmel-qmnum,
           objnr     like qmel-objnr,
           phase     like qmel-phase,
           l_phase   like qmel-phase,
         end of int_qmel.

SELECT SINGLE FROM pmflags.
if pmflags-flag03 <> 'X'.
  write 'notification phase is not active'.
  write 'check note 551133'.
  stop.
endif.

r_qmart-sign 'I'.
r_qmart-option 'EQ'.
if p_eam 'X'.
* check EAM notifications
  select from tq80 where qmtyp '01'     "PM
                        or qmtyp '03'.    "CS
    r_qmart-low tq80-qmart.
    append r_qmart.
  endselect.
elseif p_qm 'X'.
* check QM notifications
  select from tq80 where qmtyp '02'.    "QM
    r_qmart-low tq80-qmart.
    append r_qmart.
  endselect.
elseif p_ps 'X'.
* check PS-CLaim
  select from tq80 where qmtyp '04'.    "PS
    r_qmart-low tq80-qmart.
    append r_qmart.
  endselect.
else.
* should not be
  write 'No notification category researched.'.
  stop.
endif.

select qmnum objnr phase
  from qmel
  into corresponding fields of table INT_QMEL
 where qmnum in s_qmnum
   and qmart in r_qmart.

loop at int_qmel.

* Status L?chvormerkung aktiv ?
  perform status_check using 'I0076' int_qmel-objnr l_retcd.
  if l_retcd 0.
    int_qmel-l_phase '5'.
    modify int_qmel.
    continue.
  endif.
* Status Abgschlossen aktiv ?
  perform status_check using 'I0072' int_qmel-objnr l_retcd.
  if l_retcd 0.
    int_qmel-l_phase '4'.
    modify int_qmel.
    continue.
  endif.
* Status In Arbeit aktiv ?
  perform status_check using 'I0070' int_qmel-objnr l_retcd.
  if l_retcd 0.
    int_qmel-l_phase '3'.
    modify int_qmel.
    continue.
  endif.
* Status Zurueckgestellt aktiv ?
  perform status_check using 'I0069' int_qmel-objnr l_retcd.
  if l_retcd 0.
    int_qmel-l_phase '2'.
    modify int_qmel.
    continue.
  endif.
* Status Offen aktiv ?
  perform status_check using 'I0068' int_qmel-objnr l_retcd.
  if l_retcd 0.
    int_qmel-l_phase '1'.
    modify int_qmel.
    continue.
  endif.
endloop.

write 'PHASE for following notifications not correct :'.
write 'notification','actual phase','correct phase'.

loop at int_qmel.
  check int_qmel-phase <> int_qmel-l_phase.
  l_counter_bad_qmel l_counter_bad_qmel + 1.
  write /     int_qmel-qmnum,
             18 int_qmel-phase,
             30 int_qmel-l_phase.
  if p_testl ' '.
    update qmel set phase int_qmel-l_phase
              where qmnum int_qmel-qmnum.
    if sy-subrc <> 0.
      write 'error update qmel',int_qmel-qmnum.
    endif.
  endif.
endloop.

skip 5.
write 'number of incorrect notifications :'l_counter_bad_qmel.

Form status_check using p_stat  like jest-stat
                        p_objnr like qmel-objnr
                        p_retcd like sy-subrc.

  p_retcd 0.

  CALL FUNCTION 'STATUS_CHECK'
    EXPORTING
      objnr             p_objnr
      status            p_stat
    EXCEPTIONS
      object_not_found  01
      status_not_active 02.

  p_retcd sy-subrc.

endform.