This real time scenarios related to plant maintenance
Issue.: Break Down already exist but system allow to enter new break down for same machine which is already in issue state so one issue closed then new break down create .
Steps to Handle the notification .
1.Create Project in Tcode CMOD.
2 .Assign the Enhancement QQMA0014.
3.function module EXIT_SAPMIWO0_020
4. Open include ( but when u click it showing warring after getting warring press enter then ask you create include )
5. Use code
DATA: it_JEST TYPE TABLE OF JEST,
S_VIQMEL TYPE VIQMEL,
IT_VIQMEL TYPE TABLE OF VIQMEL.
MOVE E_VIQMEL TO S_VIQMEL.
IF SY-TCODE EQ 'IQS21'.
SELECT * FROM VIQMEL INTO TABLE IT_VIQMEL WHERE EQUNR EQ S_VIQMEL-EQUNR.
sort IT_VIQMEL DESCENDING BY AUSVN MZEIT.
DELETE ADJACENT DUPLICATES FROM IT_VIQMEL COMPARING EQUNR.
IF IT_VIQMEL IS NOT INITIAL .
SELECT * FROM JEST INTO TABLE IT_JEST FOR ALL ENTRIES IN IT_VIQMEL WHERE OBJNR EQ IT_VIQMEL-OBJNR AND STAT IN ('I0068', 'I0070') AND INACT NE 'X'.
IF SY-SUBRC EQ 0.
MESSAGE 'BD ALREADY EXIST' TYPE 'I'.
LEAVE PROGRAM.
ENDIF .
ENDIF.
ENDIF.
Issue.: Break Down already exist but system allow to enter new break down for same machine which is already in issue state so one issue closed then new break down create .
Steps to Handle the notification .
1.Create Project in Tcode CMOD.
2 .Assign the Enhancement QQMA0014.
3.function module EXIT_SAPMIWO0_020
4. Open include ( but when u click it showing warring after getting warring press enter then ask you create include )
5. Use code
DATA: it_JEST TYPE TABLE OF JEST,
S_VIQMEL TYPE VIQMEL,
IT_VIQMEL TYPE TABLE OF VIQMEL.
MOVE E_VIQMEL TO S_VIQMEL.
IF SY-TCODE EQ 'IQS21'.
SELECT * FROM VIQMEL INTO TABLE IT_VIQMEL WHERE EQUNR EQ S_VIQMEL-EQUNR.
sort IT_VIQMEL DESCENDING BY AUSVN MZEIT.
DELETE ADJACENT DUPLICATES FROM IT_VIQMEL COMPARING EQUNR.
IF IT_VIQMEL IS NOT INITIAL .
SELECT * FROM JEST INTO TABLE IT_JEST FOR ALL ENTRIES IN IT_VIQMEL WHERE OBJNR EQ IT_VIQMEL-OBJNR AND STAT IN ('I0068', 'I0070') AND INACT NE 'X'.
IF SY-SUBRC EQ 0.
MESSAGE 'BD ALREADY EXIST' TYPE 'I'.
LEAVE PROGRAM.
ENDIF .
ENDIF.
ENDIF.