cancel
Showing results for 
Search instead for 
Did you mean: 

Custom message for user status in Work Order

former_member193016
Participant
0 Kudos

Dear all,

I created one user status profile for Work Order that limits the WO release based on some requests. Now, when the release is performed, the customer wants that a message that explains the reason for blocking the release have to be shown into the status bar instead of a pop-up that said that "The business transaction cannot be carried out".

Can you help me and explain what can be done so the reason to be shown in the status bar of the Work Order?

Thank you very much.

Sorin

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

This can be done with user exit IWO10002 using function module to retrieve user status such as STATUS_TEXT_EDIT. When you are going to use this User-exit, then you might have to remove the Release Forbidden setting in OIBS. Because the standard error through OIBS might trigger first.

Answers (1)

Answers (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Here is the solution. The following code to be put in the include ZXWO1U02 of user-exit IWO10002.



IF CAUFVD_IMP-AUART = 'ZM03'.

   DATA: L_STSMA TYPE JSTO-STSMA,
         L_STONR TYPE TJ30-STONR.

   CALL FUNCTION 'STATUS_READ'
     EXPORTING
       OBJNR       = CAUFVD_IMP-OBJNR
       ONLY_ACTIVE = 'X'
     IMPORTING
       STSMA       = L_STSMA
       STONR       = L_STONR.

   IF ( L_STSMA = 'PM_ORD5' AND L_STONR = '10' ) OR
      ( L_STSMA = 'PM_ORD5' AND L_STONR = '20' ).
     MESSAGE: 'You can not release the Order with ''INIT'' or ''BLOK'' user status'
   TYPE 'E' DISPLAY LIKE 'I'.
   ENDIF.

ENDIF.


Note:

1.In the above code PM_ORD5 is the status profile created in OIBS).

2. First and last line of the code limits the applicability of this code to Order type 'ZM03'.

With this code in place and when user tries to release an Order with mentioned user statuses (no 10 and no 20), he gets this error pop-up.

You can modify this message as per your requirement.

KJogeswaraRao