cancel
Showing results for 
Search instead for 
Did you mean: 

Malfunction End date and time mandatory while TECO

Former Member
0 Kudos

Hi experts

Scenario is while doing TECO for maintenance order system should pop up error massage End date and Time is mandatory.

I checked with T code OIAL in influencing, here I am getting malfunction end date mandatory in change mode i.e in IW32. but scenario is, if user want to change order that time again system will ask to fill End date and Time mandatory so it wonu2019t work.

I have checked with user exit IWOC0001 now system pop up error massage end date and time mandatory but do not allow to save order. Whenever I enter end date and time and try to save system again pop up error massage end date and time is mandatory.

Please advice if anything I need to do in config or in code.

Many Thanks

Yogesh

Accepted Solutions (1)

Accepted Solutions (1)

former_member187991
Active Contributor
0 Kudos

hi

Are you referring to the Order basic finish date or Malfunction end date in the notification .you can use IWO10004 Maintenance order: Customer check for order completion where you can write the logic for checking the Malfunction end date as mandatory .

kindly consult with the technical team ,if you have activated the user exit ,while saving it will prompt the error as per your program ,if you have specified the same then system will allow you to TECO the order , if not then check your logic once again ,may be you have specified some other fields

regards

thyagarajan

Former Member
0 Kudos

Hi Thyagarajan,

My purpose is getting solved by using User exit IWOC0001. Only thing is I am not able to save order. While saving system is again pop up massage start and end date is mandatory.

Do I still need to check with IWO10004 user exit or I am missing with some coding/logic in IWOC0001. Please advice.

Many Thanks

Yogesh

former_member187991
Active Contributor
0 Kudos

hi

Are you sure you have achieved using the user exit IWOC001 , if so then check the logic you have entered ,may be it has referenced the wrong field .since as per your thread after entering the value still system is asking again

kindly check the field entered and cross check with technical team

regards

thyagarajan

peter_atkin
Active Contributor
0 Kudos

Yogesh,

IWOC0001: Create PM/SM notification: Determine reference object... why did you use this user-exit?

IWO10004 is the correct user-exit (TECO/CLSD)

PeteA

former_member220863
Active Contributor
0 Kudos

Dear Yogesh

User Exit IWOC0001 is the right for the purpose.Plz check the logic.

regards

sunil

peter_atkin
Active Contributor
0 Kudos

Sunil,

IWOC0001: Create PM/SM notification: Determine reference object

Please explain why this is "right for the purpose"

PeteA

former_member220863
Active Contributor
0 Kudos

Dear Pete,

My mistake ,IWO10004 is useful for the purpose.

regards

sunil

Former Member
0 Kudos

Dear Mr.Pete, Mr. Thyagarajan, Mr.sunil,

Thank you for your advice

The User Exit IWO10004 is working however it have some issues.

1) System pop up error massage malfunction end date and time mandatory when I click on TECO tab but donu2019t show the pop up window like in normal scenario of TECO.( I am using order type PM02 i.e Breakdown order)

I accept that I will enter malfunction end date and time in order header data tab but after saving order it wonu2019t TECO. It gets saved only. I have to reopen (IW32) the order and again need to TECO the order.

When I reopen the order (IW32) and again click on TECO tab system pop up the window like in normal scenario if I click continue/Enter button, system do TECO however if I remove the end date and time still system save TECO order but in IW33 I donu2019t get the malfunction end date and time that filed remain empty.

2) I have a scenario whenever User create order type PM02 (Breakdown maintenance order) system create N2 type notification in background. I checked notification created in background before TECO, I observed that system take Required End Date and time by default same as required Start Date and Time and it remain same after order TECO where my notification get completed.

If I remove user exit IWO10004 system behave normally. I mean it donu2019t take Required End date and Time in notification. Both filed remain empty.

However if I use User Exit IWOC0001 the scenario remain normal but I am not able to save the order.

Please advice what could be best solution in this case.

Many Thanks

Yogesh

former_member187991
Active Contributor
0 Kudos

hi

After system gives the error message kindly specify the same and then press again the TECO button ,i think system will TECO the order and then it will be saved.kindly check

for the second instance since the Required end date and time are mandatory it will copied in the notification automatically ,whether are you facing any problem

regards

thyagarajan

Former Member
0 Kudos

Hi Thyagarajan,

It is not happening, if I press TECO button after entering End date and time system pop up same error massage End date and Time Mandatory.

I must need to save order once entering end date and time and then reopen and do TECO tab.

Former Member
0 Kudos

Dear Experts,

Any other opinion/suggestion/ advice to overcome the problem or it is not possible in standard SAP.

Awaiting for your kind cooperation.

Many Thanks

Yogesh

peter_atkin
Active Contributor
0 Kudos

Yogesh,

In IWO10004, did you use the syntax RAISE COMPLETION_REJECTED?

* Example code
if lv_reject = 'X'.
 message e123(ABC).
 raise completion_rejected.
endif.

PeteA

Former Member
0 Kudos

HI Pete,

I am not using RAISE COMPLETION_REJECTED.

u201CRaiseu201D is used for exception handling,

If I am not wrong u201CRaiseu201D is use for exception handling.

For your reference please find code I am using,

*break-point.

DATA : AUSBS TYPE AUSBS,

AUZTB TYPE AUZTB,

QMART TYPE QMART.

*DATA : WA_AFIH LIKE AFIH .

SELECT SINGLE AUSBS AUZTB QMART

INTO (AUSBS,AUZTB,QMART)

FROM VIQMEL

WHERE QMNUM = CAUFVD_IMP-QMNUM .

IF CAUFVD_IMP-IPHAS = 2.

IF AUSBS = '00000000' OR AUZTB = '000000' .

MESSAGE 'Malfunction end date and End time is mandatory ' TYPE 'E'.

EXIT.

ENDIF.

ENDIF.

Many Thanks

Yogesh

peter_atkin
Active Contributor
0 Kudos

Yogesh,

You need to add the RAISE function so that the system knows that you are rejecting TECO.

You may also have issues with selecting the data from VIQMEL (database data). The user may have changed the data in the notification and not have saved it yet...

PeteA

Former Member
0 Kudos

Hi pete,

I am not getting you.

I am not rejecting TECO. Secondly I am not doing any changes in Notification.

The only problem I am facing is

System pop up error massage malfunction end date and time mandatory when I click on TECO tab but donu2019t show the pop up window like in normal scenario of TECO.( I am using order type PM02 i.e Breakdown order)

I accept that I will enter malfunction end date and time in order header data tab but after saving order it wonu2019t TECO. It gets saved only. I have to reopen (IW32) the order and again need to TECO the order.

When I reopen the order (IW32) and again click on TECO tab system pop up the window like in normal scenario if I click continue/Enter button, system do TECO however if I remove the end date and time still system save TECO order but in IW33 I donu2019t get the malfunction end date and time that filed remain empty.

Please suggest what code I have to write.

Many Thanks

Yogesh

peter_atkin
Active Contributor
0 Kudos

Why don't you try adding the RAISE code and see what happens...

Former Member
0 Kudos

Hi Pete,

I tried find

_*lv_reject = 'X'*_

in the system, however I couldnu2019t found that.

Could you please elaborate where to add

RAISE COMPLETION_REJECTED
syntax

in the code.

Please find current code in the system.

*break-point.
DATA : AUSBS TYPE AUSBS,
AUZTB TYPE AUZTB,
QMART TYPE QMART.
*DATA : WA_AFIH LIKE AFIH .

SELECT SINGLE AUSBS AUZTB QMART
INTO (AUSBS,AUZTB,QMART)
FROM VIQMEL
WHERE QMNUM = CAUFVD_IMP-QMNUM .

IF CAUFVD_IMP-IPHAS = 2.

IF AUSBS = '00000000' OR AUZTB = '000000' .
MESSAGE 'Malfunction end date and End time is mandatory ' TYPE 'E'.
EXIT.
ENDIF.
ENDIF.

Many Thanks

Yogesh

peter_atkin
Active Contributor
0 Kudos

Try this:


* Data definitions
DATA : AUSBS TYPE AUSBS, AUZTB TYPE AUZTB, QMART TYPE QMART.

* Released order only
CHECK CAUFVD_IMP-IPHAS = 2.

* Get notification 
SELECT SINGLE AUSBS AUZTB QMART
    INTO (AUSBS,AUZTB,QMART)
      FROM VIQMEL
        WHERE QMNUM = CAUFVD_IMP-QMNUM .

IF SY-SUBRC = 0.     " Notification found
   IF AUSBS = '00000000' OR AUZTB = '000000' .
       RAISE COMPLETION_REJECTED.   "<<<<---------- Reject TECO
       MESSAGE 'Malfunction end date and End time is mandatory ' TYPE 'E'.
   ENDIF.
ENDIF

Former Member
0 Kudos

Hi Pete,

There is no change post applying this code.

In fact I am not getting error massage end date and time mandatory when I click on TECO tab without entering end date and time, and TECO tab donu2019t work.

When I enter date and time again I have to save order first. Then reopen and DO TECO this I was achieved by previous codes.

Hope I have clear concern,

Many Thanks

Yogesh

peter_atkin
Active Contributor
0 Kudos

I've swapped two lines of code around, so try this:


* Data definitions
DATA : AUSBS TYPE AUSBS, AUZTB TYPE AUZTB, QMART TYPE QMART.
 
* Released order only
CHECK CAUFVD_IMP-IPHAS = 2.
 
* Get notification 
SELECT SINGLE AUSBS AUZTB QMART
    INTO (AUSBS,AUZTB,QMART)
      FROM VIQMEL
        WHERE QMNUM = CAUFVD_IMP-QMNUM .
 
IF SY-SUBRC = 0.     " Notification found
   IF AUSBS = '00000000' OR AUZTB = '000000' .
       MESSAGE 'Malfunction end date and End time is mandatory ' TYPE 'E'.
       RAISE COMPLETION_REJECTED.   "<<<<---------- Reject TECO
   ENDIF.
ENDIF

Former Member
0 Kudos

Hi Pete

That I already tried. At least I can understand that much man. 

Many Thanks

Yogesh

peter_atkin
Active Contributor
0 Kudos

I've no way of knowing your experience level...

Try this:


* Data definitions
DATA : AUSBS TYPE AUSBS, AUZTB TYPE AUZTB, QMART TYPE QMART.
 
* Released order only
CHECK CAUFVD_IMP-IPHAS = 2.
 
* Get notification 
SELECT SINGLE AUSBS AUZTB QMART
    INTO (AUSBS,AUZTB,QMART)
      FROM VIQMEL
        WHERE QMNUM = CAUFVD_IMP-QMNUM .
 
IF SY-SUBRC = 0.     " Notification found
   IF AUSBS = '00000000' OR AUZTB = '000000' .
       MESSAGE I398(00) WITH 'Malfunction end date and End time is mandatory'.
       MESSAGE I398(00) RAISING COMPLETION_REJECTED.
   ENDIF.
ENDIF.

PeteA

Former Member
0 Kudos

Hi Yogesh,

The code which you/your developers had written will never work....

Reason being that you can trying to check(atleast 2nd time) the malfunction end date and end time which is still not stored in database (view viqmel.. table QMEL)....

So, you will always get blank date and time when you try to read from database....

The structure which you should access is (SAPLIQS0)VIQMEL. This is a dialog structure and it will have all the data whatever you have entered on the screeen w.r.t notification.

Probably you can try this code... (with some more proper checks)

FIELD-SYMBOLS <ls_ausbs> TYPE any.

FIELD-SYMBOLS <ls_auztb> TYPE any.

  • Released order only

CHECK CAUFVD_IMP-IPHAS = 2.

ASSIGN ('(SAPLIQS0)VIQMEL-AUSBS') TO <ls_ausbs>.

ASSIGN ('(SAPLIQS0)VIQMEL-AUZTB') TO <ls_auztb>.

IF SY-SUBRC = 0. " Notification data found

IF <ls_ausbs> = '00000000' OR <ls_auztb> = '000000' .

MESSAGE I398(00) WITH 'Malfunction end date and End time is mandatory'.

MESSAGE I398(00) RAISING COMPLETION_REJECTED.

ENDIF.

ENDIF.

Hope this helps....

Best Regards,

Subhakanth

Former Member
0 Kudos

HI Subhakanth,

This code is workingu2026 My problem solved.

Thank you very much for your Suggestion.

I am closing the thread.

Hi Pete,

Thank you for your advice as well.

Cheers

Yogesh

Former Member
0 Kudos

Sorry Team,

I was forgot to copy the codes here

Here are the code.

CHECK CAUFVD_IMP-AUART = 'PM20'.

FIELD-SYMBOLS <A> TYPE ANY.
FIELD-SYMBOLS <B> TYPE ANY.

* Released order only
CHECK CAUFVD_IMP-IPHAS = 2.

ASSIGN ('(SAPLIQS0)VIQMEL-AUSBS') TO  <A>.
ASSIGN ('(SAPLIQS0)VIQMEL-AUZTB') TO <B>.

IF SY-SUBRC = 0.     " Notification data found
  IF  <A> = '00000000' OR  <B> = '000000' .
    MESSAGE I398(00) WITH 'Malfunction end date and End time is mandatory'.
    MESSAGE I398(00) RAISING COMPLETION_REJECTED.
  ENDIF.
ENDIF.

peter_atkin
Active Contributor
0 Kudos

Thanks Yogesh, we got there in the end..

PeteA

Former Member
0 Kudos

Pere,

Thanks to you too for your help.

Cheers

Yogesh

Answers (0)